Reputation: 1581
I'm building a static website with Hakyll and I'm using the PandocCompiler to compile markdown to html. This works perfectly, but the compiler takes this:
# Heading 1
and compiles it to
<h1>Heading 1</h1>
This is the expected result. However, I'd like to start at a lower heading, say, <h3>
, so that:
# Heading 1
compiles to
<h3>Heading 1</h3>
and this:
## Heading 2
compiles to
<h4>Heading 2</h4>
and so on.
I could of course change the markdown itself, but I have many files and it would be a lot of work, and it would make the markdown a bit uglier.
Any ideas on how to do this?
Upvotes: 1
Views: 106
Reputation: 34378
The Hakyll.Web.Html
module includes some useful functions for HTML manipulation, including a demoteHeaders
which should be enough for your needs. It is also worth noting that the withTags
function there allows convenient usage of tagsoup for arbitrary manipulation of HTML tags.
Upvotes: 1