Remark
Use Remark to render the markdown content.
Options See on deno.land
- extensions string[]
List of extensions this plugin applies to
Default:[ ".md" ]
- remarkPlugins object
List of remark plugins to use
Default:[remarkGfm]
- rehypeOptions object
Options to pass to rehype
Default:{ allowDangerousHtml: true }
- rehypePlugins object
List of rehype plugins to use
- sanitize boolean
Flag to turn on HTML sanitization to prevent XSS
Default:false
- useDefaultPlugins boolean
Set
Default:false
to remove the default pluginstrue
Description
This plugin use Remark to render the markdown files, replacing the default markdown-it
library. It allows to use Remark and Rehype plugins. By default it uses the GitHub-flavored markdown.
Installation
Import this plugin in your _config.ts
file to use it:
import lume from "lume/mod.ts";
import remark from "lume/plugins/remark.ts";
const site = lume();
site.use(remark());
export default site;
Plugins
Use the remarkPlugins
and rehypePlugins
to configure additional plugins:
import lume from "lume/mod.ts";
import remark from "lume/plugins/remark.ts";
import a11yEmoji from "npm:@fec/remark-a11y-emoji";
import rehypeRemoveComments from "npm:rehype-remove-comments@5";
const site = lume();
site.use(remark({
remarkPlugins: [a11yEmoji],
rehypePlugins: [rehypeRemoveComments],
}));
export default site;