{"_rev":"6-142509816628d5fcb6084beb57b468a9","time":{"created":"2023-03-30T09:25:28.264Z","0.1.0":"2023-03-29T11:47:52.247Z","modified":"2023-03-30T09:25:28.729Z","0.1.1":"2023-03-30T09:13:59.898Z","0.1.2":"2023-03-30T09:25:28.553Z"},"_id":"@bernardjoseph/micromark-extension-citekey","name":"@bernardjoseph/micromark-extension-citekey","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@bernardjoseph/micromark-extension-citekey","version":"0.1.2","description":"micromark extension to support Pandoc-style citation keys","license":"MIT","keywords":["micromark","micromark-extension","cite","citation","pandoc","markdown","remark","unified"],"repository":{"type":"git","url":"git+https://github.com/bernardjoseph/micromark-extension-citekey.git"},"author":{"name":"Bernd Rellermeyer","email":"bernd.rellermeyer@t-online.de"},"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.1.0","micromark-util-symbol":"^1.0.1","micromark-util-types":"^1.0.2"},"devDependencies":{"@types/tape":"^4.13.2","c8":"^7.13.0","micromark":"^3.1.0","micromark-build":"^1.3.0","prettier":"^2.8.4","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.1.0","rimraf":"^4.4.0","tape":"^5.6.3","type-coverage":"^2.24.1","typescript":"^4.9.5","xo":"^0.53.1"},"scripts":{"build":"rimraf --glob \"dev/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage && micromark-build","format":"remark . -qfo && 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":["remark-preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"d777f525d4732b63eb67708f9976cd07313409e6","bugs":{"url":"https://github.com/bernardjoseph/micromark-extension-citekey/issues"},"homepage":"https://github.com/bernardjoseph/micromark-extension-citekey#readme","_id":"@bernardjoseph/micromark-extension-citekey@0.1.2","_nodeVersion":"19.8.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-eGdWzylPJgV48802iJk43HDBbLnKAuji/CL5DEiVhg6zcLSs/oZgnYAdge2O99ze5EedGVgm/9e7GhQdNvUVTw==","shasum":"e05ac400046c1a34b960f4616312b8dc67e5061b","tarball":"https://registry.npmjs.org/@bernardjoseph/micromark-extension-citekey/-/micromark-extension-citekey-0.1.2.tgz","fileCount":30,"unpackedSize":27470,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0hb6I7ACzwfMqtbUcMfU9bVxrTW32ohJCif9iutVpuAIgMCX9QWYNvSq39bZMea6BUwI6AikcqCEJ86rfmpgrSGk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJVWIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4BQ//WxDel8aK2cWwQ+ZE8TRyJ4roj72y1fsLEc9jWmJDCJFJMAyr\r\nn0O90dWxEnQrAsSfHE0HLpHp2omXPMw/tHDjiVLfKUeCd+oEkHs/2OIO7l3D\r\n8glkJ/CVHyXk/H+DgJPRmBSnGd//Zy/oHMWCKHOO5cyNgBl3pos8DEUX+Tcs\r\nHOSpan500I8BUPdbG3AUisk8ERIH5I2PHOBLEkwhF4w/IcXxVqYjqH7067rP\r\n+VyaUhypzEUGta9vLoVNE+HNj8PGiQHGEX66ee6CjjyIDxN6g9SVq/jDV3F7\r\n0OYKTdhFvIGrjocWqEP4CP1eapOq/GeCh2ZPbHpbQ/53Ur8XtVDwDxKvKg8c\r\nunF3U48aATmUJUizat8MuzPBmwW8t7pWizZK+tmHpqQysD6/Q6BsjfX2OQp2\r\nxNLb2er2/38uzbz3f88rST9mCZM83/k87J8UvC9f7F1tdaA5ARzTSdw8qoQl\r\nyOe8cTGE6z0YJUYMKgU42M+SsfPXiRjqtVDN2LHYLw8w1rmNr/axPXYUYoY+\r\ntug7qyHIV61fbWd0wPRuaoQz95NmWsEdukhRKxtY3q8lgbg/eRqQiHs10/Mb\r\nK6rRZj/cu/FyQkwHUnCGWrOmLEkrQ3BVkRNdbDLKYfLpBSQBaY69AL3HdogB\r\n0QfZD363QRnWK9xKae79QVx7ylsfG28dMUM=\r\n=GHjL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bernardjoseph","email":"bernd.rellermeyer@t-online.de"},"directories":{},"maintainers":[{"name":"bernardjoseph","email":"bernd.rellermeyer@t-online.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-extension-citekey_0.1.2_1680168328362_0.6347856138087087"},"_hasShrinkwrap":false}},"maintainers":[{"name":"bernardjoseph","email":"bernd.rellermeyer@t-online.de"}],"description":"micromark extension to support Pandoc-style citation keys","homepage":"https://github.com/bernardjoseph/micromark-extension-citekey#readme","keywords":["micromark","micromark-extension","cite","citation","pandoc","markdown","remark","unified"],"repository":{"type":"git","url":"git+https://github.com/bernardjoseph/micromark-extension-citekey.git"},"author":{"name":"Bernd Rellermeyer","email":"bernd.rellermeyer@t-online.de"},"bugs":{"url":"https://github.com/bernardjoseph/micromark-extension-citekey/issues"},"license":"MIT","readme":"# micromark-extension-citekey\n\n**[micromark][]** extension to support [Pandoc][]-style citation keys.\n\n## When to use this\n\nIf you’re using [`micromark`][micromark] or\n[`mdast-util-from-markdown`][from-markdown], use this package.\nAlternatively, if you’re using **[remark][]**, use\n[`remark-citekey`][remark-citekey].\n\n## Install\n\nThis package is [ESM\nonly](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c):\nNode 12+ is needed to use it and it must be `import`ed instead of `require`d.\n\n[npm][]:\n\n```sh\nnpm install @bernardjoseph/micromark-extension-citekey\n```\n\n## Use\n\nSay we have the following file, `example.md`:\n\n```markdown\n@wadler1989. @{hughes1990.}\n```\n\nAnd our script, `example.js`, looks as follows:\n\n```js\nimport fs from 'node:fs'\nimport {micromark} from 'micromark'\nimport {citekey, citekeyHtml} from '@bernardjoseph/micromark-extension-citekey'\n\nconst out = micromark(fs.readFileSync('example.md'), {\n  extensions: [citekey()],\n  htmlExtensions: [citekeyHtml]\n})\n\nconsole.log(out)\n```\n\nNow, running `node example` yields:\n\n```html\n<p><span class=\"citekey\">@<span class=\"citeid=\">wadler1989</span></span>. <span class=\"citekey\">@{<span class=\"citeid=\">hughes1990.</span>}</span></p>\n```\n\n## API\n\nThis package exports the following identifiers: `citekey`, `citekeyHtml`.\nThere is no default export.\n\nThe export map supports the endorsed [`development`\ncondition](https://nodejs.org/api/packages.html#packages_resolving_user_conditions).\nRun `node --conditions development module.js` to get instrumented dev code.\nWithout this condition, production code is loaded.\n\n### `citekey(options?)`\n\nFunction that can be called with options to get an extension for micromark to\nparse [Pandoc][]-style citation keys (can be passed in `extensions`).\n\n###### `options.strict`\n\nA `boolean` option to restrict citation keys to ASCII.\n\nIf set to `true`, citation keys end at the first non-ASCII character.\nFor example, running the script:\n\n```js\nimport {micromark} from 'micromark'\nimport {citekey, citekeyHtml} from '@bernardjoseph/micromark-extension-citekey'\n\nconst out = micromark('@müller', {\n  extensions: [citekey({strict: true})],\n  htmlExtensions: [citekeyHtml]\n})\n\nconsole.log(out)\n```\n\nYields:\n\n```html\n<p><span class=\"citekey\">@<span class=\"citeid=\">m</span></span>üller</p>\n```\n\nThe default value is `false`.\n\n### `citekeyHtml`\n\nExtension for micromark to compile [Pandoc][]-style citation keys to HTML (can\nbe passed in `htmlExtensions`).\n\n###### Caveats\n\nLabeled item markers of [Pandoc numbered example\nlists][pandoc-numbered-example-lists] look like [Pandoc][]-style citation keys:\n\n```markdown\n(@good) This is a good example.\n\nAs (@good) illustrates, ...\n```\n\nCurrently, there exists no **[micromark][]** extension for [Pandoc numbered\nexample lists][pandoc-numbered-example-lists].\nWithout such an extension, all labeled item markers are parsed as citation keys.\n\n## Syntax\n\nThe syntax of [Pandoc][]-style citation keys is described in the [Pandoc\nmanual][pandoc-citation-syntax].\n\nThe [Pandoc manual][pandoc-manual] does not specify what characters are allowed\nto precede a citation key.\nThis extension imitates the behavior of the [Pandoc][] parser and allows all\ncharacters except alphanumerics and periods to precede a citation key.\n\n## Related\n\n*   [`remarkjs/remark`][remark]\n    — markdown processor powered by plugins\n*   [`remark-citekey`][remark-citekey]\n    — remark plugin to support citation keys\n*   [`micromark/micromark`][micromark]\n    — the smallest commonmark-compliant markdown parser that exists\n*   [`mdast-util-citekey`][mdast-util-citekey]\n    — mdast utility to support citation keys\n*   [`syntax-tree/mdast-util-from-markdown`][from-markdown]\n    — mdast parser using `micromark` to create mdast from markdown\n*   [`syntax-tree/mdast-util-to-markdown`][to-markdown]\n    — mdast serializer to create markdown from mdast\n\n## Contribute\n\nSee [`contributing.md` in `micromark/.github`][contributing] for ways to get\nstarted.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © Bernd Rellermeyer\n\n<!-- Definitions -->\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[remark]: https://github.com/remarkjs/remark\n\n[remark-citekey]: https://github.com/bernardjoseph/remark-citekey\n\n[from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown\n\n[mdast-util-citekey]: https://github.com/bernardjoseph/mdast-util-citekey\n\n[micromark]: https://github.com/micromark/micromark\n\n[pandoc]: https://pandoc.org\n\n[pandoc-manual]: https://pandoc.org/MANUAL.html\n\n[pandoc-citation-syntax]: https://pandoc.org/MANUAL.html#citation-syntax\n\n[pandoc-numbered-example-lists]: https://pandoc.org/MANUAL.html#numbered-example-lists\n\n[contributing]: https://github.com/unifiedjs/.github/blob/HEAD/contributing.md\n\n[support]: https://github.com/unifiedjs/.github/blob/HEAD/support.md\n\n[coc]: https://github.com/unifiedjs/.github/blob/HEAD/code-of-conduct.md\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n","readmeFilename":"readme.md"}