]> git.proxmox.com Git - mirror_frr.git/blame - render_md.py
zebra: check ZEBRA_IFC_REAL on if_up
[mirror_frr.git] / render_md.py
CommitLineData
4765f35e
DL
1#!/usr/bin/env python
2# written 2016 by David Lamparter, placed in Public Domain.
3import sys, markdown
4
5template = '''<html><head><meta charset="UTF-8"><style type="text/css">
6body { max-width: 45em; margin: auto; margin-top: 2em; margin-bottom: 2em;
7 font-family:Fira Sans,sans-serif; text-align: justify; }
8pre, code { font-family:Fira Mono,monospace; }
9pre > code { display: block; padding:0.5em; border:1px solid black;
10 background-color:#eee; color:#000; }
11h2 { margin-top: 3em; text-decoration: underline; }
12h3 { margin-top: 2em; font-weight: normal; font-style: italic; }
13h4 { font-weight: normal; font-style: italic; }
14</style></head><body>
15%s
16</body></html>
17'''
18
19md = markdown.Markdown(extensions=['extra', 'toc'])
20
21for fn in sys.argv[1:]:
22 with open(fn, 'r') as ifd:
23 with open('%s.html' % (fn), 'w') as ofd:
24 ofd.write((template % (md.convert(ifd.read().decode('UTF-8')))).encode('UTF-8'))