bastianallgeier / triptrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Idea] Heading offsets

hdodov opened this issue · comments

This field is likely to be used for stuff like blog posts. There, you'd want to have one <h1> (which is the title field) and perhaps a subtitle (which might be a subtitle field). This is just good SEO and is how Medium works. This means that in your content, you'll mainly have <h3> and up (again, how Medium works as well). This is also an argument for #8.

My argument is that in the editor, you'll likely be writing ### and #### most of the time, which can get annoying. My proposal is to be able to configure a "heading offset" that specifies the starting heading index.

For example, the default heading offset could be 0, which means:

  • # == <h1>
  • ## == <h2>
  • and so on...

However, if you set headingOffset: 2, you get:

  • # == <h3>
  • ## == <h4>
  • and so on...

This is useful for two reasons:

  1. You get a better writing experience since you won't be counting hash symbols.
  2. If at some point you wish to change the heading hierarchy, you just change the heading offset. For example, if I had headingOffset set to 2 and I want all <h3> to turn into <h2> (and all others to be adjusted accordingly), I would simply reduce headingOffset by 1. I wouldn't have to change the content at all.