0.1.5 • Published 6 years ago

@pimd/id-plugin v0.1.5

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

PIMD ID Plugin

Adds an HTML ID to code blocks and other elements.

Example usage

# Headline <?: #my-headline ?>

```html #my-code
<p>Example</p>
```

Lorem ipsum dolor sit amet. <?: #my-paragraph ?>

Results in:

<h1 id="my-headline">Headline</h1>

<div id="my-code">
  ...
</div>

<p id="my-paragraph">Lorem ipsum dolor sit amet.</p>

Setup

npm i pimd @pimd/id-plugin
const { Document } = require("pimd")
const Config = require("pimd/lib/config")
const idPlugin = require("@pimd/id-plugin")

const config = new Config()
config.use(idPlugin)

const markdown = `
# Headline <?: #my-headline ?>

\`\`\`html #my-code
<p>Example</p>
\`\`\`

Lorem ipsum dolor sit amet. <?: #my-paragraph ?>
`
const doc = new Document(markdown, config)
console.log(doc.render())

Copyright

Copyright 2018++ Nico Hagenburger. See MIT-LICENSE for details. Get in touch with @hagenburger on Twitter or open an issue.

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago