remark-hugo-lint

Remark-based linter for Hugo

Usage no npm install needed!

<script type="module">
  import remarkHugoLint from 'https://cdn.skypack.dev/remark-hugo-lint';
</script>

README

remark-hugo-lint

Licence NPM

Remark-based linter for markdown with Hugo-style shortcodes.

Example

import { promises } from 'fs'
import { Formatter } from '.'

const formatter = new Formatter({
    tokens: [['[[', ']]']],
    inlineMode: true,
    markdownAttributes: ['title', 'alt', 'caption']
})

promises.readFile('in.md', 'utf8')
    .then(code => formatter.format(code))
    .then(clean => promises.writeFile('out.md', Buffer.from(clean)))
    .then(() => console.log('Done!'))

See also