TOC in Markdown editor as Joplin GUI element

I primarily use the Markdown editor without additional preview function. Here I would like to have a GUI element that generates a clickable table of contents from the headings of the note. Visible on top only if the note has headings. Like this is possible with [toc] only that this is not included in Markdown itself but is part of Joplins GUI. Could also be pinnable as an option, so it stays visible when scrolling and also shows where you are in the document.

I had looked through the plugin list before, but could only find such for the renderer. Is there already something there?

You're looking for the Joplin Outline Plugin. You can find it in the joplin plugin install list (Tools -> Options -> Plugin or Joplin -> Preferences -> Plugins) by searching for "Outline" or "TOC".

1 Like

Ah nice. Thank you. But it seems not to save its width. Here it uses half of the editors screen. Which makes it not usable for me. And also ignores headers like:

header
---------

header
=====

EDIT: Yes, the header point is also mentioned in its readme.

Is there a solution to fix the width of the TOC element?

You can use the CSS class .table-of-contents in your userstyle.css file.

For example:


.table-of-contents {
  width: 300px;
}

That does not work here. I also can't find that class in Joplin's DOM.

Oh sorry! it's my bad! I didn't realize that you are using the outline plugin. My suggestion is only work on the TOC feature which is enable from the Tools > Options > Markdown > Enable table of contents extension.

By the way, I don't understand what means of you said "fix the width". Once you slide the edge of the outline plugin window, the size is always be fixed. And the TOC content is also limit by the window size.

I think the issue is when you toggle it (it even provides a shortcut on f9). You resize it once but if you toggle it off and on again it doesn't store the layout information and takes up 50% of what was just the note pane's width.

1 Like

If the case is exactly what @Daeraxa said:

I think the issue is when you toggle it (it even provides a shortcut on f9). You resize it once but if you toggle it off and on again it doesn't store the layout information and takes up 50% of what was just the note pane's width.

I think I can give you an other suggestion but it's just an alternative.

You can go to View > Change Application Layout, and then move the outline plugin window to the same column as notebook panel or notelist panel. Then, the width will be finally limit by the notebook panel or notelist panel.

Ok, I disabled the auto hide feature. That helped. Everything else leads to wrong sizes and jumping around. And I don't want the table of contents to show between notebooks and notes. It's not really logical from the layout, and it's inconvenient if the notes panel jumps all the time when switching between notes with headings and without.

Thank you very much for your help, Nacandev & Daeraxa :+1: