Make rst2md runnable and update changelog

This commit is contained in:
Victor Zverovich 2018-12-28 12:04:34 -08:00
parent fe2d715ff1
commit d39ece1870
2 changed files with 12 additions and 4 deletions

View File

@ -180,8 +180,8 @@
`@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_, `@DarkDimius (Dmitry Petrashko) <https://github.com/DarkDimius>`_,
`@HecticSerenity <https://github.com/HecticSerenity>`_. `@HecticSerenity <https://github.com/HecticSerenity>`_.
* Added `pkgconfig` support which makes it easier to consume the library from * Added pkgconfig support which makes it easier to consume the library from
`meson` and other build systems meson and other build systems
(`#916 <https://github.com/fmtlib/fmt/pull/916>`_). (`#916 <https://github.com/fmtlib/fmt/pull/916>`_).
Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_. Thanks `@colemickens (Cole Mickens) <https://github.com/colemickens>`_.
@ -197,7 +197,7 @@
`@hotwatermorning <https://github.com/hotwatermorning>`_, `@hotwatermorning <https://github.com/hotwatermorning>`_,
`@Zefz (JohanJansen) <https://github.com/Zefz>`_. `@Zefz (JohanJansen) <https://github.com/Zefz>`_.
* Improved `string_view` construction performance * Improved ``string_view`` construction performance
(`#914 <https://github.com/fmtlib/fmt/pull/914>`_). (`#914 <https://github.com/fmtlib/fmt/pull/914>`_).
Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_. Thanks `@gabime (Gabi Melman) <https://github.com/gabime>`_.

10
support/rst2md.py Normal file → Executable file
View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
# reStructuredText (RST) to GitHub-flavored Markdown converter # reStructuredText (RST) to GitHub-flavored Markdown converter
import re import re, sys
from docutils import core, nodes, writers 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) self.version = re.match(r'(\d+\.\d+\.\d+).*', node.children[0]).group(1)
raise nodes.SkipChildren raise nodes.SkipChildren
def visit_title_reference(self, node):
raise Exception(node)
def depart_title(self, node): def depart_title(self, node):
pass pass
@ -149,3 +153,7 @@ class MDWriter(writers.Writer):
def convert(rst_path): def convert(rst_path):
"""Converts RST file to Markdown.""" """Converts RST file to Markdown."""
return core.publish_file(source_path=rst_path, writer=MDWriter()) return core.publish_file(source_path=rst_path, writer=MDWriter())
if __name__ == '__main__':
convert(sys.argv[1])