{"_id":"remark-gh-alerts","_rev":"5-2171a4bd0a98039cc1a3a3e3979afbdb","name":"remark-gh-alerts","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"remark-gh-alerts","version":"0.0.1","keywords":["remark","remark-alerts","remark-gh-alerts","remark-github-alerts","github-favored-markdown"],"author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","_id":"remark-gh-alerts@0.0.1","maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"homepage":"https://github.com/qhanw/remark-gh-alerts#readme","bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"dist":{"shasum":"99a299984800c81d11ca551bae8435f10e2018eb","tarball":"https://registry.npmjs.org/remark-gh-alerts/-/remark-gh-alerts-0.0.1.tgz","fileCount":12,"integrity":"sha512-XzIy58nWps/cdMWo4EUq5uTVA/KPcVrf/YEABuA7OGyQT8C/eiiWX1spblMhJiOMzjIvrK9GaMslqidTQ0a1Iw==","signatures":[{"sig":"MEYCIQClkdX/wHTuGs8e2j/FmRYgcQYE2LV+qfCJidJAetuqqwIhAJpZRvnNFzgVS9SWNFDzB9ITgOQKSTFmKfPbAEGgb5S8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24211},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./styles/*":"./styles/*"},"funding":"https://github.com/sponsors/qhanw","gitHead":"20aa40a29945f9a5e247601459d626d07f4866cb","scripts":{"dev":"unbuild --stub","lint":"eslint .","test":"vitest","build":"unbuild","start":"esno src/index.ts","prepare":"simple-git-hooks","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"qhanw","email":"whenhan@outlook.com"},"repository":{"url":"git+https://github.com/qhanw/remark-gh-alerts.git","type":"git"},"_npmVersion":"10.2.3","description":"Support GitHub-style alerts for remark","directories":{},"lint-staged":{"*":"eslint --fix"},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"unist-util-visit":"^5.0.0"},"typesVersions":{"*":{"*":["./dist/*","./dist/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"esno":"^4.7.0","vite":"^5.1.5","bumpp":"^9.4.0","eslint":"^8.57.0","vitest":"^1.3.1","unbuild":"^2.0.0","prettier":"^3.2.5","typescript":"^5.4.2","@types/node":"^20.11.25","lint-staged":"^15.2.2","simple-git-hooks":"^2.10.0","@antfu/eslint-config":"^2.8.0"},"peerDependencies":{"unified":"^11.0.4","@types/mdast":"^4.0.3"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/remark-gh-alerts_0.0.1_1709883557931_0.051494471119551966","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"remark-gh-alerts","version":"0.0.2","keywords":["remark","remark-alerts","remark-gh-alerts","remark-github-alerts","github-favored-markdown"],"author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","_id":"remark-gh-alerts@0.0.2","maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"homepage":"https://github.com/qhanw/remark-gh-alerts#readme","bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"dist":{"shasum":"2412813b833889a51494801a220011a372b5afae","tarball":"https://registry.npmjs.org/remark-gh-alerts/-/remark-gh-alerts-0.0.2.tgz","fileCount":12,"integrity":"sha512-se6vqRt5g6kvO5vi5RoO0wHRaIqNUTu29j84WYkOFVmjqzpFJAuLrrlfnaF3Fhir9jTNO87iwCNqYnzStjrZRA==","signatures":[{"sig":"MEQCIEteC6AJ+sO/030k4xOrLdjSbpJqTVGx0ebmYV/gn8HqAiAGe7q62K2PekMti6SaKEfdzE+/pfmJ9v19H3au49+dXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24682},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./styles/*":"./styles/*"},"funding":"https://github.com/sponsors/qhanw","gitHead":"d7dff84ddfc2145e78a522eb50fe4ff9d9f3a701","scripts":{"dev":"unbuild --stub","lint":"eslint .","test":"vitest","build":"unbuild","start":"esno src/index.ts","prepare":"simple-git-hooks","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"qhanw","email":"whenhan@outlook.com"},"repository":{"url":"git+https://github.com/qhanw/remark-gh-alerts.git","type":"git"},"_npmVersion":"10.2.3","description":"Support GitHub-style alerts for remark","directories":{},"lint-staged":{"*":"eslint --fix"},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"unist-util-visit":"^5.0.0"},"typesVersions":{"*":{"*":["./dist/*","./dist/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"esno":"^4.7.0","vite":"^5.1.5","bumpp":"^9.4.0","eslint":"^8.57.0","vitest":"^1.3.1","unbuild":"^2.0.0","prettier":"^3.2.5","typescript":"^5.4.2","@types/node":"^20.11.25","lint-staged":"^15.2.2","simple-git-hooks":"^2.10.0","@antfu/eslint-config":"^2.8.0"},"peerDependencies":{"unified":"^11.0.4","@types/mdast":"^4.0.3"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/remark-gh-alerts_0.0.2_1710044914330_0.3064862272839315","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"remark-gh-alerts","version":"0.0.3","keywords":["remark","remark-alerts","remark-gh-alerts","remark-github-alerts","github-favored-markdown"],"author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","_id":"remark-gh-alerts@0.0.3","maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"homepage":"https://github.com/qhanw/remark-gh-alerts#readme","bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"dist":{"shasum":"5d6082852b1248d831e6c38b6f29889b157d848e","tarball":"https://registry.npmjs.org/remark-gh-alerts/-/remark-gh-alerts-0.0.3.tgz","fileCount":12,"integrity":"sha512-c+LiDARwwUnDN60dSlQDV4hoGFDrtkTdZZ6F2r0f5BANLejLNP1ywZIzQTWfN+fTwyGHp+O3wjXqK1QVtmVBRQ==","signatures":[{"sig":"MEYCIQDVKukOR7oiPJgpsHNtljol8fak2TL6CI7maA01PX78qQIhALIPJbBXUZug2ww7oX4Z+Kyitb9R2bZHCRDVAsLG44VP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24844},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./styles/*":"./styles/*"},"funding":"https://github.com/sponsors/qhanw","gitHead":"a0e69beb9014216aa2d422e84a80c2fa940b1ab3","scripts":{"dev":"unbuild --stub","lint":"eslint .","test":"vitest","build":"unbuild","start":"esno src/index.ts","prepare":"simple-git-hooks","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"qhanw","email":"whenhan@outlook.com"},"repository":{"url":"git+https://github.com/qhanw/remark-gh-alerts.git","type":"git"},"_npmVersion":"10.2.3","description":"Support GitHub-style alerts for remark, and replace the SVG dom node with pure CSS.","directories":{},"lint-staged":{"*":"eslint --fix"},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"unist-util-visit":"^5.0.0"},"typesVersions":{"*":{"*":["./dist/*","./dist/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"esno":"^4.7.0","vite":"^5.1.5","bumpp":"^9.4.0","eslint":"^8.57.0","vitest":"^1.3.1","unbuild":"^2.0.0","prettier":"^3.2.5","typescript":"^5.4.2","@types/node":"^20.11.25","lint-staged":"^15.2.2","remark-html":"^16.0.1","remark-parse":"^11.0.0","simple-git-hooks":"^2.10.0","@antfu/eslint-config":"^2.8.0"},"peerDependencies":{"unified":"^11.0.4","@types/mdast":"^4.0.3"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/remark-gh-alerts_0.0.3_1710085129795_0.924869854130252","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"remark-gh-alerts","version":"1.0.0","keywords":["remark","remark-alerts","remark-gh-alerts","remark-github-alerts","github-favored-markdown"],"author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","_id":"remark-gh-alerts@1.0.0","maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"homepage":"https://github.com/qhanw/remark-gh-alerts#readme","bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"dist":{"shasum":"c057947dd030fc8c629aa245988c9770f3ee645c","tarball":"https://registry.npmjs.org/remark-gh-alerts/-/remark-gh-alerts-1.0.0.tgz","fileCount":12,"integrity":"sha512-FPpqEH9AJMbKDXKzZuWjmTIFixlqosELDmaSpC6Zfgk/aSV6MnBCK28ty6ox7ndenu4KImAm8VQ5FmR6aBSLTQ==","signatures":[{"sig":"MEUCIEGhnE8YK4K6hnx/Du6A3G0ZN69I7Od1CqISKF8qPUlmAiEA2I+hOF84ZT87SWaFkd+YP9/xaS20U4jRDMBhpGlqXKo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24993},"main":"./dist/index.mjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"},"./styles/*":"./styles/*"},"funding":"https://github.com/sponsors/qhanw","gitHead":"af695fd358241b6cbaf90dc75b82b0523f1a1a9a","scripts":{"dev":"unbuild --stub","lint":"eslint .","test":"vitest","build":"unbuild","start":"tsx src/index.ts","prepare":"simple-git-hooks","release":"bumpp && npm publish","typecheck":"tsc --noEmit","prepublishOnly":"pnpm build"},"_npmUser":{"name":"qhanw","email":"whenhan@outlook.com"},"repository":{"url":"git+https://github.com/qhanw/remark-gh-alerts.git","type":"git"},"_npmVersion":"11.13.0","description":"Support GitHub-style alerts for remark, and replace the SVG dom node with pure CSS.","directories":{},"lint-staged":{"*":"eslint --fix"},"sideEffects":false,"_nodeVersion":"26.1.0","dependencies":{"unist-util-visit":"^5.1.0"},"typesVersions":{"*":{"*":["./dist/*","./dist/index.d.ts"]}},"_hasShrinkwrap":false,"packageManager":"pnpm@*","devDependencies":{"tsx":"^4.22.4","vite":"^8.0.16","bumpp":"^11.1.0","eslint":"^10.5.0","vitest":"^4.1.8","unbuild":"^3.6.1","prettier":"^3.8.4","typescript":"^6.0.3","@types/node":"^25.9.3","lint-staged":"^17.0.7","remark-html":"^16.0.1","remark-parse":"^11.0.0","simple-git-hooks":"^2.13.1","@antfu/eslint-config":"^9.0.0"},"peerDependencies":{"unified":"^11.0.5","@types/mdast":"^4.0.3"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"_npmOperationalInternal":{"tmp":"tmp/remark-gh-alerts_1.0.0_1781503136849_0.7449155565320367","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"remark-gh-alerts","type":"module","version":"1.0.1","packageManager":"pnpm@10.33.4","description":"A remark plugin to support GitHub-style alerts with pure CSS styling.","author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","funding":"https://github.com/sponsors/qhanw","homepage":"https://github.com/qhanw/remark-gh-alerts#readme","repository":{"type":"git","url":"git+https://github.com/qhanw/remark-gh-alerts.git"},"bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"keywords":["remark","remark-plugin","remark-alerts","remark-gh-alerts","github-alerts","github-favored-markdown","markdown","unified"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"./styles/*":"./styles/*"},"scripts":{"build":"unbuild","dev":"unbuild --stub","lint":"eslint .","prepublishOnly":"pnpm build","release":"bumpp && npm publish","start":"tsx src/index.ts","test":"vitest","typecheck":"tsc --noEmit","prepare":"simple-git-hooks"},"peerDependencies":{"@types/mdast":">=4.0.0","unified":">=11.0.0"},"dependencies":{"unist-util-visit":"^5.1.0"},"devDependencies":{"@antfu/eslint-config":"^9.0.0","@types/node":"^25.9.3","bumpp":"^11.1.0","eslint":"^10.5.0","lint-staged":"^17.0.7","prettier":"^3.8.4","remark-html":"^16.0.1","remark-parse":"^11.0.0","simple-git-hooks":"^2.13.1","tsx":"^4.22.4","typescript":"^6.0.3","unbuild":"^3.6.1","vite":"^8.0.16","vitest":"^4.1.8"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"},"gitHead":"a3aa2c32adfd2ce9c7679f657a2b12fb756b06d7","_id":"remark-gh-alerts@1.0.1","_nodeVersion":"26.1.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-v5wT/tAUrqh+8UwwdNIqc+GZ/aDQvvAVuPnbEeuOmq+vPiqKgs/h+cuBDuUZn2lNg4BgJ/03iBH9xO6FROR9cQ==","shasum":"76bc1c3ca3869470a1efe7b39f3a3bf7aa66c1a5","tarball":"https://registry.npmjs.org/remark-gh-alerts/-/remark-gh-alerts-1.0.1.tgz","fileCount":10,"unpackedSize":18069,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGtzJf0hP+m1DoTEaLH/CFhnxHiqTwYpizwLeJ2LQLJeAiEA7DDjknk0UDQ75/hDw4YQrVCEqLSyly9VU51VwXVJPxo="}]},"_npmUser":{"name":"qhanw","email":"whenhan@outlook.com"},"directories":{},"maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-gh-alerts_1.0.1_1781507679587_0.16132045568998699"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-08T07:39:17.930Z","modified":"2026-06-15T07:14:39.846Z","0.0.1":"2024-03-08T07:39:18.106Z","0.0.2":"2024-03-10T04:28:34.471Z","0.0.3":"2024-03-10T15:38:49.961Z","1.0.0":"2026-06-15T05:58:56.991Z","1.0.1":"2026-06-15T07:14:39.728Z"},"bugs":{"url":"https://github.com/qhanw/remark-gh-alerts/issues"},"author":{"name":"Qhan W","email":"whenhan@foxmail.com"},"license":"MIT","homepage":"https://github.com/qhanw/remark-gh-alerts#readme","keywords":["remark","remark-plugin","remark-alerts","remark-gh-alerts","github-alerts","github-favored-markdown","markdown","unified"],"repository":{"type":"git","url":"git+https://github.com/qhanw/remark-gh-alerts.git"},"description":"A remark plugin to support GitHub-style alerts with pure CSS styling.","maintainers":[{"name":"qhanw","email":"whenhan@outlook.com"}],"readme":"# remark-gh-alerts\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![bundle][bundle-src]][bundle-href]\n[![JSDocs][jsdocs-src]][jsdocs-href]\n[![License][license-src]][license-href]\n\nFork from [markdown-it-github-alerts](https://github.com/markdown-it/markdown-it).\n\nSupport [GitHub-style alerts](https://github.com/orgs/community/discussions/16925) for [remark](https://github.com/remarkjs/remark), and replace the SVG dom node with pure CSS.\n\nHere, the solution for replacing the SVG dom node with pure CSS comes from the article [Icons in Pure CSS](https://antfu.me/posts/icons-in-pure-css) by [antfu](https://github.com/antfu).\n\n> [!NOTE]\n> Highlights information that users should take into account, even when skimming.\n\n> [!TIP]\n> Optional information to help a user be more successful.\n\n> [!IMPORTANT]\n> Crucial information necessary for users to succeed.\n\n> [!WARNING]\n> Critical content demanding immediate user attention due to potential risks.\n\n> [!CAUTION]\n> Negative potential consequences of an action.\n\n```\n> [!NOTE]\n> Highlights information that users should take into account, even when skimming.\n\n> [!TIP]\n> Optional information to help a user be more successful.\n\n> [!IMPORTANT]\n> Crucial information necessary for users to succeed.\n\n> [!WARNING]\n> Critical content demanding immediate user attention due to potential risks.\n\n> [!CAUTION]\n> Negative potential consequences of an action.\n```\n\n## Usage\n\n```bash\nnpm i remark-gh-alerts\n```\n\n```ts\nimport { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkGithubAlerts from 'remark-gh-alerts'\nimport remarkRehype from 'remark-rehype'\nimport rehypeStringify from 'rehype-stringify'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkGithubAlerts)\n  .use(remarkRehype)\n  .use(rehypeStringify)\n  .process(await fs.readFile('./input.md'))\n```\n\nFor the options available, please refer to [the jsdoc](./src/index.ts).\n\n## Functionality\n\nThis plugin transforms the following markdown:\n\n```markdown\n> [!NOTE]\n> Highlights information that users should take into account, even when skimming.\n```\n\nto the following HTML:\n\n```html\n<div class=\"markdown-alert markdown-alert-note\">\n  <p class=\"markdown-alert-title\" dir=\"auto\"><span class=\"octicon octicon-note\" style=\"--oct-icon: url([data uri])\"></span>Note</p><p>\n  Highlights information that users should take into account, even when skimming.</p>\n</div>\n```\n\n`[data uri]` is a picture data that after processing svg picture can be used by css.\n\nWhich is different with the GitHub's output.\n\n### Styling\n\nYou can write your custom styles for your alerts.\n\nWe also provide some CSS extracted from GitHub's styles for you to use.\n\n```js\nimport 'remark-gh-alerts/styles/github-colors-light.css'\nimport 'remark-gh-alerts/styles/github-colors-dark-media.css'\nimport 'remark-gh-alerts/styles/github-base.css'\n```\n\nYou might change `github-colors-dark-media.css` to `github-colors-dark-class.css` if you are using class-based (`.dark`) dark mode.\n\nRefer to the [source code](./styles) for more details.\n\n### Next MDX\n\nYou just need to add the plugin to your `next.config.js`:\n\n```ts\nimport remarkGithubAlerts from 'remark-gh-alerts'\nimport createMDX from '@next/mdx'\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {\n  // Configure `pageExtensions`` to include MDX files\n  pageExtensions: ['js', 'jsx', 'mdx', 'ts', 'tsx'],\n  // Optionally, add any other Next.js config below\n}\n\nconst withMDX = createMDX({\n  // Add markdown plugins here, as desired\n  options: {\n    remarkPlugins: [remarkGithubAlerts],\n    rehypePlugins: [],\n  },\n})\n\n// Merge MDX config with Next.js config\nexport default withMDX(nextConfig)\n```\n\n## License\n\n[MIT](./LICENSE) License © 2024-PRESENT [Qhan W](https://github.com/qhanw)\n\n<!-- Badges -->\n\n[npm-version-src]: https://img.shields.io/npm/v/remark-gh-alerts?style=flat&colorA=080f12&colorB=1fa669\n[npm-version-href]: https://npmjs.com/package/remark-gh-alerts\n[npm-downloads-src]: https://img.shields.io/npm/dm/remark-gh-alerts?style=flat&colorA=080f12&colorB=1fa669\n[npm-downloads-href]: https://npmjs.com/package/remark-gh-alerts\n[bundle-src]: https://img.shields.io/bundlephobia/minzip/remark-gh-alerts?style=flat&colorA=080f12&colorB=1fa669&label=minzip\n[bundle-href]: https://bundlephobia.com/result?p=remark-gh-alerts\n[license-src]: https://img.shields.io/github/license/qhanw/remark-gh-alerts.svg?style=flat&colorA=080f12&colorB=1fa669\n[license-href]: https://github.com/qhanw/remark-gh-alerts/blob/main/LICENSE\n[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669\n[jsdocs-href]: https://www.jsdocs.io/package/remark-gh-alerts\n","readmeFilename":"README.md"}