#!/usr/bin/env python
+# SPDX-License-Identifier: NONE
# 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; }
</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")
+ )