{"versions":{"0.1.0":{"name":"@create-markdown/preview","version":"0.1.0","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","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","mermaid","web-component","typescript"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","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/github-dark.css":"./dist/themes/github-dark.css","./themes/minimal.css":"./dist/themes/minimal.css"},"scripts":{"build":"bun run build:esm && bun run build:cjs && bun run build:types && bun run build:css","build:esm":"bun build ./src/index.ts --outfile ./dist/index.js --format esm --external @create-markdown/core --external shiki --external mermaid","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external @create-markdown/core --external shiki --external mermaid","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","dev":"bun run --watch src/index.ts","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"dependencies":{"@create-markdown/core":"workspace:*"},"devDependencies":{"typescript":"^5.3.0","vitest":"^2.1.0"},"peerDependencies":{"shiki":">=1.0.0","mermaid":">=10.0.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true}},"engines":{"node":">=20.0.0"},"_id":"@create-markdown/preview@0.1.0","gitHead":"62e688b8f8cab05c06fb62683a6de0ecfa34e462","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-xRDQeneCg/QL+l4z5IhuXAbjyMSuKKdUMmlN7B6vyuJ/UG6lJ1z1oma8oVTzSNAoYxPvEGzHrsJtmFxIgF5Chg==","shasum":"900dea39fae752b9ad048129596a8a53fcbd3948","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@create-markdown/preview/-/preview-0.1.0.tgz","fileCount":21,"unpackedSize":69412,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFvF+q4v2pJq+UZwq5YqgkVojTviBZdewLYcB8x8AKvRAiEA30VMaKpb6nGripU/WwwQytTJDFvSC2t79ROZsN8PzuU="}],"size":16648},"_npmUser":{"name":"anonymous","email":"bunsthedev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bunsthedev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preview_0.1.0_1769560336191_0.9651539499090545"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-28T00:32:16.333Z","publish_time":1769560336333,"_source_registry_name":"default","contributors":[]},"0.2.0":{"name":"@create-markdown/preview","version":"0.2.0","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","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","mermaid","web-component","typescript"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","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/github-dark.css":"./dist/themes/github-dark.css","./themes/minimal.css":"./dist/themes/minimal.css"},"scripts":{"build":"bun run build:esm && bun run build:cjs && bun run build:types && bun run build:css","build:esm":"bun build ./src/index.ts --outfile ./dist/index.js --format esm --external @create-markdown/core --external shiki --external mermaid","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external @create-markdown/core --external shiki --external mermaid","build:types":"tsc --emitDeclarationOnly --declaration --outDir dist","build:css":"mkdir -p dist/themes && cp src/themes/*.css dist/themes/","dev":"bun run --watch src/index.ts","clean":"rm -rf dist","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest"},"devDependencies":{"typescript":"^5.3.0","vitest":"^2.1.0"},"peerDependencies":{"@create-markdown/core":">=0.2.0","shiki":">=1.0.0","mermaid":">=10.0.0"},"peerDependenciesMeta":{"shiki":{"optional":true},"mermaid":{"optional":true}},"engines":{"node":">=20.0.0"},"gitHead":"55871c863399a74cdf06376541be8908275612b9","_id":"@create-markdown/preview@0.2.0","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-62fOev7Ebe4JqbYIgV6Fcj7sgEKGEB/ZsX3/VIjXEQliCwu9JWCAHih+Yim6m2G1t1Q2u1gKpNXt0eP/12RV3g==","shasum":"7bd979550d260d261da46ddb3577c59f4e1dde15","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@create-markdown/preview/-/preview-0.2.0.tgz","fileCount":21,"unpackedSize":68265,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIECMbE4exwvKIev9UBsjfF2ZomWO93bLPvrLtYxvs/7+AiBZ0NbzngX8vxFxRRNuXreMwV80QNs7Kyw+PrnnCiwQ0A=="}],"size":12914},"_npmUser":{"name":"anonymous","email":"bunsthedev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bunsthedev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preview_0.2.0_1771708160504_0.609386858422085"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-21T21:09:20.670Z","publish_time":1771708160670,"_source_registry_name":"default","contributors":[]},"2.0.0":{"name":"@create-markdown/preview","version":"2.0.0","description":"Framework-agnostic HTML rendering for @create-markdown with syntax highlighting and diagrams","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","mermaid","web-component","typescript"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","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/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":{"typescript":"^5.3.0","vitest":"^2.1.0"},"peerDependencies":{"@create-markdown/core":">=2.0.0","shiki":">=1.0.0","mermaid":">=10.0.0"},"peerDependenciesMeta":{"@create-markdown/core":{"optional":true},"shiki":{"optional":true},"mermaid":{"optional":true}},"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 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.0","_integrity":"sha512-3WTGCrCOVBy9wH2X82Oa2ZHJ+eiEqu8AlucckenWVtFSbzRKzkxgci0BRw7IDvsOsTUEMxS9Ltc9/hSUHkdidA==","_resolved":"/private/var/folders/gn/2__pq0pj3fzc061mmrp1lxz00000gn/T/c34831b6d594849e5e27116750be8085/create-markdown-preview-2.0.0.tgz","_from":"file:create-markdown-preview-2.0.0.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.12.0","dist":{"integrity":"sha512-3WTGCrCOVBy9wH2X82Oa2ZHJ+eiEqu8AlucckenWVtFSbzRKzkxgci0BRw7IDvsOsTUEMxS9Ltc9/hSUHkdidA==","shasum":"aba6f46a437c38df4ed59b8bca10eb4d5acef70c","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@create-markdown/preview/-/preview-2.0.0.tgz","fileCount":37,"unpackedSize":441381,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDnafDlgu/CnGg/Oqitd2KyQl1i6iUJ9poXe1loHnW+EAiAO1qzPFxuDB097kmZCpKlIPgaaA48UoUrgih+ucfJE0w=="}],"size":72255},"_npmUser":{"name":"anonymous","email":"bunsthedev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bunsthedev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preview_2.0.0_1774324106685_0.12253012254654783"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-03-24T03:48:26.852Z","publish_time":1774324106852,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.0.0"},"name":"@create-markdown/preview","time":{"created":"2026-02-04T08:23:36.287Z","modified":"2026-03-24T03:48:42.792Z","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"},"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 mermaid\n```\n\n## Quick Start\n\n### Basic HTML Rendering\n\n```typescript\nimport { markdownToHTML } from '@create-markdown/preview';\n\nconst html = markdownToHTML(`\n# Hello World\n\nThis is **bold** and *italic* text.\n`);\n\ndocument.getElementById('preview').innerHTML = html;\n```\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, mermaidPlugin } from '@create-markdown/preview';\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: [mermaidPlugin({ theme: 'default' })],\n});\n```\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, mermaidPlugin } from '@create-markdown/preview';\n\nregisterPreviewElement({\n  plugins: [\n    shikiPlugin(),\n    mermaidPlugin(),\n  ],\n});\n```\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\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;         // Sanitize HTML output\n  plugins?: PreviewPlugin[];  // Plugins for enhanced rendering\n}\n```\n\n## License\n\nMIT","users":{}}