{"id":14156099,"url":"https://github.com/zerodevx/zero-md","last_synced_at":"2025-05-14T20:06:27.069Z","repository":{"id":44463057,"uuid":"41670958","full_name":"zerodevx/zero-md","owner":"zerodevx","description":"Ridiculously simple zero-config markdown displayer","archived":false,"fork":false,"pushed_at":"2025-01-28T07:30:40.000Z","size":1340,"stargazers_count":466,"open_issues_count":4,"forks_count":49,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-06T13:04:14.551Z","etag":null,"topics":["customelements","highlightjs","katex","markdown-to-html","markedjs","mermaid","webcomponents"],"latest_commit_sha":null,"homepage":"https://zerodevx.github.io/zero-md/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zerodevx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"zerodevx"}},"created_at":"2015-08-31T11:04:34.000Z","updated_at":"2025-04-05T18:06:02.000Z","dependencies_parsed_at":"2024-03-14T14:28:12.572Z","dependency_job_id":"31bf72dc-e2a1-49f7-9f0e-070c66a9d908","html_url":"https://github.com/zerodevx/zero-md","commit_stats":{"total_commits":253,"total_committers":5,"mean_commits":50.6,"dds":0.02371541501976282,"last_synced_commit":"31ab2348c61c4b5c2b975df0ab0e47c1843bfc7c"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodevx%2Fzero-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodevx%2Fzero-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodevx%2Fzero-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodevx%2Fzero-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerodevx","download_url":"https://codeload.github.com/zerodevx/zero-md/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741197,"owners_count":21154252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["customelements","highlightjs","katex","markdown-to-html","markedjs","mermaid","webcomponents"],"created_at":"2024-08-17T08:05:13.084Z","updated_at":"2025-04-13T15:58:21.421Z","avatar_url":"https://github.com/zerodevx.png","language":"JavaScript","readme":"![version](https://img.shields.io/npm/v/zero-md) ![license](https://img.shields.io/npm/l/zero-md)\n![stars](https://img.shields.io/github/stars/zerodevx/zero-md?style=flat\u0026color=yellow)\n![downloads](https://img.shields.io/jsdelivr/npm/hm/zero-md)\n![old](\u003chttps://img.shields.io/jsdelivr/gh/hm/zerodevx/zero-md?label=jsdelivr(old)\u0026color=lightgray\u003e)\n\n# \u0026lt;zero-md\u0026gt;\n\n\u003e Ridiculously simple zero-config markdown displayer\n\nA vanilla markdown-to-html web component based on\n[Custom Elements V1 specs](https://www.w3.org/TR/custom-elements/) to load and display an external\nMD file. Under the hood, it uses [`marked`](https://github.com/markedjs/marked) for super-fast\nmarkdown transformation, and [`highlight.js`](https://github.com/highlightjs/highlight.js) for\nlightning-quick syntax highlighting - automagically rendering into its own self-contained shadow DOM\ncontainer, while encapsulating implementation details into one embarrassingly easy-to-use package.\n\nFeaturing:\n\n- [x] Math rendering via [`KaTeX`](https://github.com/KaTeX/KaTeX)\n- [x] [`Mermaid`](https://github.com/mermaid-js/mermaid) diagrams\n- [x] Syntax highlighting via [`highlight.js`](https://github.com/highlightjs/highlight.js)\n- [x] Language detection for un-hinted code blocks\n- [x] Hash-link scroll handling\n- [x] FOUC prevention\n- [x] Auto re-render on input changes\n- [x] Light and dark themes\n- [x] Spec-compliant extensibility\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Your markdown file(s) must be hosted! Browsers restrict local file access in javascript because\n\u003e _security_. Standard [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) rules apply.\n\nRead the docs: https://zerodevx.github.io/zero-md/\n\n\u003e [!NOTE]\n\u003e\n\u003e This is the V3 branch. If you're looking for the older version, see the\n\u003e [V2 branch](https://github.com/zerodevx/zero-md/tree/v2). If you're upgrading from V2, read the\n\u003e [migration guide](docs/migration.md).\n\n## Installation\n\n### Load via CDN (recommended)\n\n`zero-md` is designed to be zero-config with good defaults. For most use-cases, just importing the\nscript from CDN and consuming the component directly should suffice.\n\n```html\n\u003chead\u003e\n  ...\n  \u003c!-- Import element definition and auto-register --\u003e\n  \u003cscript type=\"module\" src=\"https://cdn.jsdelivr.net/npm/zero-md@3?register\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  ...\n  \u003c!-- Profit! --\u003e\n  \u003czero-md src=\"example.md\"\u003e\u003c/zero-md\u003e\n\u003c/body\u003e\n```\n\n### Use in web projects\n\nInstall the package.\n\n```\n$ npm i zero-md\n```\n\nImport the class, register the element, and use anywhere.\n\n```js\n// Import the element definition\nimport ZeroMd from 'zero-md'\n\n// Register the custom element\ncustomElements.define('zero-md', ZeroMd)\n\n// Render anywhere\napp.render(`\u003czero-md src=${src}\u003e\u003c/zero-md\u003e`, target)\n```\n\n## Basic usage\n\n\u003c!-- prettier-ignore --\u003e\n```html\n\u003c!-- Simply set the `src` attribute and win --\u003e\n\u003czero-md src=\"https://example.com/markdown.md\"\u003e\u003c/zero-md\u003e\n\n\u003c!-- Or write markdown inline --\u003e\n\u003czero-md\u003e\n  \u003c!-- Write your markdown inside a `\u003cscript type=\"text/markdown\"\u003e` tag --\u003e\n  \u003cscript type=\"text/markdown\"\u003e\n# **This** is my [markdown](https://example.com)\n  \u003c/script\u003e\n\u003c/zero-md\u003e\n\n\u003c!-- Or update the style --\u003e\n\u003czero-md src=\"https://example.com/markdown.md\"\u003e\n  \u003c!-- Wrap `style` tags inside `template` --\u003e\n  \u003ctemplate data-append\u003e\n    \u003cstyle\u003e\n      p { color: red; }\n    \u003c/style\u003e\n  \u003c/template\u003e\n\u003c/zero-md\u003e\n```\n\nRead the docs: https://zerodevx.github.io/zero-md/\n\n## Contributing\n\n### Noticed a bug? Have a feature request?\n\nOpen a new [issue](https://github.com/zerodevx/zero-md/issues) in the Github repo, or raise a\n[PR](https://github.com/zerodevx/zero-md/pulls) - I'd be stoked to hear from you!\n\n### Development\n\nStandard Github\n[contribution workflow](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project)\napplies.\n\n#### Run the dev server\n\n```\n$ npm run dev\n```\n\nWe use [`Vite`](https://github.com/vitejs/vite) for tooling. Point your browser to\n`http://localhost:5173` and you should see the test page. Library code in `src/lib/`.\n\n#### Testing\n\n```\n$ npm test\n```\n\nTests via [Playwright](https://github.com/microsoft/playwright). Test specs in `src/index.spec.js`.\nBe sure tests pass in your PR.\n\n### Updating docs\n\nDocumentation is in the `docs/` folder. Submit PRs onto the `.md` files directly and changes will be\nautomatically published upon merge. Documentation website uses\n[`zero-md-docs`](https://github.com/zerodevx/zero-md-docs) to instantly publish markdown from the\nGithub `docs/` folder.\n\n## Changelog\n\nCheck out the [releases](https://github.com/zerodevx/zero-md/releases) page.\n\n## License\n\nISC\n\n## Acknowledgement\n\nA big thank you to the project contributors and sponsors! :pray:\n\n### Sponsors\n\n\u003c!-- prettier-ignore --\u003e\n\u003ckbd\u003e[\u003cimg src=\"https://github.com/RootofalleviI.png\" width=\"60px;\"/\u003e](https://github.com/RootofalleviI)\u003c/kbd\u003e\u003ckbd\u003e[\u003cimg src=\"https://github.com/alifeee.png\" width=\"60px;\"/\u003e](https://github.com/alifeee)\u003c/kbd\u003e\n","funding_links":["https://github.com/sponsors/zerodevx"],"categories":["others","JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodevx%2Fzero-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerodevx%2Fzero-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodevx%2Fzero-md/lists"}