{"_id":"@cogsandsquigs/remark-bibliography","_rev":"5-f102f40761b26274edc4c46052afbcc2","name":"@cogsandsquigs/remark-bibliography","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","mdast":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"@babel/preset-env":"^7.21.5","@types/jest":"^29.5.1","babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","prettier":"^2.8.8","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"jest"},"type":"module","types":"./index.d.ts","version":"1.0.0","gitHead":"41336c3dae977278888c9dedc44a839d42ea830a","_id":"@cogsandsquigs/remark-bibliography@1.0.0","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-QBbD1d+1zlsa65DaIIQmGXIWmLux6hhOh4Q3iSfUsm3eKTnNZKDWZJynQ5TK9IbzK5xnEkMLuI65eml07gcQ6A==","shasum":"c95bbdac32d73a103b08d569addf8b871f3cd954","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.0.0.tgz","fileCount":11,"unpackedSize":10433,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6jFG7Ot+JlQ+lerej71e+If5VRyMpvgu7+KXUnId27QIgYPiISl4K9ThQBTim+te58Sm9afZDTprLEiJftur/XDI="}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.0.0_1683942433455_0.016578721846636002"},"_hasShrinkwrap":false},"1.0.1":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","mdast":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.8","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","types":"./index.d.ts","version":"1.0.1","gitHead":"d8d495292ea6e089a74e16534d746fad44feb980","_id":"@cogsandsquigs/remark-bibliography@1.0.1","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-wSu3pvmVmgf+4pL4vlzEc18/zd6mJJm8QLarrRFA6kpavxYLctSmZLPBGWWOh0VSdBR8EU2Hh2u2GkH1KsPI1A==","shasum":"c07f862f7ecb7703d565edc1c4fcdfc39a382f8f","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.0.1.tgz","fileCount":9,"unpackedSize":9114,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyH2ke9zF7TH88IWueU7+tzsP3R1yMS+ScPmSvnYChBgIhAJkKHmNgMbj1+RN/Ado2tj9MIWYvzEFB4Im616CHr0rR"}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.0.1_1683943375043_0.5971530702920929"},"_hasShrinkwrap":false},"1.0.2":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","mdast":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.8","remark-directive":"^2.0.1","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","types":"./index.d.ts","version":"1.0.2","gitHead":"7d649120a16b52a15db86f1cc1d25c2b7e4f0960","_id":"@cogsandsquigs/remark-bibliography@1.0.2","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-kq9mB5VG1YdmA5euR792mC+cDv6rQY1MGPlBomA5t0XLq2Zp45gI/04kZ0iOH9nyzyrxN3Q0pq1xfUMlyPbbmw==","shasum":"1021a50e25157dd5e7b1037b28c387602b206a03","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.0.2.tgz","fileCount":9,"unpackedSize":14069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvuavVH2c2xZ4D2QrwPyl0IY4of9Hy8qhSeLIO/YNvFQIgb4bMJKqDc0xK6mqVn0Pgu17GCuW7JtUqCn+euGJNRc8="}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.0.2_1684107999183_0.7905760245713367"},"_hasShrinkwrap":false},"1.0.3":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","mdast":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.8.8","remark-directive":"^2.0.1","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"type":"module","types":"./index.d.ts","version":"1.0.3","gitHead":"6c419efc4dd1bf093c83bea3b35c205db067a90a","_id":"@cogsandsquigs/remark-bibliography@1.0.3","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-KlHzQUTTe9pGBXtDl1XEoDebDYxtwPx0BNdPbb7aAxRIIsDBhD65/VuLErsfLSQHL+JftmM8BfSqpzACeAD2Xw==","shasum":"c6ca7c5f694ab22dd74daad1ed865bb9e70323d9","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.0.3.tgz","fileCount":9,"unpackedSize":14080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBAG1n5fcKlyIZB7sGnM73peZF25/pbfXRz+Hpk58G/FAiA9feJHqTgNJVrXQg1O9JikgMOQtHD/zkovVa8ueUlAJA=="}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.0.3_1684108265232_0.7984209216700886"},"_hasShrinkwrap":false},"1.1.0":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","mdast":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","prettier":"^2.8.8","remark-directive":"^2.0.1","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"type":"module","types":"./index.d.ts","version":"1.1.0","gitHead":"c393057463752e04684853842f64a981b762ac6d","_id":"@cogsandsquigs/remark-bibliography@1.1.0","_nodeVersion":"19.9.0","_npmVersion":"9.6.6","dist":{"integrity":"sha512-xdWCTDWa3nAFllNZFjy4sTr580bcA/O7II5AcDWNt2pojmiYVUVbfaS6tVfQBlvp/upBLqKPxdS/erQjXB43XQ==","shasum":"a2c059273f2b2b5e2a73e821aaee0c892a2b5052","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.1.0.tgz","fileCount":12,"unpackedSize":17572,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwhB0mz/y7I4efWkkf9a2I8Z5rDse7K8o7ldNPx1x5YAiEAxrwrR7Mxx6Bk4pnFLvZgxP1mQypZWOocaZpXH+zYfW4="}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.1.0_1684114202632_0.2660019808371288"},"_hasShrinkwrap":false},"1.1.1":{"author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"dependencies":{"@citation-js/plugin-bibtex":"^0.6.8","citation-js":"^0.6.8","remark":"^3.0.0","mdast-util-to-string":"^3.2.0","unist-util-visit":"^4.1.2"},"description":"A bibliography plugin for Markdown.","devDependencies":{"babel-jest":"^29.5.0","eslint":"^8.40.0","eslint-plugin-prettier":"^4.2.1","jest":"^29.5.0","prettier":"^2.8.8","remark-directive":"^2.0.1","remark-parse":"^10.0.1","remark-stringify":"^10.0.2","ts-jest":"^29.1.0","typescript":"^5.0.4","unified":"^10.1.2"},"license":"MIT","main":"index.js","name":"@cogsandsquigs/remark-bibliography","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"type":"module","types":"./index.d.ts","version":"1.1.1","licenseText":"Copyright (c) 2023 Ian Pratt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"@cogsandsquigs/remark-bibliography@1.1.1","dist":{"shasum":"f685b6c141ba2bf5f0fd0528688ea15ad8959e73","integrity":"sha512-DD5HhlCrnmwkcIDpYybMoE4dP979gu7KCWo2lo1mvQLV0E2semCrEURBucJJ2oboQW3r+V3awmn2oexNoA/V1w==","tarball":"https://registry.npmjs.org/@cogsandsquigs/remark-bibliography/-/remark-bibliography-1.1.1.tgz","fileCount":14,"unpackedSize":17665,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsYWvHilD9KLjspQBSHJIML0C3sEETBF+50LjziSmBBAiEAhU7SkS/R4O7b/1YZaH0ZjVjX+ps/+fF/HDBph0hQJh0="}]},"_npmUser":{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"},"directories":{},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-bibliography_1.1.1_1692130066178_0.2205840251514679"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-13T01:47:13.394Z","1.0.0":"2023-05-13T01:47:13.616Z","modified":"2023-08-15T20:07:46.545Z","1.0.1":"2023-05-13T02:02:55.268Z","1.0.2":"2023-05-14T23:46:39.369Z","1.0.3":"2023-05-14T23:51:05.485Z","1.1.0":"2023-05-15T01:30:02.842Z","1.1.1":"2023-08-15T20:07:46.356Z"},"maintainers":[{"name":"cogsandsquigs","email":"ianjdpratt@gmail.com"}],"description":"A bibliography plugin for Markdown.","author":{"name":"Ian Pratt","email":"ianjdpratt@gmail.com"},"license":"MIT","readme":"# remark-bibliography\n\n![GitHub](https://img.shields.io/github/license/cogsandsquigs/remark-bibliography?style=for-the-badge)\n\nA bibliography plugin for Markdown.\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(remarkBibliography)`](#unifieduseremarkbibliography)\n  - [Options](#options)\n    - [`style`](#style)\n- [Syntax](#syntax)\n- [Types](#types)\n- [Compatibility](#compatibility)\n- [Security](#security)\n- [Notes](#notes)\n- [Related](#related)\n- [Contribute](#contribute)\n- [License](#license)\n\n## What is this?\n\nThis plugin adds a bibliography to your Markdown document using [citation-js](https://citation.js.org/) and [remark-directive](https://github.com/remarkjs/remark-directive). The bibliography is rendered in the style of your choice (APA, MLA, etc.), and the in-text citations are rendered in the same style as well.\n\n## When should I use this?\n\nIf you want to add a bibliography to your Markdown document, this plugin is for you. It's easy to use, and it's easy to add citations to your document. It achieves this through the markdown directives format, which is a nice way to add extra functionality to Markdown. Parsing citations is done through [citation-js](https://citation.js.org/), which is a powerful library for parsing and manipulating citations. For now, only BibTeX is supported, but hopefully more formats will be supported in the future.\n\n## Install\n\nThis package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\nIn Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:\n\n```sh\nnpm install @cogsandsquigs/remark-bibliography\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkBibliography from \"https://esm.sh/@cogsandsquigs/remark-bibliography\";\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n\timport remarkBibliography from \"https://esm.sh/@cogsandsquigs/remark-bibliography?bundle\";\n</script>\n```\n\n## Use\n\nLet's look at an example:\n\n```md\nAn in-text citation :cite[knuth:1984] wow!\n\nAnother one! :cite[lesk:1977]\n\n## Bibliography\n\n:::bib\n@article{knuth:1984,\ntitle={Literate Programming},\nauthor={Donald E. Knuth},\njournal={The Computer Journal},\nvolume={27},\nnumber={2},\npages={97--111},\nyear={1984},\npublisher={Oxford University Press}\n}\n\n@inproceedings{lesk:1977,\ntitle={Computer Typesetting of Technical Journals on {UNIX}},\nauthor={Michael Lesk and Brian Kernighan},\nbooktitle={Proceedings of American Federation of\nInformation Processing Societies: 1977\nNational Computer Conference},\npages={879--888},\nyear={1977},\naddress={Dallas, Texas}\n}\n:::\n```\n\nTo process this, use this plugin as you would for any other remark plugin. However, note that [`remark-directive`](https://github.com/remarkjs/remark-directive) **_must_** be added before this plugin, otherwise it will not work.\n\n```js\nimport { readFileSync, writeFileSync } from \"fs\";\nimport { unified } from \"unified\";\nimport remarkDirective from \"remark-directive\";\nimport remarkBibliography from \"@cogsandsquigs/remark-bibliography\";\nimport remarkParse from \"remark-parse\";\nimport remarkStringify from \"remark-stringify\";\n\nconst file = readFileSync(\"path/to/file.md\");\nconst result = unified()\n\t.use(remarkParse)\n\t.use(remarkDirective)\n\t.use(remarkBibliography)\n\t.use(remarkStringify)\n\t.processSync(file);\n\nwriteFileSync(\"path/to/output.md\", result);\n```\n\nThe output looks like this:\n\n```md\nAn in-text citation (Knuth, 1984) wow!\n\nAnother one! (Lesk & Kernighan, 1977)\n\n## Bibliography\n\n<div class=\"csl-bib-body\">\n  <div data-csl-entry-id=\"knuth:1984\" class=\"csl-entry\">Knuth, D. E. (1984). Literate Programming. <i>The Computer Journal</i>, <i>27</i>(2), 97–111.</div>\n  <div data-csl-entry-id=\"lesk:1977\" class=\"csl-entry\">Lesk, M., &#38; Kernighan, B. (1977). Computer Typesetting of Technical Journals on UNIX. <i>Proceedings of American Federation of Information Processing Societies: 1977 National Computer Conference</i>, 879–888.</div>\n</div>\n```\n\nNote that the bibliography has the style `csl-bib-body` and each entry has the style `csl-entry`. This is so that you can style the bibliography however you want. For example, you can use the following CSS to style the bibliography in APA style:\n\n```css\n/** \n * This targets every entry in the bibliography, and indents it by 2em. This is aligned with APA\n * style, which requires the second and subsequent lines of each entry to be indented.\n */\n.csl-entry {\n\ttext-indent: -2em;\n\tmargin-left: 2em;\n}\n```\n\n## API\n\nThis package exports no identifiers. The default export is `remarkBibliography`.\n\n### `unified().use(remarkBibliography[, options])`\n\nPlugin to add a bibliography to your Markdown document.\n\n### Options\n\n#### `style`\n\nA string setting the style of the bibliography. This can be any of the following:\n\n- `\"apa\"`\n- `\"mla\"`\n- `\"chicago\"`\n- `\"vancouver\"`\n- etc.\n\nSee the `citation-js` [docs](https://citation.js.org/api/tutorial-output_formats.html) for more information.\n\nDefaults to `\"apa\"`.\n\n#### `export`\n\nA boolean detailing if the Cite object should be added to the `data` property of the `VFile` being processed.\n\nDefaults to `false`.\n\n#### `exportProperty`\n\nA string detailing the property of the `data` object to add the Cite object to.\n\nDefaults to `\"bibliography\"`.\n\n## Syntax\n\nThe bibliography is delimited by `:::bib` and `:::`, and each entry is a source in BibTeX format. The bibliography **only** accepts BibTeX for the time being, however that may change in the future.\n\nEach in-text citation must be in the form of `:cite[<key>]`, where `<key>` is the key of the citation in the bibliography. This will be replaced with an in-text citation in the style of your choice (APA, MLA, etc. See below).\n\n## Types\n\nThis package is fully typed with TypeScript.\nThere are no extra exported types.\n\n## Compatibility\n\nThis plugin has been tested with `node` version 19+.\n\nThis plugin has been tested with `unified` version 10+ and `remark` version 10+.\n\nNote however that this plugin is not tested against all historic versions of these packages, and probably will work with older versions.\n\n## Security\n\nSo long as [citation-js](https://citation.js.org/) is safe, this plugin should be safe as well.\n\n## Notes\n\n- This requires the usage of [`remark-directive`](https://github.com/remarkjs/remark-directive). Make sure to add this plugin before adding this one!\n- If your markdown parser freaks out because of BibTeX's curly braces (say, if you're using MDX), then you can wrap the BibTeX in a code block. Hacky, but it works! Unfortunately, this is an error due to the markdown parser, and not this plugin. So it's out of my control. :(\n- Do **not** have more than one bibliography in a markdown file. This will cause the plugin to break. Put everything in one `bib` directive, and it will work fine.\n\n## Related\n\n- [`remark-bibliography`](https://github.com/Symbitic/remark-plugins/blob/master/packages/remark-bibliography/README.md) - Remark plugin for adding citations and bibliographies to Markdown documents through external files.\n- [`remark-cite`](https://github.com/benrbray/remark-cite) - Remark plugin for citations and bibliographies, `pandoc`-style.\n\n## Contribute\n\nOpen an issue or pull request for anything you’d like to see!\n\n## License\n\n[MIT](LICENSE) © [Ian Pratt](https://github.com/cogsandsquigs)\n","readmeFilename":"README.md"}