{"_id":"@ayo-run/mastodon-content","name":"@ayo-run/mastodon-content","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ayo-run/mastodon-content","version":"1.0.0","type":"module","description":"Progressively enhances a Mastodon status's content HTML: rewrites hashtag links and marks hashtag-only lines as tag bars","license":"MIT","homepage":"https://webcomponent.io","customElements":"custom-elements.json","module":"./dist/mastodon-content.js","types":"./dist/mastodon-content.d.ts","exports":{".":{"types":"./dist/mastodon-content.d.ts","import":"./dist/mastodon-content.js","require":"./dist/mastodon-content.umd.cjs","default":"./dist/mastodon-content.js"}},"scripts":{"test":"echo \"Warning: no test specified\"","dev":"vite","build":"vite build","build:lib":"vite build --config vite-lib.config.ts","analyze":"cem analyze","prepack":"npm run build:lib && npm run analyze"},"devDependencies":{"@custom-elements-manifest/analyzer":"^0.11.0","@types/node":"^26.1.1","vite":"^8.1.5","vite-plugin-dts":"^5.0.3"},"peerDependencies":{"web-component-base":"^6.1.5"},"_id":"@ayo-run/mastodon-content@1.0.0","gitHead":"25a28498f61293d06487df26b8a0a881dbda1cd6","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-9vJYi6CrubVO4t0ALxQIdnSIalaYBVEVjSJH15DWQMeUdXWJx87OD3Cpt0uStd2jmoWnysey0UxqgDSz8N2FfA==","shasum":"b057b037acc9f57d2ca6e454aa6b62524d0b28ba","tarball":"https://registry.npmjs.org/@ayo-run/mastodon-content/-/mastodon-content-1.0.0.tgz","fileCount":7,"unpackedSize":12539,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCI5pR2f5HFiLmxr5a69KreemlRwukl4ARjC/TdbDvt2wIgHbngqcO33kKkE5op6crLBs2qGaGeKG0OWkx06U2g/oY="}]},"_npmUser":{"name":"aayco","email":"ramon.aycojr+npm@gmail.com"},"directories":{},"maintainers":[{"name":"aayco","email":"ramon.aycojr+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mastodon-content_1.0.0_1786024299856_0.662522536362846"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-06T13:51:39.654Z","1.0.0":"2026-08-06T13:51:40.001Z","modified":"2026-08-06T13:51:40.301Z"},"maintainers":[{"name":"aayco","email":"ramon.aycojr+npm@gmail.com"}],"description":"Progressively enhances a Mastodon status's content HTML: rewrites hashtag links and marks hashtag-only lines as tag bars","homepage":"https://webcomponent.io","license":"MIT","readme":"# mastodon-content\n\nA custom element, built on [web-component-base](https://webcomponent.io),\nthat progressively enhances the `content` HTML of a Mastodon status:\n\n- Rewrites hashtag links so they would open in a local URL. Tag links\n  in the content HTML of a Mastodon status will point at a `tag-url` of\n  your choosing instead of the origin server. This `tag-url` attribute is optional:\n  leave it out and the link stays on the origin server's own tag page\n- Wraps a line consisting only of hashtag links (Mastodon's convention for a\n  trailing \"tag list\" botto row on a post) with a `tag-bar` class, and each of its\n  links with a `pill` class, so they can be styled as pills instead of inline\n  text links.\n\nSee it in action:\n- [Web Component demo](https://mastodon-content.webcomponent.io)\n- [Ayo's Threads](https://ayo.ayco.io/threads)\n\n```html\n<!-- rewrite hashtags to a local route -->\n<mastodon-content server=\"https://mastodon.social\" tag-url=\"/tags/\">\n  <!-- a Mastodon status's `content` field, rendered server-side -->\n</mastodon-content>\n\n<!-- or leave tag-url out to keep hashtags pointing at the server's own UI -->\n<mastodon-content server=\"https://mastodon.social\">\n  <!-- ... -->\n</mastodon-content>\n```\n\nIt has no template of its own — it enhances the light-DOM markup it's given\nrather than rendering — so give it real HTML up front (server-rendered, or\notherwise already in the DOM) for it to enhance on connect.\n\nThis assumes Mastodon's own hashtag markup convention. Other ActivityPub\nserver software (Pleroma, Akkoma, GoToSocial, ...) is not guaranteed to\nrender hashtags identically.\n\nScaffolded with `npm create wcb@latest`.\n\n## Background\n\nThis is a web component used at Ayo's [Threads](https://ayo.ayco.io/threads) page.\n\n## Commands\n\n- `npm run dev` — start the Vite dev server on the `index.html` demo page\n- `npm run build` — build the demo page\n- `npm run build:lib` — build the library: ESM + UMD bundles and `.d.ts`\n  types in `dist/`, with `web-component-base` left external (it is a\n  peerDependency)\n- `npm run analyze` — generate `custom-elements.json` from the component's\n  `static props`\n\n## Publishing\n\n`npm publish` (or `npm pack`) runs the `prepack` script, which rebuilds the\nlibrary and regenerates `custom-elements.json` — both ship inside the\npackage, and the `customElements` field in `package.json` is how Storybook,\neditors, and other tooling discover the manifest. In the repo itself the\nmanifest stays gitignored; it is a build artifact.\n\nSee the [CEM plugin guide](https://webcomponent.io/cem-plugin/) for setting\nit up with Storybook and code editors.\n\n---\n\n_Just keep building._\n","readmeFilename":"README.md","_rev":"1-a6c5e1a8995a5ae34a049bfc21fe9cbd"}