{"_id":"@eligundry/remark-excerpt","_rev":"2-f3efde4129de2002e0408ce85fa594ab","name":"@eligundry/remark-excerpt","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0-beta.1":{"name":"@eligundry/remark-excerpt","description":"Remark transformer for extracting an excerpt.","version":"2.0.0-beta.1","private":false,"author":{"name":"Eli Gundry","email":"eligundry@gmail.com","url":"https://eligundry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eligundry/remark-excerpt.git"},"keywords":["excerpt","markdown","more","preview","remark","remark-plugin","teaser"],"engines":{"node":">=16.0.0"},"main":"build/index.js","scripts":{"coverage":"jest --coverage","example":"node example/example.js","prettier":"prettier --write \"**/*.{js,ts,md,mdx,yml}\"","test":"yarn coverage","unit":"jest","build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"dependencies":{"unist-util-visit":"^4.1.0"},"devDependencies":{"@handbook/remark-node-types":"^1.1.0","@types/jest":"^27.5.1","jest":"28.0.0","jest-snapshot-serializer-raw":"1.2.0","prettier":"2.6.2","remark":"^14.0.2","to-vfile":"5.0.2","ts-jest":"^28.0.3","typescript":"^4.7.2"},"types":"./build/index.d.ts","gitHead":"c1d62559f8b343372477f08f7a55dcbf7e3725ab","bugs":{"url":"https://github.com/eligundry/remark-excerpt/issues"},"homepage":"https://github.com/eligundry/remark-excerpt#readme","_id":"@eligundry/remark-excerpt@2.0.0-beta.1","_nodeVersion":"16.13.1","_npmVersion":"8.5.3","dist":{"integrity":"sha512-LvbgQloWG95+hbNZym45/H4LSOO1skhETXgBZUjOBWcSnBvQ+VvquidB8zHMpYbwEKJgVNhmLpcBTq4kaqZecA==","shasum":"4d8a6dc65a595a63ea531c73294c569cd62b12ae","tarball":"https://registry.npmjs.org/@eligundry/remark-excerpt/-/remark-excerpt-2.0.0-beta.1.tgz","fileCount":5,"unpackedSize":7139,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCd7ZJ9vXc7Qt0PfyN5yMUWImWLghSuAjdl8YYlp/T6SgIgPynbl0hTBNLMGOe07DcOLofYKPEysqmFKDvyNLmCXPQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilsmNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZIA/+PaLOQ9Xy199sYdsjxx2epKatRsKunvwgzh8KXYswrvCsIGXm\r\nF9wM7xISANGSBFEszFKdMkM53QynPoPwYnzQeCJ6qVy99D2d13eQzu6LEuRt\r\nfVPcmMqCEg19rjaijYZnbWhUMzDOACrlzZx+gUDGnubOKPjFniXgy58YFvRI\r\nWltIN+3PMVqtZcVxWMBDJN3iSdiXfQKq3TtyUAXf0zxnrSf9v3ErUbOsmqLE\r\nwTZKtfX52wettJCaRLQHHJMqR4e1l9Ptlj7DsRnq/KuhnxkQnkZiub8dKX9z\r\nMRbGO2OYlXt6Lk/d1Jx4ICWEVAgiYRU1UYM4RzT6VmwJKUwMU7fOnYNSx2yW\r\nb4BynZmOGeMPhqAnuy3XmwdouNQQBWYi+kUpHE1KAHcutx0G3jzEz7ygq4CG\r\nfhn/FuovwC02Rio8H35la1lgbBPoYQ8qFBY2ApC/YM+9GaqxaFLqX2VgMRrF\r\nD77P9aFTXD5ZqSLGsWlfLNYAEwg2wBVLk1QwDNZoCIge/Y80sZtrstjtYjVE\r\nc+JRv/z+KJOz/Akpxw8b+zhGBzg/WxamgjP0S/7ec0jCtyk/QZ1nP8jE7yyN\r\npttS7/e27cwr+W7KKk3hpH7w/XC3n7xYaFrikAfQVfUyeTwfHiq0RhRXyD4q\r\ntWG/sX5lUsoDYZXxgXnA9NArVz/YjNr5Bv8=\r\n=jJ8X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eligundry","email":"eligundry@gmail.com"},"directories":{},"maintainers":[{"name":"eligundry","email":"eligundry@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-excerpt_2.0.0-beta.1_1654049165418_0.35049899702351106"},"_hasShrinkwrap":false},"2.0.0-beta.2":{"name":"@eligundry/remark-excerpt","description":"Remark transformer for extracting an excerpt.","version":"2.0.0-beta.2","private":false,"author":{"name":"Eli Gundry","email":"eligundry@gmail.com","url":"https://eligundry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eligundry/remark-excerpt.git"},"publishConfig":{"access":"public"},"keywords":["excerpt","markdown","more","preview","remark","remark-plugin","teaser"],"engines":{"node":">=16.0.0"},"type":"module","main":"./build/index.js","exports":{".":"./build/index.js"},"typesVersions":{"*":{"index.d.ts":["build/index.d.ts"]}},"scripts":{"coverage":"jest --coverage","example":"node example/example.js","prettier":"prettier --write \"**/*.{js,ts,md,mdx,yml}\"","test":"yarn coverage","unit":"jest","build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"dependencies":{"unist-util-visit":"^4.1.0"},"devDependencies":{"@handbook/remark-node-types":"^1.1.0","@types/jest":"^27.5.1","jest":"28.0.0","jest-snapshot-serializer-raw":"1.2.0","prettier":"2.6.2","remark":"^14.0.2","to-vfile":"5.0.2","ts-jest":"^28.0.3","typescript":"^4.7.2"},"types":"./build/index.d.ts","gitHead":"39fea834ddcce84817c59e90af5274c40fd777a2","bugs":{"url":"https://github.com/eligundry/remark-excerpt/issues"},"homepage":"https://github.com/eligundry/remark-excerpt#readme","_id":"@eligundry/remark-excerpt@2.0.0-beta.2","_nodeVersion":"16.13.1","_npmVersion":"8.5.3","dist":{"integrity":"sha512-akAdbk1YPjLKhhdCq02eIDctk5IHtXKaPKBmlpxQWQsZY6rtoXoU4uNDD6llzHCsU5Gve9Npa6C6bCN4T4LDOQ==","shasum":"10e2f368114f5b62e316798af0e564c925aa28cc","tarball":"https://registry.npmjs.org/@eligundry/remark-excerpt/-/remark-excerpt-2.0.0-beta.2.tgz","fileCount":5,"unpackedSize":6634,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDefagUjiAz597yMDSEaWnZs0L7eFp84BYLKZezsEY8fgIgOim8MfjHK+pcYvaGERWt7DLJyx7shkeZwQPHwRR5Twk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJils5BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8lQ/+LP4DYBAU2MVh/uS3LoqNq8GScyfzeZNODbmI/4StFJ2dlPkg\r\nhoXhtfohfHMBu+iUOHtm3x2q7DcHqTp9vIFHxboFU3P9jLoEa3YWzNIXKFPI\r\nQBcZ+6Oor6eHFp4AhvfoUPvMc9XoHUb1bD8AReLjJJYh9YpOWCcv0Ajganv0\r\n90L0EmKT6DiZ233E/gWtXYU1/C8v5EU5p+/dti4t9ZhWYoRDDM4g3P9uy9Ij\r\nMCbtYIa4pTaHW+wndATJWdZ3hrUWedyfbSkdBCh96/FNFUKv9jqNl526Aasf\r\nJfQrzDLpD7niufpnWTbdjj0cG8PdXnZMUQFHCNfS3nzHIuIJD/Fwi1TN7zbN\r\nARmLWJXJ0tZdSGMz06VSZ+5o2jEW1IWq8VnkZ9B4QoWL2dpZS5je/y/TmoPW\r\nPVWwh7v0fkDeXPNbRlXb10kc2JZMOIhizk+2mGK4ZMhXbVJEOQ/A56pKOlwb\r\n0BMwG1riLJOq5cJvuM4KljHfiGo4/ibK2TJFEKbSkNfLobpd/urpDlQFfgvq\r\nC2OUtJqpi0qMcmk5R7KWoK+pbGPke0worqtydjIYQNLL2H5RWBkMFKp5+/ZL\r\nhVA1S9OYQujhL+3xep0CR/Oh+nDH6F1i6LOHsMElHaFYiZWPVytUawEsg2UB\r\nafA5GWLGXVgejfQKREB2VSDZeB53i4SE8yk=\r\n=trUj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eligundry","email":"eligundry@gmail.com"},"directories":{},"maintainers":[{"name":"eligundry","email":"eligundry@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-excerpt_2.0.0-beta.2_1654050369400_0.6386714832260427"},"_hasShrinkwrap":false},"2.0.0":{"name":"@eligundry/remark-excerpt","description":"Remark transformer for extracting an excerpt.","version":"2.0.0","private":false,"author":{"name":"Eli Gundry","email":"eligundry@gmail.com","url":"https://eligundry.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/eligundry/remark-excerpt.git"},"publishConfig":{"access":"public"},"keywords":["excerpt","markdown","more","preview","remark","remark-plugin","teaser"],"engines":{"node":">=16.0.0"},"type":"module","main":"./build/index.js","exports":{".":"./build/index.js"},"typesVersions":{"*":{"index.d.ts":["build/index.d.ts"]}},"scripts":{"coverage":"jest --coverage","example":"node example/example.mjs","prettier":"prettier --write \"**/*.{js,ts,md,mdx,yml}\"","test":"yarn coverage","unit":"jest","build":"tsc -p tsconfig.json","prepublishOnly":"npm run build"},"dependencies":{"unist-util-visit":"^4.1.0"},"peerDependencies":{"remark-comment":"^1.0.0","remark-mdx":"^2.1.1","remark-parse":"^10.0.1"},"peerDependenciesMeta":{"remark-mdx":{"optional":true}},"devDependencies":{"@handbook/remark-node-types":"^1.1.0","@types/jest":"^27.5.1","jest":"28.0.0","jest-snapshot-serializer-raw":"1.2.0","prettier":"2.6.2","remark":"^14.0.2","remark-comment":"^1.0.0","remark-mdx":"^2.1.1","remark-parse":"^10.0.1","to-vfile":"5.0.2","ts-jest":"^28.0.3","typescript":"^4.7.2"},"prettier":{"arrowParens":"always","bracketSpacing":true,"singleQuote":true,"tabWidth":2,"trailingComma":"es5","semi":false},"types":"./build/index.d.ts","gitHead":"9ea8a5a8dd33dab03ed4b6d0452cc067a74de7f1","bugs":{"url":"https://github.com/eligundry/remark-excerpt/issues"},"homepage":"https://github.com/eligundry/remark-excerpt#readme","_id":"@eligundry/remark-excerpt@2.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.5.3","dist":{"integrity":"sha512-h+IneLrKyMUGA9TPLH0vrI4NYaxqsNFdPkk2awPcHRv8KjFEVLDmemMyT0zxQqHJ/r3RAMOK7dK0JvM8Ak9Pgw==","shasum":"97f8618a391ec9228201981195ddbd10716101ac","tarball":"https://registry.npmjs.org/@eligundry/remark-excerpt/-/remark-excerpt-2.0.0.tgz","fileCount":5,"unpackedSize":8763,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkAfhS+nDssLhKHWXvQ0uMgj866MzwBs7C4s023zZOCAiBAbinewZxTUaarHVpVebg3U8r+FyYpvRFs/A/LFcd4Ug=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiptEhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkzRAAhgfWC8l2DbS8c8sD+HLdzyUWFGVyKkUF+Sh7uPM4WaOIO36I\r\nLR1VCvB6elSYq4zTMUKWJDKDHvNlZ54Z4ZoCR0kvsfo25nt+YE/yT8xXT3lT\r\nHPQArUaZq9C1FDkemHHC4+prJSM1PQjYpIwaNJAALWJK0ZKvYt8rccy+FkLz\r\nXwVarf3cyV15sFtPM9wRUinbvGEzwop1lto4ClJXBtfxM+7/Ez7SrN519XTg\r\n5az7dscRg7Z/7nCDTCPRoqFh7aFf2F+J0uUa3O+4u1Um51QAdeC438nygq6E\r\nH3mFBLlquGKNtNhb0+IecHwaDrhLWynz128PPVIVKqP5VvUry9c3MaSXBhhD\r\nmhw011qGIigpwWAsbBf/uE1w9r2N/COydRo212xTVV5D+SOwy9xCMvrO4i50\r\nr+67mSknwxy611ZDsaETak8cqOFMKzbAPBRZDMOMdhVwZdaAALciZt779q53\r\npwPSZmSQ3jzbdL4bBm8H33dLnP+E+cib10oiN3yEAyv6Ld3AAHYQLjf2itW4\r\nwuNd4qndkoEyRGSyrHldcVFzLgHPGtQ3ie5t7kD4qUeatVURlupVapaz05eC\r\nSG0QWvevziTBqPD30K+s6xPXiOsL82iWR3BJ21RLgB8UYp1D7veqNwUWXpNm\r\nm21cRKmRu40A++3oYQBrBSFK6FFmKfhhD3E=\r\n=2Aqp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"eligundry","email":"eligundry@gmail.com"},"directories":{},"maintainers":[{"name":"eligundry","email":"eligundry@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-excerpt_2.0.0_1655099681076_0.17327350595902535"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-01T02:06:05.354Z","2.0.0-beta.1":"2022-06-01T02:06:05.568Z","modified":"2022-06-13T05:54:41.263Z","2.0.0-beta.2":"2022-06-01T02:26:09.575Z","2.0.0":"2022-06-13T05:54:41.205Z"},"maintainers":[{"name":"eligundry","email":"eligundry@gmail.com"}],"description":"Remark transformer for extracting an excerpt.","homepage":"https://github.com/eligundry/remark-excerpt#readme","keywords":["excerpt","markdown","more","preview","remark","remark-plugin","teaser"],"repository":{"type":"git","url":"git+https://github.com/eligundry/remark-excerpt.git"},"author":{"name":"Eli Gundry","email":"eligundry@gmail.com","url":"https://eligundry.com"},"bugs":{"url":"https://github.com/eligundry/remark-excerpt/issues"},"license":"MIT","readme":"# remark-excerpt\n\n> [Remark](https://remark.js.org/) transformer for extracting an excerpt.\n\nThis is a [remark](https://remark.js.org/) plugin for transformer for extracting an excerpt, similar to [WordPress's excerpt functionality](https://kinsta.com/knowledgebase/wordpress-excerpt/).\n\nThis repo is a fork of [manovotny/remark-excerpt](https://github.com/manovotny/remark-excerpt) that I extended for more\nrelated functionality and better MDX support.\n\nThis plugin is tailored for MDX support. In order to use this plugin, the following packages must be installed and\nincluded in the Remark `use` chain:\n\n* [remark-parse](https://www.npmjs.com/package/remark-parse)\n* [remark-comment](https://www.npmjs.com/package/remark-comment)\n* Some sort of MDX processor, either [remark-mdx](https://github.com/mdx-js/mdx/tree/main/packages/remark-mdx) or\n  providing this plugin and others to [mdx-bundler](https://github.com/kentcdodds/mdx-bundler) in the `remarkPlugins`\n  option.\n\n## Installation\n\n```bash\n# npm\n$ npm i @eligundry/remark-excerpt remark-parse remark-comment\n# yarn\n$ yarn add @eligundry/remark-excerpt remark-parse remark-comment\n```\n\nThis package is ESM only and I sorta regret it! Life is a learning experience!\n\n## Usage\n\nSay we have the following file, `example.md`:\n\n```\n# Title\n\nParagraph 1.\n\nParagraph 2.\n\n<!-- excerpt -->\n\nParagraph 3.\n\nParagraph 4.\n```\n\nAnd our script, `example.js`, looks as follows:\n\n```javascript\nimport fs from 'fs'\nimport { remark } from 'remark'\nimport remarkParse from 'remark-parse'\nimport remarkComment from 'remark-comment'\nimport { excerpt } from '@eligundry/remark-excerpt'\n\n;(async () => {\n  const file = await fs.promises.read('example.md')\n  const result = await remark()\n    .use(remarkParse)\n    .use(remarkComment, { ast: true })\n    .use(excerpt)\n    .process(file)\n\n  console.log(result.toString())\n})()\n```\n\nNow, running `node example` yields:\n\n```\n# Title\n\nParagraph 1.\n\nParagraph 2.\n```\n\nIf you wanted to link to where the excerpt broke off, say for a read more link, you would do the following:\n\n```javascript\nimport fs from 'fs'\nimport { remark } from 'remark'\nimport remarkParse from 'remark-parse'\nimport remarkComment from 'remark-comment'\nimport remarkMDX from 'remark-mdx'\nimport { excerptBreakpoint } from '@eligundry/remark-excerpt'\n\n;(async () => {\n  const file = await fs.promises.read('example.md')\n  const result = await remark()\n    .use(remarkMDX)\n    .use(remarkParse)\n    .use(remarkComment, { ast: true })\n    .use(excerptBreakpoint)\n    .process(file)\n\n  console.log(result.toString())\n})()\n```\n\nThis would yield the following:\n\n```\n# Title\n\nParagraph 1.\n\nParagraph 2.\n\n<span id=\"read-more\" />\n\nParagraph 3.\n\nParagraph 4.\n```\n\n## API\n\n### `remark().use(excerpt[, options])`\n\nReturns markdown content specified before the excerpt comment.\n\n#### Options\n\n##### `identifier`\n\nType: `String`\nDefault: `excerpt`, `more`, `preview`, or `teaser`\n\nSpecifies the excerpt comment identifier to look for.\n\n### `remark().use(excerptBreakpoint[, options])`\n\nInserts a `<span id=\"read-more\" />` tag with MDX. This can be used for deep linking into documents from a read more link\nin the preview. If there are multiple `<!-- excerpt -->` comments, this element will be inserted at the last instance.\n\n##### `identifier`\n\nType: `String`\nDefault: `excerpt`, `more`, `preview`, or `teaser`\n\nSpecifies the excerpt comment identifier to look for.\n\n##### `breakpointID`\n\nType: `String`\nDefault: `read-more`\n\nThe ID to be applied to the `<span />` element for the breakpoint. Can be helpful if you have multiple breakpoints that\nyou need to scroll to from various previews.\n\n## License\n\nMIT © [Eli Gundry](https://eligundry.com)\n","readmeFilename":"README.md"}