Some New Stuff in Nikola
I did some quick work on Nikola (a static website/blog generator) lately, after a long time, and here's what it was:
So, sitemaps are used by Google to index your site. It turns out that they can describe when there are sets of pages that are translations of each other. So the next release will do that (Issue #1610)
Matplotlib comes with a sphinx extension to do plots So I went and implemented it, this was Issue #1242 and it's a plugin called pyplots, which will be soon at http://plugins.getnikola.com#pyplots
I hated the original code. It felt convoluted, and just weird (it's probably just me) so I wrote it from scratch and it has some minor differences, but it's fairly compatible.
The docutils image directive, for whatever reason, doesn't support a class option, so you need to do things like this:
.. class:: foo .. image:: blah.png
Which is ... not pretty. So I did a hacky plugin that monkeypatches the image directive to add that option. The plugin is at http://plugins.getnikola.com/#classy-images and this fixes Issue 1538
djbclark pointed out that there is a library to parse MediaWiki from python called smc.mw so I implemented a plugin to use it, so now you can use MediaWiki markup. The plugin is at http://plugins.getnikola.com/#mediawiki
Removed Default Swatch from Bootswatch
This was Issue #1656 and now you have to specify the swatch. This is a usability fix, because defaults matter.
Played with KaTeX
Nikola supports math using MathJax. MathJax has some interesting qualities:
It's 160MB of code or so
It's not practical to use without a CDN
It's not practical to use webasset bundles with it
Then, klingtnet mentioned something called KaTeX I had never heard about. I did a quick hacky conversion to see how it works. Not done yet, totally experimental, but it may be possible to bundle it, and maybe even have it turned on by default, removing the need for the mathjax label which is awful usability-wise.
Some of these things are merged, some are still PRs, some are in core, some are plugins. They were all pretty fun to do :-)
I'm a bit lost with the purpose of the Classy Images plugin.
This seems to be valid reST for the docutils parser:
At least rst2html doesn't complain, and generates the expected result. So I don't understand what use case Classy Images is trying to solve/fix...
I wonder what I was drinking? I could swear this used to fail.
Looks like I misunderstood the bug. The problem is that when you have a target and a class, the class is applied to the img tag, and that made the islink hack fail. So this was never necessary, and I will delete it now :-)
I had just started to add the :class: option to dozens of posts that link to Flickr (aka apply the islink hack), and then read this, and found the bug #1538, and the comment that having a :class: option inside an image directive was not standard reST, and panicked :P, because even if "Classy Images" seemed clean and small enough I didn't want to use non-standard reST. At first I thought "ok, this works because of this particular monkey-patching", but then I saw the plugin was commited just a few days ago, so I don't have it yet. And that's when I asked :-)
Good to confirm that mi reST is still standard then! Now I can go on with the (boring!) task of adding the damned class option...
You could tweak the template and make it be the other way around :-)
So then only links with a specific class get colorbox
It's actually quite possible to already use KaTeX with Nikola, although it's kind of suckish:
http://kirbyfan64.github.io... (the page)
https://raw.githubuserconte... (source code)