sethyuan / logseq-plugin-tocgen

Generate a TOC of any page anywhere to quickly access the page's content.
MIT License
144 stars 10 forks source link

Frontmatter is included in ToC #1

Closed Bad3r closed 2 years ago

Bad3r commented 2 years ago

Hi,

Thanks for making this cool plugin!

I noticed that when specifying level 1 and referencing a page that includes frontmatter. The properties will be included as a heading 

{{{toc [[arch linux]], 1}}}

Rendered:

Would it be possible to make the plugin only display bullets that are a heading H1, H2, H3, ...?

sethyuan commented 2 years ago

@Bad3r Thanks for letting know of this issue, I'll investigate it. I can probably have a fixed version released this weekend.

As for displaying only for headings, I don't want it to be the only option, maybe I can add it as an optional feature that you can turn on through parameters and plugin settings.

BTW, I recently added a feature for generating TOC for a block instead of a page. You're welcomed to give it a try (more details in the README).

Bad3r commented 2 years ago

@sethyuan thsnk you. I look forward to the update. Adding it as feature would be awesome.

sethyuan commented 2 years ago

@Bad3r A new version is released with this bug fixed. I also implemented "heading only" TOC as you suggested. You need to update the macro to accept a 3rd argument if you want to use this feature. I updated the README to reflect this.

Bad3r commented 2 years ago

@sethyuan Awesome thank you works perfectly!