remarkable-auto-heading-links
v0.0.2
Published
Automatically generates IDs and Heading links for the markdown in remarkable
Downloads
1
Maintainers
Readme
Automatic Remarkable Heading Links
This is a Remarkable plugin, that transforms the headings into headings with ids and links so that you can share #
links.
# Hello, World!
In a normal Markdown compile, the above title will compile to:
<h1>hello, world!</h1>
This plugin, transforms the headings and adds ids and links to them. So the above example, compiles to:
<h1 id="hello-world"><a href="#hello-world">Hello, World!</a></h1>
It's that simple!
How to use?
Install the package:
npm install --save remarkable-auto-heading-id
Then use it like:
const { Remarkable } =
require( "remarkable" )
const { addIDToAllMarkdownHeaders } =
require( "remarkable-auto-heading-links" )
const md =
new Remarkable( remarkSettings )
.use( addIDToAllMarkdownHeaders )
const html =
md.render("# has links!")