marp-core icon indicating copy to clipboard operation
marp-core copied to clipboard

Slugify Markdown headers

Open yhatt opened this issue 3 years ago • 0 comments

Providing built-in slugified headers in Marp Core will improve anchor navigation in Marp for VS Code.

# ABC
## DEF
## GHI JKL
### DEF

<h1 id="abc">ABC</h1>
<h2 id="def">DEF</h2>
<h2 id="ghi-jkl">GHI JKL</h2>
<h3 id="def-2">DEF</h3>

Requirements

  • Using a compatible rule with GitHub to slugify may be better. VS Code's intellisense looks like to be adopted compatible rule with GitHub in header slugs.

  • Generating slug for ID anchors must be able to disable because a generated slide snippets by Marp Core may be used in a middle of website. If conflicted IDs with exist web contents, an integrated web app may become broken.

Note

Marp CLI has not provided custom anchor link support in bespoke template. This implementation may motivate to support custom anchor links in bespoke template.

Related

yhatt avatar May 21 '22 10:05 yhatt