Remark
Use Remark to render the markdown content.
Options
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, { removeConditional: true }]],
}));
export default site;
mdRemark helper
The plugin also register the mdRemark filter, useful to render markdown:
{{ "Hello **world**" |> mdRemark }}