✨ NEW: Add myst_title_to_header configuration#492
Conversation
Codecov Report
@@ Coverage Diff @@
## master #492 +/- ##
==========================================
+ Coverage 89.75% 89.81% +0.06%
==========================================
Files 16 16
Lines 2069 2072 +3
==========================================
+ Hits 1857 1861 +4
+ Misses 212 211 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Agree with the implementation + your assessment of where it might be confusing. I think it'd be great if specifying |
|
I think it would be good to check what the behaviour of e.g. pandoc is on this, then just copy that. If even a little more complex, it should be possible either way |
See https://pandoc.org/MANUAL.html#metadata-blocks
---
title: A **title**
---
# Header
$ pandoc -s test.md
...
<body>
<header id="title-block-header">
<h1 class="title">A <strong>title</strong></h1>
</header>
<h1 id="header">Header</h1>
</body>i.e. the |
11c6252 to
08d2882
Compare
myst_title_to_header configuration
|
Ok good to go, if you agree @choldgraf, @rowanc1 |
|
Looks good to me! Good to notice the option for this, and updating the docs! |
Cheers! Note, with the recent updates I've made, it would actually be quite easy to set a "header level offset", i.e. to turn every
which I agree is easy for users to understand. So I think the current behaviour is correct and no offset is needed |
This is the "simplest" implementation (3 extra lines!).
Basically, it treats this:
like this (including parsing nested syntax)
# A **title**I'm not sure if this would be the correct/expected implementation though
for example, currently
would be treated as
but should it instead be treated as
(also, on a technical note, the parsing should be a bit smarter, in only allowing inline syntax,
there should probably also be a config to turn it off/on)