omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Auto-generate table of contents

    Editorial
    4
    4
    3629
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jeremyburton
      jeremyburton last edited by

      Has anyone already created a workflow to auto-generate a hyperlinked table of contents in Editorial? My searches haven't unearthed anything. I'd like to be able to add a TOC to the top of longer Markdown docs. If no one has already done this, does anyone have any suggestions for how to go about this?

      1 Reply Last reply Reply Quote 0
      • Loveless212
        Loveless212 last edited by

        I have something similar to what you are asking about, mine though takes titles > creates file > than links it.

        1 Reply Last reply Reply Quote 0
        • lrr
          lrr last edited by

          You can put [TOC] at the top of your document, and use a few lines of Python instead of Editorial's renderer. The included markdown module has a toc extension.

          Or you could write a script to put an anchor tag next to each of your headings, and prepend a Markdown list to your document. This is worse in every way, but allows you to edit the TOC independent of the headings.

          1 Reply Last reply Reply Quote 0
          • omz
            omz last edited by

            I've made a little demo workflow using @lrr's approach:

            http://www.editorial-workflows.com/workflow/5874785116487680/QxP96UHBH-o

            If you use the dark theme, you might want to adjust the CSS colors in the Show HTML action.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors