Table of content (TOC)


(Takuya Matsuyama) #21

The TOC plugin author has unfortunately deleted his account. So I decided to take it over.
It is now an official plugin!
The plugin v2.0.3 is out, which supports Inkdrop v3.20.2:

(Julio Venegas) #22

I’m using inkdrop in two different MacBook Pros, in one of them toc is working perfectly fine, in the other it is not working. Any suggestions on what to check to get it running on the computer where it does not work?

(Takuya Matsuyama) #23

Hi Julio,

Please try updating the plugin with:

ipm update

(Julio Venegas) #24

Hi Takuya! Thanks for the quick reply, ran ipm update, was already running on latest version :confused:


(Takuya Matsuyama) #25

That’s weird. You have also the plugin installed on the another MBP, right?
If so, please tell me if any error happens. You can check it on the console from Developer -> Toggle Developer Tools.

(Julio Venegas) #26

Found out what the issue was. TOC only works if there is at least one Header1 item (#) and my document had only Header2 items (##). That’s why it wasn’t generating one. Not sure if that is the expected behavior but it’s clear now why it wasn’t working!

Thanks a lot for the attention though, loving Inkdrop on a daily basis!

(Takuya Matsuyama) #27

Yes, that’s the expected behavior.
Here is how remark-toc works:

  • Looks for the first heading containing 'Table of Contents' , 'toc' , or 'table-of-contents' (case insensitive, supports alt/title attributes for links and images too)
  • Removes all following contents until an equal or higher heading is found
  • Inserts a list representation of the hierarchy of following headings
  • Adds links to following headings, using the same slugs as GitHub

Hope that helps!