Home / GitHub Page

TOC: Minimum level to apply anchors

Both with unordered list both with an ordered list, I think that H1 should not appear in TOC because H1 is simply the title of the note.
So, if I write…

# Title
[TOC]

…I’ll see two times the title and it’s just not useful. Besides, it adds a level to the list that -I think- you don’t need.
I saw in the plugin page that you can set the “Minimum level to apply anchors on or array of selected levels”.
If I correctly understood, I suggest to set the value to 2 instead of the default value 1.


Or am I wrong because the H1 isn’t only the title of the note?

I uae # as my first level all the time, but yes, there’s an option for the module. However, I think that setting the minumum level is rather confusing.

I would rather add an option to set the max depth. I’ve already opened a FR for that.

I see your point but please let me explain better what I mean.

Hypothesis

  • I use H1 only once in a note, for the title.

Results

  • the title of the note and the H1 heading are the same
  • in the TOC there is only one item in the firts ul

Further results

So, if the hypothesis is wrong, that is we mustn’t use h1 for the title of the note (the same that appears in the list of notes), then it’s ok. But if it reasonable - as I think - that h1 is used to write the title of the note, then something should be modified because the result isn’t good.

I’m still not sure I understand. Why on Earth do you want to use h1 just for the note title?

h1 is used for level 1 headings, not to denote a title.

There’s a separate field for the note title. It makes no sense to repeat the note title in the note body again.

Let’s think about this for a second. Take any other toc system. Do you write a book and start your toc with the book title. in that case every chapter will be level 2. Does this make any sense to you?
Take any document you write with a word processor or LaTeX. Is level 1 of your toc the document title?

While I understand your problem, it is one of your own making. level 1 headings are not for note titles.

1 Like

@laurent there’s one item @desk7 is right about. Printing the note adds a # title to the note, before it is rendered for printing. This was probably a quick hack, but must be changed in light of the toc module.

We have to replace it with something that will not influence the toc. I suggest to use html and make the title just 300% bigger than normal text. That should do it.