{"_id":"remark-directive","_rev":"4423206","name":"remark-directive","description":"remark plugin to support directives","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"time":{"modified":"2026-04-08T13:47:49.000Z","created":"2020-10-22T18:11:38.888Z","4.0.0":"2025-02-27T15:15:20.630Z","3.0.1":"2025-01-22T15:14:45.738Z","3.0.0":"2023-09-18T11:28:52.180Z","2.0.1":"2021-10-26T07:17:04.796Z","2.0.0":"2021-08-05T14:06:58.232Z","1.0.1":"2020-10-23T06:54:47.813Z","1.0.0":"2020-10-22T18:11:38.888Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"versions":{"4.0.0":{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"@types/mdast":"^4.0.0","mdast-util-directive":"^3.0.0","micromark-extension-directive":"^4.0.0","unified":"^11.0.0"},"description":"remark plugin to support directives","devDependencies":{"@types/node":"^22.0.0","c8":"^10.0.0","is-hidden":"^2.0.0","prettier":"^3.0.0","remark":"^15.0.0","remark-cli":"^12.0.0","remark-preset-wooorm":"^11.0.0","to-vfile":"^8.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.60.0"},"exports":"./index.js","funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"keywords":["container","directive","generic","markdown","mdast","plugin","remark-plugin","remark","unified"],"license":"MIT","name":"remark-directive","prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","prepack":"npm run build && npm run format","test-api":"node --conditions development test/index.js","test-coverage":"c8 --100 --reporter lcov -- npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"sideEffects":false,"typeCoverage":{"atLeast":100,"strict":true},"type":"module","version":"4.0.0","xo":{"overrides":[{"files":["**/*.d.ts"],"rules":{"@typescript-eslint/array-type":["error",{"default":"generic"}],"@typescript-eslint/ban-types":["error",{"extendDefaults":true}],"@typescript-eslint/consistent-type-definitions":["error","interface"]}},{"files":["test/**/*.js"],"rules":{"no-await-in-loop":"off"}}],"prettier":true,"rules":{"logical-assignment-operators":"off"}},"_id":"remark-directive@4.0.0","gitHead":"23b8f416da165b6ddaa4c5e7e82addaf6dcb96a9","types":"./index.d.ts","homepage":"https://github.com/remarkjs/remark-directive#readme","_nodeVersion":"23.1.0","_npmVersion":"11.1.0","dist":{"shasum":"4e909826e05cade7f8678532f4815cd931d47e8d","size":6865,"noattachment":false,"key":"/remark-directive/-/remark-directive-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-4.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-directive_4.0.0_1740669320480_0.5814515382785304"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-27T15:15:20.630Z","publish_time":1740669320630,"_source_registry_name":"default","_cnpm_publish_time":1740669320630},"3.0.1":{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"@types/mdast":"^4.0.0","mdast-util-directive":"^3.0.0","micromark-extension-directive":"^3.0.0","unified":"^11.0.0"},"description":"remark plugin to support directives","devDependencies":{"@types/node":"^22.0.0","c8":"^10.0.0","is-hidden":"^2.0.0","prettier":"^3.0.0","remark":"^15.0.0","remark-cli":"^12.0.0","remark-preset-wooorm":"^10.0.0","to-vfile":"^8.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.60.0"},"exports":"./index.js","funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"keywords":["container","directive","generic","markdown","mdast","plugin","remark-plugin","remark","unified"],"license":"MIT","name":"remark-directive","prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","prepack":"npm run build && npm run format","test-api":"node --conditions development test/index.js","test-coverage":"c8 --100 --reporter lcov -- npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"sideEffects":false,"typeCoverage":{"atLeast":100,"strict":true},"type":"module","version":"3.0.1","xo":{"overrides":[{"files":["**/*.d.ts"],"rules":{"@typescript-eslint/array-type":["error",{"default":"generic"}],"@typescript-eslint/ban-types":["error",{"extendDefaults":true}],"@typescript-eslint/consistent-type-definitions":["error","interface"]}},{"files":["test/**/*.js"],"rules":{"no-await-in-loop":"off"}}],"prettier":true,"rules":{"logical-assignment-operators":"off"}},"_id":"remark-directive@3.0.1","gitHead":"103c85adbaffa0fb097a7aad4a8f33be0517e2b5","types":"./index.d.ts","homepage":"https://github.com/remarkjs/remark-directive#readme","_nodeVersion":"23.1.0","_npmVersion":"11.0.0","dist":{"shasum":"689ba332f156cfe1118e849164cc81f157a3ef0a","size":6914,"noattachment":false,"key":"/remark-directive/-/remark-directive-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-3.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-directive_3.0.1_1737558885541_0.6631286364099187"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-22T15:14:45.738Z","publish_time":1737558885738,"_source_registry_name":"default","_cnpm_publish_time":1737558885738},"3.0.0":{"name":"remark-directive","version":"3.0.0","description":"remark plugin to support directives","license":"MIT","keywords":["container","directive","generic","markdown","mdast","plugin","remark","remark-plugin","unified"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":"./index.js","dependencies":{"@types/mdast":"^4.0.0","mdast-util-directive":"^3.0.0","micromark-extension-directive":"^3.0.0","unified":"^11.0.0"},"devDependencies":{"@types/node":"^20.0.0","c8":"^8.0.0","is-hidden":"^2.0.0","prettier":"^3.0.0","remark":"^15.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","to-vfile":"^8.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.56.0"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix","prepack":"npm run build && npm run format","test":"npm run build && npm run format && npm run test-coverage","test-api":"node --conditions development test/index.js","test-coverage":"c8 --100 --reporter lcov npm run test-api"},"prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"ignoreCatch":true,"strict":true},"xo":{"overrides":[{"files":["test/**/*.js"],"rules":{"no-await-in-loop":"off"}}],"prettier":true},"_id":"remark-directive@3.0.0","gitHead":"e1027d13bd751ea75e7675b3c796a984e0d37527","types":"./index.d.ts","homepage":"https://github.com/remarkjs/remark-directive#readme","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"shasum":"34452d951b37e6207d2e2a4f830dc33442923268","size":6352,"noattachment":false,"key":"/remark-directive/-/remark-directive-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-3.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-directive_3.0.0_1695036531963_0.9128615696164053"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-18T11:28:52.180Z","publish_time":1695036532180,"_source_registry_name":"default","_cnpm_publish_time":1695036532180},"2.0.1":{"name":"remark-directive","version":"2.0.1","description":"remark plugin to support directives","license":"MIT","keywords":["unified","remark","remark-plugin","plugin","mdast","markdown","generic","directive","container"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"@types/mdast":"^3.0.0","mdast-util-directive":"^2.0.0","micromark-extension-directive":"^2.0.0","unified":"^10.0.0"},"devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","is-hidden":"^2.0.0","prettier":"^2.0.0","remark":"^14.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^9.0.0","rimraf":"^3.0.0","tape":"^5.0.0","to-vfile":"^7.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.45.0"},"scripts":{"build":"rimraf \"test/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test/index.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"52501b7de6d700f6b8263aeb6f1ed8086242e437","homepage":"https://github.com/remarkjs/remark-directive#readme","_id":"remark-directive@2.0.1","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"shasum":"1c32d9df8d839a75ba3478112d21fe883635b48e","size":6030,"noattachment":false,"key":"/remark-directive/-/remark-directive-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-directive_2.0.1_1635232624674_0.72154548613797"},"_hasShrinkwrap":false,"publish_time":1635232624796,"_cnpm_publish_time":1635232624796,"_cnpmcore_publish_time":"2021-12-16T14:06:09.168Z"},"2.0.0":{"name":"remark-directive","version":"2.0.0","description":"remark plugin to support directives","license":"MIT","keywords":["unified","remark","remark-plugin","plugin","mdast","markdown","generic","directive","container"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"@types/mdast":"^3.0.0","mdast-util-directive":"^2.0.0","micromark-extension-directive":"^2.0.0","unified":"^10.0.0"},"devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","is-hidden":"^2.0.0","prettier":"^2.0.0","remark":"^14.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.0","tape":"^5.0.0","to-vfile":"^7.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.43.0"},"scripts":{"build":"rimraf \"test/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test/index.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"2631e46657a401e32c7555342d30b58bc57d6d4f","homepage":"https://github.com/remarkjs/remark-directive#readme","_id":"remark-directive@2.0.0","_nodeVersion":"16.6.1","_npmVersion":"7.20.3","dist":{"shasum":"db838ab7a2543dea0b07a2041fe982112f611add","size":4266,"noattachment":false,"key":"/remark-directive/-/remark-directive-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-directive_2.0.0_1628172418100_0.9659196334083633"},"_hasShrinkwrap":false,"publish_time":1628172418232,"_cnpm_publish_time":1628172418232,"_cnpmcore_publish_time":"2021-12-16T14:06:09.374Z"},"1.0.1":{"name":"remark-directive","version":"1.0.1","description":"remark plugin to support directives","license":"MIT","keywords":["unified","remark","remark-plugin","plugin","mdast","markdown","generic","directive","container"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"types":"types/index.d.ts","dependencies":{"mdast-util-directive":"^1.0.0","micromark-extension-directive":"^1.0.0"},"devDependencies":{"dtslint":"^4.0.0","is-hidden":"^1.0.0","not":"^0.1.0","nyc":"^15.0.0","prettier":"^2.0.0","remark":"^13.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","to-vfile":"^6.0.0","unified":"^9.0.0","xo":"^0.34.0"},"scripts":{"format":"remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && xo --fix","test-api":"node test","test-coverage":"nyc --reporter lcov tape test/index.js","test-types":"dtslint types","test":"npm run format && npm run test-coverage && npm run test-types"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"unicorn/no-fn-reference-in-iterator":"off","unicorn/prefer-optional-catch-binding":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"24dcf3a631dc83aa3d96c96b701c9e3047740795","homepage":"https://github.com/remarkjs/remark-directive#readme","_id":"remark-directive@1.0.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"shasum":"13356db9c893d16ad15406e4b77a389525c4bdf9","size":4122,"noattachment":false,"key":"/remark-directive/-/remark-directive-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-1.0.1.tgz"},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-directive_1.0.1_1603436087651_0.6939398769636618"},"_hasShrinkwrap":false,"publish_time":1603436087813,"_cnpm_publish_time":1603436087813,"_cnpmcore_publish_time":"2021-12-16T14:06:09.660Z"},"1.0.0":{"name":"remark-directive","version":"1.0.0","description":"remark plugin to support directives","license":"MIT","keywords":["unified","remark","remark-plugin","plugin","mdast","markdown","generic","directive","container"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-directive.git"},"bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"types":"types/index.d.ts","dependencies":{"mdast-util-directive":"^1.0.0","micromark-extension-directive":"^1.0.0"},"devDependencies":{"dtslint":"^4.0.0","is-hidden":"^1.0.0","not":"^0.1.0","nyc":"^15.0.0","prettier":"^2.0.0","remark":"^13.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","to-vfile":"^6.0.0","unified":"^9.0.0","xo":"^0.34.0"},"scripts":{"format":"remark . -qfo --ignore-pattern test/ && prettier . -w --loglevel warn && xo --fix","test-api":"node test","test-coverage":"nyc --reporter lcov tape test/index.js","test-types":"dtslint types","test":"npm run format && npm run test-coverage && npm run test-types"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"unicorn/no-fn-reference-in-iterator":"off","unicorn/prefer-optional-catch-binding":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"9e252ca2e862750ab7bec13b1ef622357f16c683","homepage":"https://github.com/remarkjs/remark-directive#readme","_id":"remark-directive@1.0.0","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"shasum":"e5246440497f9a6d3b8e9262413eaeb7738e1152","size":3710,"noattachment":false,"key":"/remark-directive/-/remark-directive-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/remark-directive/download/remark-directive-1.0.0.tgz"},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"remcohaszing","email":""},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-directive_1.0.0_1603390298751_0.08923433818040927"},"_hasShrinkwrap":false,"publish_time":1603390298888,"_cnpm_publish_time":1603390298888,"_cnpmcore_publish_time":"2021-12-16T14:06:09.884Z"}},"readme":"# remark-directive\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\n**[remark][github-remark]** plugin to support the\n[generic directives proposal][commonmark-directive-proposal]\n(`:cite[smith04]`,\n`::youtube[Video of a cat in a box]{v=01ab2cd3efg}`,\nand such).\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`unified().use(remarkDirective[, options])`](#unifieduseremarkdirective-options)\n  * [`Options`](#options)\n* [Examples](#examples)\n  * [Example: YouTube](#example-youtube)\n  * [Example: Styled blocks](#example-styled-blocks)\n* [Authoring](#authoring)\n* [HTML](#html)\n* [CSS](#css)\n* [Syntax](#syntax)\n* [Syntax tree](#syntax-tree)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][github-unified]\n([remark][github-remark])\nplugin to add support for directives:\none syntax for arbitrary extensions in markdown.\n\n## When should I use this?\n\nDirectives are one of the four ways to extend markdown:\nan arbitrary extension syntax\n(see [Extending markdown][github-micromark-extending-markdown]\nin micromark’s docs for the alternatives and more info).\nThis mechanism works well when you control the content:\nwho authors it,\nwhat tools handle it,\nand where it’s displayed.\nWhen authors can read a guide on how to embed a tweet but are not expected to\nknow the ins and outs of HTML or JavaScript.\nDirectives don’t work well if you don’t know who authors content,\nwhat tools handle it,\nand where it ends up.\nExample use cases are a docs website for a project or product,\nor blogging tools and static site generators.\n\nIf you *just* want to turn markdown into HTML (with maybe a few extensions such\nas this one),\nwe recommend [`micromark`][github-micromark] with\n[`micromark-extension-directive`][github-micromark-extension-directive] instead.\nIf you don’t use plugins and want to access the syntax tree,\nyou can use\n[`mdast-util-from-markdown`][github-mdast-util-from-markdown] with\n[`mdast-util-directive`][github-mdast-util-directive].\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npmjs-install]:\n\n```sh\nnpm install remark-directive\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkDirective from 'https://esm.sh/remark-directive@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import remarkDirective from 'https://esm.sh/remark-directive@3?bundle'\n</script>\n```\n\n## Use\n\nSay our document `example.md` contains:\n\n```markdown\n:::main{#readme}\n\nLorem:br\nipsum.\n\n::hr{.red}\n\nA :i[lovely] language know as :abbr[HTML]{title=\"HyperText Markup Language\"}.\n\n:::\n```\n\n…and our module `example.js` contains:\n\n```js\n/**\n * @import {} from 'mdast-util-directive'\n * @import {} from 'mdast-util-to-hast'\n * @import {Root} from 'mdast'\n */\n\nimport {h} from 'hastscript'\nimport rehypeFormat from 'rehype-format'\nimport rehypeStringify from 'rehype-stringify'\nimport remarkDirective from 'remark-directive'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport {read} from 'to-vfile'\nimport {unified} from 'unified'\nimport {visit} from 'unist-util-visit'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkDirective)\n  .use(myRemarkPlugin)\n  .use(remarkRehype)\n  .use(rehypeFormat)\n  .use(rehypeStringify)\n  .process(await read('example.md'))\n\nconsole.log(String(file))\n\n// This plugin is an example to let users write HTML with directives.\n// It’s informative but rather useless.\n// See below for others examples.\nfunction myRemarkPlugin() {\n  /**\n   * @param {Root} tree\n   *   Tree.\n   * @returns {undefined}\n   *   Nothing.\n   */\n  return function (tree) {\n    visit(tree, function (node) {\n      if (\n        node.type === 'containerDirective' ||\n        node.type === 'leafDirective' ||\n        node.type === 'textDirective'\n      ) {\n        const data = node.data || (node.data = {})\n        const hast = h(node.name, node.attributes || {})\n\n        data.hName = hast.tagName\n        data.hProperties = hast.properties\n      }\n    })\n  }\n}\n```\n\n…then running `node example.js` yields:\n\n```html\n<main id=\"readme\">\n  <p>Lorem<br>ipsum.</p>\n  <hr class=\"red\">\n  <p>A <i>lovely</i> language know as <abbr title=\"HyperText Markup Language\">HTML</abbr>.</p>\n</main>\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkDirective`][api-remark-directive].\n\n### `unified().use(remarkDirective[, options])`\n\nAdd support for generic directives.\n\n###### Parameters\n\n* `options`\n  ([`Options`][api-options], optional)\n  — configuration\n\n###### Returns\n\nNothing (`undefined`).\n\n###### Notes\n\nDoesn’t handle the directives:\n[create your own plugin][unifiedjs-create-remark-plugin] to do that.\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `collapseEmptyAttributes`\n  (`boolean`, default: `true`)\n  — collapse empty attributes: get `title` instead of `title=\"\"`\n* `preferShortcut`\n  (`boolean`, default: `true`)\n  — prefer `#` and `.` shortcuts for `id` and `class`\n* `preferUnquoted`\n  (`boolean`, default: `false`)\n  — leave attributes unquoted if that results in less bytes\n* `quoteSmart`\n  (`boolean`, default: `false`)\n  — use the other quote if that results in less bytes\n* `quote`\n  (`'\"'` or `\"'\"`,\n  default:\n  the [`quote`][github-remark-stringify-quote] used by `remark-stringify` for\n  titles)\n  — preferred quote to use around attribute values\n\n## Examples\n\n### Example: YouTube\n\nThis example shows how directives can be used for YouTube embeds.\nIt’s based on the example in Use above.\nIf `myRemarkPlugin` was replaced with this function:\n\n```js\n/**\n * @import {} from 'mdast-util-directive'\n * @import {} from 'mdast-util-to-hast'\n * @import {Root} from 'mdast'\n * @import {VFile} from 'vfile'\n */\n\nimport {visit} from 'unist-util-visit'\n\n// This plugin is an example to turn `::youtube` into iframes.\nfunction myRemarkPlugin() {\n  /**\n   * @param {Root} tree\n   *   Tree.\n   * @param {VFile} file\n   *   File.\n   * @returns {undefined}\n   *   Nothing.\n   */\n  return (tree, file) => {\n    visit(tree, function (node) {\n      if (\n        node.type === 'containerDirective' ||\n        node.type === 'leafDirective' ||\n        node.type === 'textDirective'\n      ) {\n        if (node.name !== 'youtube') return\n\n        const data = node.data || (node.data = {})\n        const attributes = node.attributes || {}\n        const id = attributes.id\n\n        if (node.type === 'textDirective') {\n          file.fail(\n            'Unexpected `:youtube` text directive, use two colons for a leaf directive',\n            node\n          )\n        }\n\n        if (!id) {\n          file.fail('Unexpected missing `id` on `youtube` directive', node)\n        }\n\n        data.hName = 'iframe'\n        data.hProperties = {\n          src: 'https://www.youtube.com/embed/' + id,\n          width: 200,\n          height: 200,\n          frameBorder: 0,\n          allow: 'picture-in-picture',\n          allowFullScreen: true\n        }\n      }\n    })\n  }\n}\n```\n\n…and `example.md` contains:\n\n```markdown\n# Cat videos\n\n::youtube[Video of a cat in a box]{#01ab2cd3efg}\n```\n\n…then running `node example.js` yields:\n\n```html\n<h1>Cat videos</h1>\n<iframe src=\"https://www.youtube.com/embed/01ab2cd3efg\" width=\"200\" height=\"200\" frameborder=\"0\" allow=\"picture-in-picture\" allowfullscreen>Video of a cat in a box</iframe>\n```\n\n### Example: Styled blocks\n\n> ???? **Note**:\n> this is sometimes called admonitions, callouts, etc.\n\nThis example shows how directives can be used to style blocks.\nIt’s based on the example in Use above.\nIf `myRemarkPlugin` was replaced with this function:\n\n```js\n/**\n * @import {} from 'mdast-util-directive'\n * @import {} from 'mdast-util-to-hast'\n * @import {Root} from 'mdast'\n */\n\nimport {h} from 'hastscript'\nimport {visit} from 'unist-util-visit'\n\n// This plugin is an example to turn `::note` into divs,\n// passing arbitrary attributes.\nfunction myRemarkPlugin() {\n  /**\n   * @param {Root} tree\n   *   Tree.\n   * @returns {undefined}\n   *   Nothing.\n   */\n  return (tree) => {\n    visit(tree, (node) => {\n      if (\n        node.type === 'containerDirective' ||\n        node.type === 'leafDirective' ||\n        node.type === 'textDirective'\n      ) {\n        if (node.name !== 'note') return\n\n        const data = node.data || (node.data = {})\n        const tagName = node.type === 'textDirective' ? 'span' : 'div'\n\n        data.hName = tagName\n        data.hProperties = h(tagName, node.attributes || {}).properties\n      }\n    })\n  }\n}\n```\n\n…and `example.md` contains:\n\n```markdown\n# How to use xxx\n\nYou can use xxx.\n\n:::note{.warning}\nif you chose xxx, you should also use yyy somewhere…\n:::\n```\n\n…then running `node example` yields:\n\n```html\n<h1>How to use xxx</h1>\n<p>You can use xxx.</p>\n<div class=\"warning\">\n  <p>if you chose xxx, you should also use yyy somewhere…</p>\n</div>\n```\n\n## Authoring\n\nWhen authoring markdown with directives,\nkeep in mind that they don’t work in most places.\nOn your own site it can be great!\n\n## HTML\n\nYou can define how directives are turned into HTML.\nIf directives are not handled,\nthey do not emit anything.\n\n## CSS\n\nHow to display directives is left as an exercise for the reader.\n\n## Syntax\n\nSee [*Syntax* in\n`micromark-extension-directive`](https://github.com/micromark/micromark-extension-directive#syntax).\n\n## Syntax tree\n\nSee [*Syntax tree* in\n`mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive#syntax-tree).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional options.\n\nIf you’re working with the syntax tree,\nyou can register the new node types with `@types/mdast` by adding a reference:\n\n```js\n/**\n * @import {} from 'mdast-util-directive'\n * @import {Root} from 'mdast'\n */\n\nimport {visit} from 'unist-util-visit'\n\nfunction myRemarkPlugin() {\n  /**\n   * @param {Root} tree\n   *   Tree.\n   * @returns {undefined}\n   *   Nothing.\n   */\n  return (tree) => {\n    visit(tree, function (node) {\n      console.log(node) // `node` can now be one of the nodes for directives.\n    })\n  }\n}\n```\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`remark-directive@3`,\ncompatible with Node.js 16.\n\n## Security\n\nUse of `remark-directive` does not involve **[rehype][github-rehype]**\n([hast][github-hast])\nor user content so there are no openings for\n[cross-site scripting (XSS)][wikipedia-xss] attacks.\n\n## Related\n\n* [`remark-gfm`](https://github.com/remarkjs/remark-gfm)\n  — support GFM\n  (autolink literals, footnotes, strikethrough, tables, tasklists)\n* [`remark-frontmatter`](https://github.com/remarkjs/remark-frontmatter)\n  — support frontmatter\n  (YAML, TOML, and more)\n* [`remark-math`](https://github.com/remarkjs/remark-math)\n  — support math\n* [`remark-mdx`](https://github.com/mdx-js/mdx/tree/main/packages/remark-mdx)\n  — support MDX\n  (ESM, JSX, expressions)\n\n## Contribute\n\nSee [`contributing.md`][health-contributing]\nin\n[`remarkjs/.github`][health]\nfor ways to get started.\nSee [`support.md`][health-support] for ways to get help.\n\nThis project has a [code of conduct][health-coc].\nBy interacting with this repository,\norganization,\nor community you agree to abide by its terms.\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n<!-- Definitions -->\n\n[api-options]: #options\n\n[api-remark-directive]: #unifieduseremarkdirective-options\n\n[badge-build-image]: https://github.com/remarkjs/remark-directive/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/remarkjs/remark-directive/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/remarkjs/remark-directive.svg\n\n[badge-coverage-url]: https://codecov.io/github/remarkjs/remark-directive\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/remark-directive.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-directive\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/remark-directive\n\n[badge-size-url]: https://bundlejs.com/?q=remark-directive\n\n[commonmark-directive-proposal]: https://talk.commonmark.org/t/generic-directives-plugins-syntax/444\n\n[esmsh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-hast]: https://github.com/syntax-tree/hast\n\n[github-mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive\n\n[github-mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[github-micromark]: https://github.com/micromark/micromark\n\n[github-micromark-extending-markdown]: https://github.com/micromark/micromark#extending-markdown\n\n[github-micromark-extension-directive]: https://github.com/micromark/micromark-extension-directive\n\n[github-rehype]: https://github.com/rehypejs/rehype\n\n[github-remark]: https://github.com/remarkjs/remark\n\n[github-remark-stringify-quote]: https://github.com/remarkjs/remark/tree/main/packages/remark-stringify#options\n\n[github-unified]: https://github.com/unifiedjs/unified\n\n[health]: https://github.com/remarkjs/.github\n\n[health-coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[health-contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[health-support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[npmjs-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n\n[unifiedjs-create-remark-plugin]: https://unifiedjs.com/learn/guide/create-a-remark-plugin/\n\n[wikipedia-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[wooorm]: https://wooorm.com\n","_attachments":{},"homepage":"https://github.com/remarkjs/remark-directive#readme","bugs":{"url":"https://github.com/remarkjs/remark-directive/issues"},"license":"MIT"}