I've been a Nikola user for a few years now, and I'm a big fan. One of the reasons why I picked it is because it is implemented in Python. Python is of course my favorite programming language. And because Nikola is written in Python, it should be easier for me to write code to build my own extensions.
For various reasons I never actually did that until now. I wanted an Accordion reStructuredText directive, and since it didn't exist, I had to build it myself. And that's what I did. Getting it to work completely took some fiddling but I have it working. See an example below.