Permalink
Browse files

Add a ToC automatically

  • Loading branch information...
kynikos committed Apr 12, 2015
1 parent 0f0e030 commit aa4d0eb345bb9e89ef2be763fadfb6c3d5f53ff7
Showing with 3 additions and 1 deletion.
  1. +3 −1 wembler/subprocesses.py
View
@@ -135,7 +135,9 @@ def url_builder(label, base, end):
def convert(self, article):
with open(os.path.join(self.article_dir, article), 'r') as stream:
self.md.reset()
return self.md.convert(stream.read())
# TODO: Find a better way to automatically add a ToC
text = '[TOC]\n\n' + stream.read()
return self.md.convert(text)
class TitleFound(UserWarning):

0 comments on commit aa4d0eb

Please sign in to comment.