Michael,
You can add a TOC to your document. You basically use the markdown library to render your document. A simple example is to pass your document text to this script and then show the result in an HTML panel. You will also need to add [TOC] in your document where you want your TOC to show.
import workflow import markdown action_in = workflow.get_input() md = markdown.Markdown(extensions=['toc','footnotes']) html = md.convert(action_in) action_out = html workflow.set_out(action_out)