diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-01 11:10:01 -0500 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-03-01 11:10:01 -0500 |
| commit | a975744835bb87e3cf62701e13248d66f1dac1df (patch) | |
| tree | bca5ab1f29594688c43e0c36c9eb2f0c5c8e66c6 /tools/render_md.py | |
| parent | 351c56649bfd8487676704a10995d736d1d893cc (diff) | |
| parent | c98f4d81aa5d4113ceea58ce6db4bebab5c99735 (diff) | |
Merge branch 'master' into docuser
* New manpage: mtracebis.rst
* Makefile.am includes mtracebis.rst
* configure.ac lines removed
* Debian packaging files updated
* Fixed up manpage |seealso-programs| in the process
* Centos7 build package list updated to include systemd-devel
* New paragraph on netns vrf support in zebra manpage
Conflicts:
configure.ac
debianpkg/backports/ubuntu14.04/debian/frr.install
debianpkg/frr.install
doc/Makefile.am
doc/developer/Building_FRR_on_CentOS7.rst
doc/zebra.8.in
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'tools/render_md.py')
| -rw-r--r-- | tools/render_md.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/render_md.py b/tools/render_md.py new file mode 100644 index 0000000000..16c4bbe8a3 --- /dev/null +++ b/tools/render_md.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python +# written 2016 by David Lamparter, placed in Public Domain. +import sys, markdown + +template = '''<html><head><meta charset="UTF-8"><style type="text/css"> +body { max-width: 45em; margin: auto; margin-top: 2em; margin-bottom: 2em; + font-family:Fira Sans,sans-serif; text-align: justify; + counter-reset: ch2; } +pre, code { font-family:Fira Mono,monospace; } +pre > code { display: block; padding:0.5em; border:1px solid black; + background-color:#eee; color:#000; } +h2:before { content: counter(ch2) ". "; counter-increment: ch2; } +h2 { clear: both; margin-top: 3em; text-decoration: underline; counter-reset: ch3; } +h3:before { content: counter(ch2) "." counter(ch3) ". "; counter-increment: ch3; } +h3 { clear: both; margin-top: 2em; font-weight: normal; font-style: italic; } +h4 { font-weight: normal; font-style: italic; } +img[alt~="float-right"] { float:right; margin-left:2em; margin-bottom:2em; } +</style></head><body> +%s +</body></html> +''' + +md = markdown.Markdown(extensions=['extra', 'toc']) + +for fn in sys.argv[1:]: + with open(fn, 'r') as ifd: + with open('%s.html' % (fn), 'w') as ofd: + ofd.write((template % (md.convert(ifd.read().decode('UTF-8')))).encode('UTF-8')) |
