{"_id":"@andystevensname/remark-poem-element","_rev":"7-6abd6e44f33dd29c3f7b4b43c9b7d577","name":"@andystevensname/remark-poem-element","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@andystevensname/remark-poem-element","version":"1.1.0","keywords":["remark","remark-plugin","markdown","mdast","poetry","poem-element","web-component","ssr"],"author":{"name":"Andy Stevens"},"license":"MIT","_id":"@andystevensname/remark-poem-element@1.1.0","maintainers":[{"name":"andystevensname","email":"taylorstevens@gmail.com"}],"homepage":"https://github.com/andystevensname/remark-poem-element#readme","bugs":{"url":"https://github.com/andystevensname/remark-poem-element/issues"},"dist":{"shasum":"daec3ab28075a81de268786053e4d476879ca15d","tarball":"https://registry.npmjs.org/@andystevensname/remark-poem-element/-/remark-poem-element-1.1.0.tgz","fileCount":4,"integrity":"sha512-fyXoQQen3Mq/DD4IH8Y64KjJrYTrfczVkG7fSmG+fLVkY41CMMNRdtCz3wAbEnyeWldsrW9WmozD+j+WSVZhNA==","signatures":[{"sig":"MEUCIFEqYUOFcfRtn3nZpvOWk0zpoSRsBhtQ0GPEOoCb8DceAiEArzEDGAYdmyTX4NDRScBFyQUiwud0+S6sNiuKiQTYZmI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6870},"main":"index.js","type":"module","exports":{".":"./index.js"},"gitHead":"88efc2a0d489740009b4732b2635fd581d2f7b4c","scripts":{"test":"node --test"},"_npmUser":{"name":"andystevensname","email":"taylorstevens@gmail.com"},"repository":{"url":"git+https://github.com/andystevensname/remark-poem-element.git","type":"git"},"_npmVersion":"11.3.0","description":"Remark plugin to transform fenced poem code blocks into <poem-element> custom elements with SSR support.","directories":{},"_nodeVersion":"24.0.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"remark":"^15.0.1","poem-element":"^2.5.3","unist-util-visit":"^5.1.0"},"peerDependencies":{"poem-element":">=1.0.0","unist-util-visit":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/remark-poem-element_1.1.0_1775845360171_0.17482099736905266","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@andystevensname/remark-poem-element","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"version":"1.1.1","description":"Remark plugin to transform fenced poem code blocks into <poem-element> custom elements with SSR support.","type":"module","main":"index.js","exports":{".":"./index.js"},"scripts":{"test":"node --test"},"keywords":["remark","remark-plugin","markdown","mdast","poetry","poem-element","web-component","ssr"],"author":{"name":"Andy Stevens"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/andystevensname/remark-poem-element.git"},"bugs":{"url":"https://github.com/andystevensname/remark-poem-element/issues"},"homepage":"https://github.com/andystevensname/remark-poem-element#readme","peerDependencies":{"poem-element":">=1.0.0","unist-util-visit":"^5.0.0"},"devDependencies":{"poem-element":"^2.5.3","remark":"^15.0.1","unist-util-visit":"^5.1.0"},"gitHead":"384b04cb5005732eb851d0496545860decc72680","_id":"@andystevensname/remark-poem-element@1.1.1","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-UvpwfXjR78m50q1OrU7JF1vxgUbt9bUqjNRuOM7j6dGFbOUOcEQVe0YHOHOYfDTjo0bOUOXGOwmT8umu/39oRw==","shasum":"6d05d5a80724ac172d2b22334e4c9ffbdcc4209d","tarball":"https://registry.npmjs.org/@andystevensname/remark-poem-element/-/remark-poem-element-1.1.1.tgz","fileCount":4,"unpackedSize":6870,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@andystevensname%2fremark-poem-element@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFG91Rj0s8u1yY53yT5L1PACU9ZE2diG33llDhNbY6Y+AiEA+Qye4VsbWDFZao4Em9+VEO7jGrmxD120Nn9zIJh3zFA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:83ad5a9d-1ef6-401a-87a2-7d772b9a1c67"}},"directories":{},"maintainers":[{"name":"andystevensname","email":"taylorstevens@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-poem-element_1.1.1_1775845445065_0.9286806706010675"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T18:22:40.098Z","modified":"2026-04-10T18:24:05.459Z","1.0.0":"2026-04-10T13:55:04.424Z","1.0.1":"2026-04-10T13:57:03.289Z","1.0.3":"2026-04-10T13:59:49.961Z","1.1.0":"2026-04-10T18:22:40.379Z","1.1.1":"2026-04-10T18:24:05.196Z"},"bugs":{"url":"https://github.com/andystevensname/remark-poem-element/issues"},"author":{"name":"Andy Stevens"},"license":"MIT","homepage":"https://github.com/andystevensname/remark-poem-element#readme","keywords":["remark","remark-plugin","markdown","mdast","poetry","poem-element","web-component","ssr"],"repository":{"type":"git","url":"git+https://github.com/andystevensname/remark-poem-element.git"},"description":"Remark plugin to transform fenced poem code blocks into <poem-element> custom elements with SSR support.","maintainers":[{"name":"andystevensname","email":"taylorstevens@gmail.com"}],"readme":"# remark-poem-element\n\nA [remark](https://github.com/remarkjs/remark) plugin that transforms fenced code blocks tagged `poem` into [`<poem-element>`](https://github.com/andystevensname/poem-element) custom elements with full Declarative Shadow DOM SSR.\n\n## Why\n\nStandard Markdown has no semantic way to express poetry. `<p>` flattens line breaks, `<pre>` is generic preformatted text, and inline HTML is verbose. This plugin lets you write poems in Markdown using the familiar fenced code block syntax — `` ```poem `` — and get a fully semantic, accessible, server-rendered web component in return. If a Markdown processor doesn't have this plugin installed, the content still renders as a normal code block, so the source remains portable.\n\n## Install\n\n```sh\nnpm install remark-poem-element poem-element\n```\n\n`poem-element` and `unist-util-visit` are peer dependencies.\n\n## Usage\n\n```js\nimport { remark } from 'remark';\nimport remarkHtml from 'remark-html';\nimport remarkPoemElement from 'remark-poem-element';\n\nconst md = `\n\\`\\`\\`poem numbers title=\"Sonnet 43\" author=\"Elizabeth Barrett Browning\"\nHow do I love thee? Let me count the ways.\nI love thee to the depth and breadth and height\n\\`\\`\\`\n`;\n\nconst html = await remark()\n  .use(remarkPoemElement)\n  .use(remarkHtml, { sanitize: false })\n  .process(md);\n\nconsole.log(String(html));\n```\n\n## Syntax\n\nA fenced code block with the `poem` info string becomes a `<poem-element>`. Anything after `poem` on the opening line becomes attributes:\n\n````md\n```poem numbers wrap=indent title=\"Buffalo Bill 's\" author=\"ee cummings\"\nBuffalo Bill 's\ndefunct\n               who used to\n               ride a watersmooth-silver\n                                                              stallion\n```\n````\n\n### Attributes\n\nAny attribute supported by `poem-element` can be passed through. See the [poem-element documentation](https://github.com/andystevensname/poem-element) for the full list. Common ones:\n\n- `numbers` — show line numbers (defaults to every 5th line)\n- `wrap` — `true`, `indent`, or `indent-arrow`\n- `numbers-layout` — `list` or `grid`\n- `numbers-position` — `outside`\n\nBoolean attributes use the bare name (`numbers`); value attributes use `key=value` or `key=\"value with spaces\"`.\n\n### Slots\n\nTwo attributes are special-cased as slotted light-DOM content:\n\n- `title` — rendered into the `<slot name=\"title\">`\n- `author` — rendered into the `<slot name=\"author\">`\n\nThese appear above the poem inside the shadow DOM and can be styled from the host page using `[slot=\"title\"]` and `[slot=\"author\"]` selectors on `poem-element`.\n\n## How it works\n\nThe plugin walks the [mdast](https://github.com/syntax-tree/mdast) tree, finds `code` nodes with `lang === 'poem'`, parses the `meta` string into attributes and slots, then calls `renderPoemElement()` from `poem-element/ssr` to produce a complete HTML string with `<template shadowrootmode=\"open\">`. The result is inserted as a raw HTML node, replacing the original code block.\n\nBecause the output is Declarative Shadow DOM, the browser parses it into a real shadow root immediately during HTML parsing — no JavaScript required for the initial render. The `<poem-element>` custom element script can be loaded later (or never) and the page will still render correctly.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}