Fixed documentation script.

This commit is contained in:
Frank
2011-07-03 13:29:34 +02:00
parent be0a4eb5cd
commit b2173b1b60

View File

@@ -1,19 +1,17 @@
import misaka as m
if __name__ == '__main__':
with open('./documentation.md', 'r') as fd:
src = fd.read().strip()
with open('./documentation.md', 'r') as fd:
src = fd.read().strip()
html = m.html(
src, p.EXT_AUTOLINK, p.HTML_TOC
)
toc = m.toc(src)
html = m.html(src, m.EXT_AUTOLINK, m.HTML_TOC)
toc = m.toc(src)
with open('template.html', 'r') as fd:
tpl = fd.read().strip()
with open('template.html', 'r') as fd:
tpl = fd.read().strip()
tpl = tpl.replace('{{ navigation }}', toc, 1)
tpl = tpl.replace('{{ content }}', html, 1)
tpl = tpl.replace('{{ navigation }}', toc, 1)
tpl = tpl.replace('{{ content }}', html, 1)
with open('index.html', 'w') as fd:
fd.write(tpl)
with open('index.html', 'w') as fd:
fd.write(tpl)