I posted reStructuredText in Jekyll on Tuesday, 8 September, 2015

I can write Jekyll posts with reStructuredText now.

Post jekyll rst site

reStructuredText in Jekyll

I can write Jekyll posts with reStructuredText now.

I spent the last few days fiddling with Pelican and Nikola to see how much work it would take to convert my site. So far? Lots of work. I customized the build for this silly site quite a bit.

Meanwhile I decided that I must have reStructuredText available for my posts. I grabbed the jekyll-rst Jekyll plugin and followed its directions.

$ mkvirtualenv jekyll-rst
$ pip install docutils pygments
$ gem install RbST
$ git submodule add https://github.com/xdissent/jekyll-rst.git _plugins/jekyll-rst

Let me just build real quick to make sure this works at all.

Well, no.

$ bundle exec jekyll build -D
# ...
TypeError: Unicode-objects must be encoded before hashing
Exiting due to error.  Use "--traceback" to diagnose.
Please report errors to <docutils-users@lists.sf.net>.
Include "--traceback" output, Docutils version (0.12 [release]),
Python version (3.4.3), your OS type & version, and the
command line used.

Oh I know that smell. You get that with code that isn’t completely ready for Python 3. Here’s the smallest change to make that error go away.

_plugins/jekyll-rst/directives.py line 54-55
content_text = u'\n'.join(self.content).encode('utf-8')
cache_file_name = u'%s-%s.html' % (lexer_name, hashlib.md5(content_text).hexdigest())

Now it builds.

Then I ripped out all the special options because that was easier than adjusting my stylesheets to take them into account.

So. It works. Yay! I can write Jekyll posts with reStructuredText!

That should keep me a little happier while I continue porting the site to another generator.

Indieweb Social

Did you mention this somewhere? I'd love it if you sent me the link!

disclaimer about timing

Mentions are sent to webmention.io. I fetch the latest mentions when building the site, so I may not see your feedback right away. Especially if my site's broken, which is often the case.

Public replies and mentions might be shared on the site, but I try to do a little quality check first.

Site Links