A few months ago I came across a markdown tip for adjusting the start level of your headings.
i.e. it was line you added at the top of the doc where if you specified level 2, all the headings in your doc would go up by that amount. I thought I had noted it for later usage but I can’t see any evidence that I did that.
I’ve searched for online it but I can’t find this syntax anywhere
Maybe I hallucinated this, that is very possible.
Anyone?
TIA
all the headings in your doc would go up by that amount.
I don’t know what you mean by this but…
This limits the TOC to level 2 and 3 headers.
I saw this within the past week somewhere, and I can’t find it.
Pandoc has a --shift-heading-level-by=x. This has the effect of setting the base heading level.
For instance, this source file, test.md:
# test main heading
stuff
## subheading
more stuff
## subhead
last stuff
# ending heading
yet more stuff
Processed with “pandoc --shift-heading-level-by=3 -f markdown -t markdown -o modifiedtest.md test.md” yields:
#### test main heading
stuff
##### subheading
more stuff
##### subhead
last stuff
#### ending heading
yet more stuff
It sounds like you’re referring to the Base Header Level
metadata key in MultiMarkdown. (It’s not a general markdown thing)
The best place to look for most of these “tricks” is the official MultiMarkdown User’s Guide
That’s probably it. Very nice. Thanks.
I was starting to feel like I really had hallucinated it.
I had looked through the multimarkdown guide but somehow missed that.
Phew!
May I ask what is the purpose of this? When and why would you use this?
It seems to be useful/intended for those using transclusion to manipulate heading “depth” but I don’t do any of that and can’t quite wrap my head around how it would work.
My usage was more prosaic.
I had written up some notes for my own use about a prospective project when I was asked to quickly submit them. The original doc had headings, unordered lists/sublists etc.
When I went to print a PDF (not something this note was ever intended for) I found the sizing and spacing of h1-h3 a little too big and clunky. If I could have remembered this little trick it would have been a simple addition of the one line and bumping up/down the base header level until I hit the sweet spot (h3-h5). As it was I changed the headings manually. I also threw in a html page break in there to get it looking good on the page.
I could have done this a few other ways I am sure , like converted the notes to rtf or word, edited the CSS, or something else but really I just needed, at that time, to do this one thing.
I wouldn’t have started in Markdown if I knew where this was going. My default for this specific process is a new DT group where I gather all the emails, docs (pdf PowerPoint, excel, links) that I’ve been sent, open a new markdown file and go through everything so my reactions to all the goals, predictions, guesses, and assumptions are in one place. It helps how I decide whether I want to take a gig.