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:

Multilingual Sitemaps

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 Plots

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.

Classy Images

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

Mediawiki Markup

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 :-)

Comentarios

Comments powered by Disqus