@argdown/marked-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.7.7 • Public • Published

@argdown/remark-plugin

Argdown logo

This package is part of the Argdown project and adds Argdown support to the remark parser.

For a more detailed documentation, read the guide on how to use Argdown in Markdown.

Here are the basics from it:

How to add Argdown support to Remark

Install remark, remark-html and @argdown/remark-plugin in your package:

npm install remark remark-html @argdown/remark-plugin

Configure remark:

import remark from "remark";
import remarkArgdownPlugin from "@argdown/remark-plugin";
import html from "remark-html";

const defaultSettings = {};
const rm = remark()
  .use(remarkArgdownPlugin, {
    argdownConfig: (cwd) => {
      return defaultSettings;
    }
  })
  .use(html as any);

const markdownInput = `
# Argdown in Markdown

\`\`\`argdown
[s]
    <- <a>
\`\`\`
`;

const argdownConfig = { webComponent: { withoutHeader: true }; // example configuration
rm.process(markdownInput, (error, file)=>{
    if(!error){
        console.log(htmlOutput);
    }else{
        console.log(error);
    }
});

Package Sidebar

Install

npm i @argdown/marked-plugin

Weekly Downloads

3

Version

1.7.7

License

MIT

Unpacked Size

20.8 kB

Total Files

12

Last publish

Collaborators

  • christianvoigt