summaryrefslogtreecommitdiff
path: root/tools/render_md.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/render_md.py')
-rw-r--r--tools/render_md.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/render_md.py b/tools/render_md.py
index 16c4bbe8a3..7636496b62 100644
--- a/tools/render_md.py
+++ b/tools/render_md.py
@@ -2,7 +2,7 @@
# written 2016 by David Lamparter, placed in Public Domain.
import sys, markdown
-template = '''<html><head><meta charset="UTF-8"><style type="text/css">
+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; }
@@ -18,11 +18,13 @@ img[alt~="float-right"] { float:right; margin-left:2em; margin-bottom:2em; }
</style></head><body>
%s
</body></html>
-'''
+"""
-md = markdown.Markdown(extensions=['extra', 'toc'])
+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'))
+ 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")
+ )