We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe change the <<doc>> code with:
<<doc>>
def headlines2html(headlines): cur_level = 0 result = [] for level, content in headlines: while level>cur_level: result.append('\t'*cur_level+'<ul>') cur_level += 1 while level<cur_level: cur_level -= 1 result.append('\t'*cur_level+'</ul>') result.append('{0}<li><a href="#{1}">{1}</a></li>'.format('\t'*cur_level, content)) while cur_level: cur_level -= 1 result.append('\t'*cur_level+'</ul>') return "\n".join(result) headlines = [ (1, u'headline 1 level 1'), (2, u'headline 2 level 2'), (2, u'headline 3 level 2'), (4, u'headline 4 level 4'), (1, u'headline 5 level 1'), (3, u'headline 6 level 3') ] print(headlines2html(headlines))
based on code from http://www.python-forum.de/viewtopic.php?p=258144#p258144
The text was updated successfully, but these errors were encountered:
support for chaotic <<toc>>
3f55b32
No branches or pull requests
Maybe change the
<<doc>>
code with:based on code from http://www.python-forum.de/viewtopic.php?p=258144#p258144
The text was updated successfully, but these errors were encountered: