pretzel icon indicating copy to clipboard operation
pretzel copied to clipboard

Table of contents for wiki page

Open elacy opened this issue 9 years ago • 3 comments

On Wikipedia you can add a table of contents for a really long page that uses the headings. Is it possible to add a feature like that to pretzel? Perhaps a flag in at the top of the page along with layout and title?

elacy avatar Apr 15 '15 16:04 elacy

There is nothing like this in Pretzel, but PR are welcome! :smiley: I like the idea but haven't time to work on it...

laedit avatar Apr 15 '15 17:04 laedit

After some thinking I believe that a custom IContentTransform can do the trick, by parsing the HTML of the page, get all titles, build the TOC and replace a special token (like <!-- TOC --> maybe? I don't know what Wikipedia use.) by the TOC.

laedit avatar Apr 16 '15 05:04 laedit

By the way, if you end up creating a plugin and you want to share it, please let us know the repo that we can add in our (future) wiki page for all plugins. :smile:

laedit avatar Apr 22 '15 05:04 laedit