{"_id":"@create-markdown/preview","_rev":"6-2b5d0f44eff5d524629394078520f81b","name":"@create-markdown/preview","dist-tags":{"latest":"2.0.3"},"versions":{"0.1.0":{"name":"@create-markdown/preview","version":"0.1.0","keywords":["markdown","preview","html","shiki","mermaid","web-component","typescript"],"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","_id":"@create-markdown/preview@0.1.0","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"dist":{"shasum":"900dea39fae752b9ad048129596a8a53fcbd3948","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-0.1.0.tgz","fileCount":21,"integrity":"sha512-xRDQeneCg/QL+l4z5IhuXAbjyMSuKKdUMmlN7B6vyuJ/UG6lJ1z1oma8oVTzSNAoYxPvEGzHrsJtmFxIgF5Chg==","signatures":[{"sig":"MEUCIFvF+q4v2pJq+UZwq5YqgkVojTviBZdewLYcB8x8AKvRAiEA30VMaKpb6nGripU/WwwQytTJDFvSC2t79ROZsN8PzuU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69412},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/github-dark.css":"./dist/themes/github-dark.css"},"gitHead":"62e688b8f8cab05c06fb62683a6de0ecfa34e462","scripts":{"dev":"bun run --watch src/index.ts","test":"vitest run","build":"bun run build:esm && bun run build:cjs && bun run build:types && bun run build:css","clean":"rm -rf dist","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external @create-markdown/core --external shiki --external mermaid","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","build:esm":"bun build ./src/index.ts --outfile ./dist/index.js --format esm --external @create-markdown/core --external shiki --external mermaid","typecheck":"tsc --noEmit","test:watch":"vitest","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist"},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"repository":{"url":"git+https://github.com/BunsDev/create-markdown.git","type":"git","directory":"packages/preview"},"_npmVersion":"10.9.4","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@create-markdown/core":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.3.0"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preview_0.1.0_1769560336191_0.9651539499090545","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@create-markdown/preview","version":"0.2.0","keywords":["markdown","preview","html","shiki","mermaid","web-component","typescript"],"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","_id":"@create-markdown/preview@0.2.0","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"dist":{"shasum":"7bd979550d260d261da46ddb3577c59f4e1dde15","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-0.2.0.tgz","fileCount":21,"integrity":"sha512-62fOev7Ebe4JqbYIgV6Fcj7sgEKGEB/ZsX3/VIjXEQliCwu9JWCAHih+Yim6m2G1t1Q2u1gKpNXt0eP/12RV3g==","signatures":[{"sig":"MEQCIECMbE4exwvKIev9UBsjfF2ZomWO93bLPvrLtYxvs/7+AiBZ0NbzngX8vxFxRRNuXreMwV80QNs7Kyw+PrnnCiwQ0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68265},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/github-dark.css":"./dist/themes/github-dark.css"},"gitHead":"55871c863399a74cdf06376541be8908275612b9","scripts":{"dev":"bun run --watch src/index.ts","test":"vitest run","build":"bun run build:esm && bun run build:cjs && bun run build:types && bun run build:css","clean":"rm -rf dist","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external @create-markdown/core --external shiki --external mermaid","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","build:esm":"bun build ./src/index.ts --outfile ./dist/index.js --format esm --external @create-markdown/core --external shiki --external mermaid","typecheck":"tsc --noEmit","test:watch":"vitest","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist"},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"repository":{"url":"git+https://github.com/BunsDev/create-markdown.git","type":"git","directory":"packages/preview"},"_npmVersion":"11.6.2","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.3.0"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0","@create-markdown/core":">=0.2.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preview_0.2.0_1771708160504_0.609386858422085","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@create-markdown/preview","version":"2.0.0","keywords":["markdown","preview","html","shiki","mermaid","web-component","typescript"],"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","_id":"@create-markdown/preview@2.0.0","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"dist":{"shasum":"aba6f46a437c38df4ed59b8bca10eb4d5acef70c","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-2.0.0.tgz","fileCount":37,"integrity":"sha512-3WTGCrCOVBy9wH2X82Oa2ZHJ+eiEqu8AlucckenWVtFSbzRKzkxgci0BRw7IDvsOsTUEMxS9Ltc9/hSUHkdidA==","signatures":[{"sig":"MEQCIDnafDlgu/CnGg/Oqitd2KyQl1i6iUJ9poXe1loHnW+EAiAO1qzPFxuDB097kmZCpKlIPgaaA48UoUrgih+ucfJE0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":441381},"main":"./dist/index.cjs","type":"module","_from":"file:create-markdown-preview-2.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./themes":{"import":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.js"},"require":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.cjs"}},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/system.css":"./dist/themes/system.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/github-dark.css":"./dist/themes/github-dark.css"},"scripts":{"dev":"pnpm run build:theme-strings && tsup --config tsup.config.ts --watch","test":"vitest run","build":"pnpm run build:theme-strings && pnpm run build:js && pnpm run build:types && pnpm run build:css","clean":"rm -rf dist","build:js":"tsup --config tsup.config.ts","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","typecheck":"tsc --noEmit","test:watch":"vitest","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:theme-strings":"tsx scripts/generate-css-strings.ts"},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"_resolved":"/private/var/folders/gn/2__pq0pj3fzc061mmrp1lxz00000gn/T/c34831b6d594849e5e27116750be8085/create-markdown-preview-2.0.0.tgz","_integrity":"sha512-3WTGCrCOVBy9wH2X82Oa2ZHJ+eiEqu8AlucckenWVtFSbzRKzkxgci0BRw7IDvsOsTUEMxS9Ltc9/hSUHkdidA==","repository":{"url":"git+https://github.com/BunsDev/create-markdown.git","type":"git","directory":"packages/preview"},"_npmVersion":"11.12.0","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.3.0"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0","@create-markdown/core":">=2.0.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true},"@create-markdown/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preview_2.0.0_1774324106685_0.12253012254654783","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@create-markdown/preview","version":"2.0.1","keywords":["markdown","preview","html","shiki","mermaid","web-component","typescript"],"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","_id":"@create-markdown/preview@2.0.1","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"dist":{"shasum":"7c0d379f6a506cabdbccbdece74bcf4e1b38820e","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-2.0.1.tgz","fileCount":37,"integrity":"sha512-3HKizzym27NUdGFPaAYhkrSvdKHxIaU0DGDL6kChNATPwNCoH430UXa3C7/SU8eRx25XhhcGPoYlKSTV/VHXQg==","signatures":[{"sig":"MEUCIQCktdAsTc/n1PS6KCiH2e0MHbAImXq5E/NCBEpnj7PFpgIgIaFMVS/+KwL1cUn6Z2EhzHWNP3D9bCHnynhSgzZx0ak=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":442052},"main":"./dist/index.cjs","type":"module","_from":"file:create-markdown-preview-2.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.cjs"}},"./themes":{"import":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.js"},"require":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.cjs"}},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/system.css":"./dist/themes/system.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/github-dark.css":"./dist/themes/github-dark.css"},"scripts":{"dev":"pnpm run build:theme-strings && tsup --config tsup.config.ts --watch","test":"vitest run","build":"pnpm run build:theme-strings && pnpm run build:js && pnpm run build:types && pnpm run build:css","clean":"rm -rf dist","build:js":"tsup --config tsup.config.ts","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","typecheck":"tsc --noEmit","test:watch":"vitest","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:theme-strings":"tsx scripts/generate-css-strings.ts"},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"_resolved":"/tmp/f451458734efba74547103537760df58/create-markdown-preview-2.0.1.tgz","_integrity":"sha512-3HKizzym27NUdGFPaAYhkrSvdKHxIaU0DGDL6kChNATPwNCoH430UXa3C7/SU8eRx25XhhcGPoYlKSTV/VHXQg==","repository":{"url":"git+https://github.com/BunsDev/create-markdown.git","type":"git","directory":"packages/preview"},"_npmVersion":"10.8.2","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.11","vitest":"^4.1.2","typescript":"^5.3.0"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0","@create-markdown/core":">=2.0.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true},"@create-markdown/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preview_2.0.1_1775396882518_0.03831462465091362","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@create-markdown/preview","version":"2.0.2","keywords":["markdown","preview","html","shiki","mermaid","web-component","typescript"],"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","_id":"@create-markdown/preview@2.0.2","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"dist":{"shasum":"f08f9da0b4154875f22d19c377dbb39f61bc1e23","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-2.0.2.tgz","fileCount":37,"integrity":"sha512-ty1mp7qXVI0Bap8M0jiDiJsAqZkP3oaYNp0JX0wiY4K+KfWgK4IqeB8R2W+9vLpRxzxhX6Rggf5Qj2Sv5p75Eg==","signatures":[{"sig":"MEYCIQC8zqbXWaQWjJ5IMm51MiRID0ucAVrXIMlbfBvgGa729wIhALpVVYLGPxd/kWAdS5+Nik6EuhBKESIYbzoFE0x9qNj6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":441993},"main":"./dist/index.cjs","type":"module","_from":"file:create-markdown-preview-2.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./themes":{"import":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.js"},"require":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.cjs"}},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/system.css":"./dist/themes/system.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/github-dark.css":"./dist/themes/github-dark.css"},"scripts":{"dev":"pnpm run build:theme-strings && tsup --config tsup.config.ts --watch","test":"vitest run","build":"pnpm run build:theme-strings && pnpm run build:js && pnpm run build:types && pnpm run build:css","clean":"rm -rf dist","build:js":"tsup --config tsup.config.ts","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","typecheck":"tsc --noEmit","test:watch":"vitest","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:theme-strings":"tsx scripts/generate-css-strings.ts"},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"_resolved":"/tmp/822c30cd09ae26d287e75b39f62ade58/create-markdown-preview-2.0.2.tgz","_integrity":"sha512-ty1mp7qXVI0Bap8M0jiDiJsAqZkP3oaYNp0JX0wiY4K+KfWgK4IqeB8R2W+9vLpRxzxhX6Rggf5Qj2Sv5p75Eg==","repository":{"url":"git+https://github.com/BunsDev/create-markdown.git","type":"git","directory":"packages/preview"},"_npmVersion":"10.8.2","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.11","vitest":"^4.1.2","typescript":"^5.3.0","@create-markdown/core":"^2.0.2"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0","@create-markdown/core":">=2.0.2"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true},"@create-markdown/core":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preview_2.0.2_1775434962343_0.8845341716290829","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@create-markdown/preview","version":"2.0.3","description":"Framework-agnostic HTML rendering for @create-markdown with optional syntax highlighting","author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/BunsDev/create-markdown.git","directory":"packages/preview"},"homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"keywords":["markdown","preview","html","shiki","web-component","typescript"],"type":"module","sideEffects":["**/*.css"],"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./web-component":{"import":{"types":"./dist/web-component.d.ts","default":"./dist/web-component.js"}},"./themes/github.css":"./dist/themes/github.css","./themes/github-dark.css":"./dist/themes/github-dark.css","./themes/minimal.css":"./dist/themes/minimal.css","./themes/system.css":"./dist/themes/system.css","./themes":{"import":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.js"},"require":{"types":"./dist/themes/css-strings.d.ts","default":"./dist/themes/css-strings.cjs"}}},"devDependencies":{"shiki":"^4.0.2","typescript":"^6.0.2","vite":"7.1.11","vitest":"^4.1.2","@create-markdown/core":"^2.0.3"},"peerDependencies":{"@create-markdown/core":">=2.0.3","shiki":">=1.0.0"},"peerDependenciesMeta":{"@create-markdown/core":{"optional":true},"shiki":{"optional":true}},"publishConfig":{"access":"public"},"engines":{"node":">=20.0.0"},"scripts":{"build":"pnpm run build:theme-strings && pnpm run build:js && pnpm run build:types && pnpm run build:css","build:theme-strings":"tsx scripts/generate-css-strings.ts","build:js":"tsup --config tsup.config.ts","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:css":"mkdir -p dist/themes && cp -f src/themes/*.css dist/themes/","dev":"pnpm run build:theme-strings && tsup --config tsup.config.ts --watch","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"_id":"@create-markdown/preview@2.0.3","_integrity":"sha512-Vrp8DyuiouryZ3E4NQ7tBgoYQdoekd0+DzN64mZ48QYCw3V+MCb/H2q10SW8KC8XPr931XOMDvKX4I83qpQh3g==","_resolved":"/private/var/folders/sz/mtdd9q6j3z5_8jq7xsm876600000gn/T/501e64b72914a5c63926a5154abe1c43/create-markdown-preview-2.0.3.tgz","_from":"file:create-markdown-preview-2.0.3.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-Vrp8DyuiouryZ3E4NQ7tBgoYQdoekd0+DzN64mZ48QYCw3V+MCb/H2q10SW8KC8XPr931XOMDvKX4I83qpQh3g==","shasum":"e871e0020a896501ff734165f3a05df962a733e8","tarball":"https://registry.npmjs.org/@create-markdown/preview/-/preview-2.0.3.tgz","fileCount":35,"unpackedSize":415666,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID17n2PRV1GFY8HcJMYshLN2xCUUe5QFgdB2Iy1/TStbAiBmSG3qfdBtO7W9f3tNFtgF54th5VXpFHkzxB/rJL3LXA=="}]},"_npmUser":{"name":"bunsdev","email":"bunsthedev@gmail.com"},"directories":{},"maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preview_2.0.3_1775753593457_0.43115869276824315"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-28T00:32:16.104Z","modified":"2026-04-09T16:53:13.748Z","0.1.0":"2026-01-28T00:32:16.333Z","0.2.0":"2026-02-21T21:09:20.670Z","2.0.0":"2026-03-24T03:48:26.852Z","2.0.1":"2026-04-05T13:48:02.678Z","2.0.2":"2026-04-06T00:22:42.609Z","2.0.3":"2026-04-09T16:53:13.638Z"},"bugs":{"url":"https://github.com/BunsDev/create-markdown/issues"},"author":{"name":"Val Alexander","email":"val@viewdue.ai"},"license":"MIT","homepage":"https://github.com/BunsDev/create-markdown/tree/main/packages/preview","keywords":["markdown","preview","html","shiki","web-component","typescript"],"repository":{"type":"git","url":"git+https://github.com/BunsDev/create-markdown.git","directory":"packages/preview"},"description":"Framework-agnostic HTML rendering for @create-markdown with optional syntax highlighting","maintainers":[{"name":"bunsdev","email":"bunsthedev@gmail.com"}],"readme":"# @create-markdown/preview\n\nFramework-agnostic HTML rendering for @create-markdown with syntax highlighting (Shiki) and diagram support (Mermaid).\n\n## Installation\n\n```bash\n# Using pnpm\npnpm add @create-markdown/preview\n\n# Using npm\nnpm install @create-markdown/preview\n\n# Optional: Install plugins\npnpm add shiki\n```\n\n## Quick Start\n\n### Basic HTML Rendering\n\n```typescript\nimport { markdownToHTML } from '@create-markdown/preview';\nimport DOMPurify from 'dompurify';\n\nconst html = await markdownToHTML(`\n# Hello World\n\nThis is **bold** and *italic* text.\n`);\n\nconst preview = document.getElementById('preview');\n\nif (preview) {\n  preview.innerHTML = DOMPurify.sanitize(html, { USE_PROFILES: { html: true } });\n}\n```\n\nSanitize untrusted content before rendering it. Direct DOM assignment is only appropriate when you fully trust the markdown source.\n\n### With Syntax Highlighting (Shiki)\n\n```typescript\nimport { renderAsync, shikiPlugin } from '@create-markdown/preview';\nimport { parse } from '@create-markdown/core';\n\nconst blocks = parse(`\n\\`\\`\\`typescript\nconst greeting = \"Hello, World!\";\nconsole.log(greeting);\n\\`\\`\\`\n`);\n\nconst html = await renderAsync(blocks, {\n  plugins: [shikiPlugin({ theme: 'github-dark' })],\n});\n```\n\n### With Mermaid Diagrams\n\n```typescript\nimport { renderAsync } from '@create-markdown/preview';\nimport { mermaidPlugin } from '@create-markdown/preview-mermaid';\nimport { parse } from '@create-markdown/core';\n\nconst blocks = parse(`\n\\`\\`\\`mermaid\nflowchart LR\n  A[Start] --> B[Process]\n  B --> C[End]\n\\`\\`\\`\n`);\n\nconst html = await renderAsync(blocks, {\n  plugins: [\n    mermaidPlugin({\n      theme: 'default',\n      config: { securityLevel: 'strict' },\n    }),\n  ],\n});\n```\n\nInstall Mermaid support only when you need it:\n\n```bash\npnpm add @create-markdown/preview-mermaid mermaid\n```\n\nUse Mermaid's stricter security mode when diagram text can come from users. Only opt into looser Mermaid settings for fully trusted content.\n\n### Web Component\n\n```html\n<script type=\"module\">\n  import { registerPreviewElement } from '@create-markdown/preview';\n  registerPreviewElement();\n</script>\n\n<markdown-preview theme=\"github\">\n# Hello World\n\nThis is rendered as HTML automatically!\n</markdown-preview>\n```\n\nWith plugins:\n\n```typescript\nimport { registerPreviewElement, shikiPlugin } from '@create-markdown/preview';\nimport { mermaidPlugin } from '@create-markdown/preview-mermaid';\n\nregisterPreviewElement({\n  plugins: [\n    shikiPlugin(),\n    mermaidPlugin(),\n  ],\n});\n```\n\nThe web component renders trusted content by default, so sanitize user-provided markdown before passing it to the element.\n\n## API\n\n### `blocksToHTML(blocks, options?)`\n\nConverts blocks to HTML string synchronously.\n\n### `markdownToHTML(markdown, options?)`\n\nConverts markdown string to HTML.\n\n### `renderAsync(blocks, options?)`\n\nAsync version that initializes plugins before rendering.\n\n### Plugins\n\n- `shikiPlugin(options?)` - Syntax highlighting with Shiki\n- `mermaidPlugin(options?)` - Mermaid diagram rendering via `@create-markdown/preview-mermaid`\n\n### Themes\n\nCSS themes are available at:\n\n- `@create-markdown/preview/themes/github.css`\n- `@create-markdown/preview/themes/github-dark.css`\n- `@create-markdown/preview/themes/minimal.css`\n\n## Options\n\n```typescript\ninterface PreviewOptions {\n  classPrefix?: string;       // CSS class prefix (default: 'cm-')\n  theme?: string;             // Theme name\n  linkTarget?: '_blank' | '_self';\n  sanitize?: boolean | ((html: string) => string);\n  plugins?: PreviewPlugin[];  // Plugins for enhanced rendering\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}