Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 23 lines (18 sloc) 0.594 kb
#!/usr/bin/env python
import os
from markdown import markdown
def markdown_topics():
"""
Iterate through all topic files and render
them into HTML files to be packaged with the application.
"""
TOPICS_OUTDIR = 'Resources/topics'
if not os.path.isdir(TOPICS_OUTDIR):
os.mkdir(TOPICS_OUTDIR)
for topic in os.listdir('Topics'):
content = open(os.path.join('Topics', topic), 'r')
output = open('%s/%s.html' % (TOPICS_OUTDIR, topic.split('.')[0]), 'w')
html = markdown(content.read(), ['codehilite', 'headerid'])
output.write(html)
if __name__ == '__main__':
markdown_topics()
Jump to Line
Something went wrong with that request. Please try again.