๐Ÿ“ฆ hyoban / remark-github-alerts

Support GitHub-style alerts for remark

โ˜… 18 stars โ‘‚ 2 forks ๐Ÿ‘ 18 watching โš–๏ธ MIT License
github-flavored-markdownmarkdownnextraremark
๐Ÿ“ฅ Clone https://github.com/hyoban/remark-github-alerts.git
HTTPS git clone https://github.com/hyoban/remark-github-alerts.git
SSH git clone git@github.com:hyoban/remark-github-alerts.git
CLI gh repo clone hyoban/remark-github-alerts
github-actions[bot] github-actions[bot] chore: release v0.1.1 43ff491 10 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ .vscode
๐Ÿ“ examples
๐Ÿ“ playground
๐Ÿ“ src
๐Ÿ“ styles
๐Ÿ“ test
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmrc
๐Ÿ“„ .release-it.json
๐Ÿ“„ build.config.ts
๐Ÿ“„ CONTRIBUTING.md
๐Ÿ“„ eslint.config.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ README.md

remark-github-alerts

npm version npm downloads bundle JSDocs License

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