remark-github-alerts
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

remark-github-alerts

npm version npm downloads bundle JSDocs License

  1. Ported from antfu/markdown-it-github-alerts
  2. Support GitHub-style alerts for remark
  3. Check out the demo

Usage

Install the package:

ni remark-github-alerts

Add the plugin to your processor:

import remarkGithubAlerts from "remark-github-alerts";

const processor = unified()
  .use(remarkParse)
  .use(remarkGithubAlerts)
  .use(remarkRehype)
  .use(rehypeStringify);

Import the styles:

import "remark-github-alerts/styles/github-colors-light.css";
import "remark-github-alerts/styles/github-colors-dark-class.css";
// or
// import "remark-github-alerts/styles/github-colors-dark-media.css"
import "remark-github-alerts/styles/github-base.css";

If you are using Nextra, you can add the plugin to your next.config.mjs:

import nextra from "nextra";
import remarkGithubAlerts from "remark-github-alerts";

const withNextra = nextra({
  theme: "nextra-theme-docs",
  themeConfig: "./theme.config.tsx",
  mdxOptions: {
    remarkPlugins: [remarkGithubAlerts],
  },
});

export default withNextra();

Check Also

Dependencies (1)

Dev Dependencies (22)

Package Sidebar

Install

npm i remark-github-alerts

Weekly Downloads

606

Version

0.1.0

License

MIT

Unpacked Size

23.3 kB

Total Files

12

Last publish

Collaborators

  • hyoban