obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: There can only be one.. H1

Open sigrunixia opened this issue 3 years ago • 1 comments

Is Your Feature Request Related to a Problem? Please Describe.

I'd like the option to have Linter keep the first H1 as the primary H1, and then any additional H1's would be ignored and would follow the "Header Increment" rules instead.

My vault is aimed at partly managing a TTRPG with multiple databases, and partly a LitRPG builder. The Templater plugin has been really helpful in cutting down much of copy and pasting work, as is but a side effect is needing to add and remove # depending on where I insert it into the file. Over thousands of files, this time adds up, in addition to the other tweaking I am doing.

Describe the Solution You'd Like

In process, it would look like this.

Current Post-Linter:

H1 Filename/Item Name Header/Description Text in Item
Text Body
H1 Templater Import (H1 Import); Properties of X
Text Body
H2 Image (Created Manually)
Embedded Image

Proposed Post-Linter Example A:

H1 Filename/Item Name Header/Description Text in Item
Text Body
H2 Templater Import (Was H1); Properties of X
Text Body
H3 Image (Created Manually)
Embedded Image

Proposed Post-Linter Example B:

H1 Filename/Item Name Header/Description Text in Item
Text Body
H2 Image (Created Manually)
Embedded Image
H3 Templater Import (Was H1); Properties of X
Text Body

Describe Alternatives You've Considered

I've thought about the simplest and most elegant thing, which is to disable any linting on the template source files themselves. However, the problem would still remain as I these are not always pasted in at the same spots, even amongst similar files.

Removing the heading from the source files solves the linter problem, but then I still have to manually create the heading and type out the names. I'm trying to save my fingers and wrists, if possible. :)

Leaving as is also solves the problem, except I also try to stylize the headings differently using CSS to make the pages look really good, especially when viewed hover.

Additional Context

Cannot think of anything else.

sigrunixia avatar Jul 15 '22 18:07 sigrunixia

+1 from me. My use case:

  1. Copy/Paste stuff from somewhere else
  2. Headers are set according to the source (top level usually h1)
  3. Add a good name for the note
  4. Save the note, linter adds the title as h1
  5. I sigh because I wish linter would have changed all header levels accordingly (h1 -> h2, h2 -> h3 etc.)
  6. Doing dirty shit in other tools like replace all <crlf># with <crlf>##

tuxpeople avatar Sep 08 '22 08:09 tuxpeople