From d39ece18703129000134adf064538319db2353e6 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 28 Dec 2018 12:04:34 -0800 Subject: [PATCH] Make rst2md runnable and update changelog --- ChangeLog.rst | 6 +++--- support/rst2md.py | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) mode change 100644 => 100755 support/rst2md.py diff --git a/ChangeLog.rst b/ChangeLog.rst index ec7d4e1a..bb94d09c 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -180,8 +180,8 @@ `@DarkDimius (Dmitry Petrashko) `_, `@HecticSerenity `_. -* Added `pkgconfig` support which makes it easier to consume the library from - `meson` and other build systems +* Added pkgconfig support which makes it easier to consume the library from + meson and other build systems (`#916 `_). Thanks `@colemickens (Cole Mickens) `_. @@ -197,7 +197,7 @@ `@hotwatermorning `_, `@Zefz (JohanJansen) `_. -* Improved `string_view` construction performance +* Improved ``string_view`` construction performance (`#914 `_). Thanks `@gabime (Gabi Melman) `_. diff --git a/support/rst2md.py b/support/rst2md.py old mode 100644 new mode 100755 index b1a193ce..cf170fe2 --- 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])