rxliuli / joplin-utils

Joplin-based community tool
https://joplin-utils.rxliuli.com/
MIT License
235 stars 36 forks source link

[Feat]: generate table of contents when [TOC] is present #66

Closed danielb2 closed 1 year ago

danielb2 commented 1 year ago

app

joplin-vscode-plugin

Description

plugin to generate table of contents from markdown when [TOC] is present like native joplin would

Describe alternatives you've considered

manually generate table of contents with another vscode plugin

rxliuli commented 1 year ago

Have you tried the markdown-all-in-one plugin, it already supports something similar. ref: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one#table-of-contents

danielb2 commented 1 year ago

Yes, that's the alternative I've considered. Still requires manually generating a TOC which it then keeps up todate. Of course, then when i use joplin, it will not be kept up to date there

rxliuli commented 1 year ago

Well, if you're just for viewing, maybe you don't have to render the toc in html, vscode itself provides similar functionality.

ref: https://code.visualstudio.com/docs/languages/markdown#_document-outline image

In addition, it is indeed a bit strange. I did a simple search, but I did not find a vscode extension that supports this syntax. Isn’t it some existing standard? Or is it only supported in joplin?

danielb2 commented 1 year ago

The outline is a good workaround, thanks

Isn’t it some existing standard? Or is it only supported in joplin?

Not that I'm aware. I've seen some variants of it before tho, for example, I believe some wiki engine had %toc%

danielb2 commented 1 year ago

btw, I recommend two extensions in addition to the ones you have...

between the two, the vscode plugin acts even more like joplin. It's getting to the point where this plugin is almost like JOplin itself which is why I thought the [TOC] was missing

danielb2 commented 1 year ago

@rxliuli not sure you see the msgs after it's been closed

rxliuli commented 1 year ago

Maybe support for joplin's toc syntax can be added at some point, but since there are already alternatives, it won't be a high priority

silopolis commented 1 year ago

@danielb2 I believe the [TOC], or [[TOC]] which also seems to work in Joplin, tag is supported by either the Markdown Extended extension or the Markdown Extended Preview one.

danielb2 commented 1 year ago

@danielb2 I believe the [TOC], or [[TOC]] which also seems to work in Joplin, tag is supported by either the Markdown Extended extension or the Markdown Extended Preview one.

interesting. I had been using the more popular All in one markdown which doesn't have this supported. thanks for this