aboutsummaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorVictor Zverovich <victor.zverovich@gmail.com>2018-12-28 12:04:34 -0800
committerVictor Zverovich <victor.zverovich@gmail.com>2018-12-28 12:04:34 -0800
commitd39ece18703129000134adf064538319db2353e6 (patch)
tree4aeea5ac2481fd4f601f1b557149c86a6471beb8 /support
parentfe2d715ff17dce3378259addc25ee6b8c5a0a70f (diff)
downloadfmtlib-d39ece18703129000134adf064538319db2353e6.tar.gz
Make rst2md runnable and update changelog
Diffstat (limited to 'support')
-rwxr-xr-x[-rw-r--r--]support/rst2md.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/support/rst2md.py b/support/rst2md.py
index b1a193ce..cf170fe2 100644..100755
--- a/support/rst2md.py
+++ b/support/rst2md.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python
# reStructuredText (RST) to GitHub-flavored Markdown converter
-import re
+import re, sys
from docutils import core, nodes, writers
@@ -35,6 +36,9 @@ class Translator(nodes.NodeVisitor):
self.version = re.match(r'(\d+\.\d+\.\d+).*', node.children[0]).group(1)
raise nodes.SkipChildren
+ def visit_title_reference(self, node):
+ raise Exception(node)
+
def depart_title(self, node):
pass
@@ -149,3 +153,7 @@ class MDWriter(writers.Writer):
def convert(rst_path):
"""Converts RST file to Markdown."""
return core.publish_file(source_path=rst_path, writer=MDWriter())
+
+
+if __name__ == '__main__':
+ convert(sys.argv[1])