Skip to content

Instantly share code, notes, and snippets.

@hynek
Last active December 25, 2015 11:49
Show Gist options
  • Save hynek/6972160 to your computer and use it in GitHub Desktop.
Save hynek/6972160 to your computer and use it in GitHub Desktop.
A Marked 2 custom processor that renders reST files with rst2html and leaves the rest be.
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
import subprocess
ext = os.environ['MARKED_EXT'].lower()
if ext == 'rst':
print(subprocess.check_output(
['/usr/local/share/python/rst2html.py',
'--no-xml-declaration', '--stylesheet='],
))
else:
print('NOCUSTOM', file=sys.stderr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment