{"_id":"@a24z/markdown-utils","_rev":"4-f0438d94445dc4a1d5a94b00463409a0","name":"@a24z/markdown-utils","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@a24z/markdown-utils","version":"0.1.0","keywords":["markdown","parser","presentation","slides","utilities"],"author":{"name":"a24z Team"},"license":"MIT","_id":"@a24z/markdown-utils@0.1.0","maintainers":[{"name":"principal-ai","email":"principle@principlemd.com"}],"homepage":"https://github.com/a24z-ai/themed-markdown#readme","bugs":{"url":"https://github.com/a24z-ai/themed-markdown/issues"},"dist":{"shasum":"7b115fa0ff010a8fe33fd88776c677bb9a4c598e","tarball":"https://registry.npmjs.org/@a24z/markdown-utils/-/markdown-utils-0.1.0.tgz","fileCount":22,"integrity":"sha512-BZv4YeFWbVqXQ7Uj1X9aHV6PeFu0WZLz/cT6KzI3qJoLgQQmGon4RX3L7kmj5Oga3Tv7zUrGoiB+rRLXY1ntyQ==","signatures":[{"sig":"MEUCIQCe7IGuiUMm+NuZGbKB55vaLF5xOE/nE9CL2XpooRdeOwIgTltOCtYFAWDPth0eE86bZiKGk5G6vDZ42djHkowE040=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49871},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"9a5cead76a4e7a2f389d9bca4d9ecc6184eb8967","scripts":{"dev":"bun run build --watch","test":"bun test","build":"bun run clean && bun run build:esm && bun run build:cjs && bun run build:types","clean":"rm -rf dist","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.js --format cjs","build:esm":"bun build ./src/index.ts --outfile ./dist/index.mjs --format esm","build:types":"tsc --emitDeclarationOnly --declaration --declarationMap"},"_npmUser":{"name":"principal-ai","email":"principle@principlemd.com"},"repository":{"url":"git+https://github.com/a24z-ai/themed-markdown.git","type":"git","directory":"packages/markdown-utils"},"_npmVersion":"10.9.2","description":"Core markdown parsing and presentation utilities without React dependencies","directories":{},"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/markdown-utils_0.1.0_1757456412294_0.9906716363095829","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@a24z/markdown-utils","version":"0.1.1","keywords":["markdown","parser","presentation","slides","utilities"],"author":{"name":"a24z Team"},"license":"MIT","_id":"@a24z/markdown-utils@0.1.1","maintainers":[{"name":"principal-ai","email":"principle@principlemd.com"}],"homepage":"https://github.com/a24z-ai/themed-markdown#readme","bugs":{"url":"https://github.com/a24z-ai/themed-markdown/issues"},"dist":{"shasum":"1e8aeda9b5ae402f0cbdb7df40834290dcbba7a9","tarball":"https://registry.npmjs.org/@a24z/markdown-utils/-/markdown-utils-0.1.1.tgz","fileCount":22,"integrity":"sha512-gEtyT0nayqBYioWbK0kxBCJK0CmbT4WkCqa+Bmd4piPbou8S6gYQ+Y+tOUmd8bti1+4AjGNijmrAbIu/avAe1Q==","signatures":[{"sig":"MEYCIQDMGbp3iVNTaCrtsTsW4vSvmxdlrt6LhKbuZ+tFSHOrwgIhAPykh5T455frT4o8yfIVHEU01cOsqPUDd8z/GsJrL/0+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49124},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"87d7e679535ec7db8f0b0a5efb4ad739e18d4016","scripts":{"dev":"bun run build --watch","test":"bun test","build":"bun run clean && bun run build:esm && bun run build:cjs && bun run build:types","clean":"rm -rf dist","build:cjs":"bun build ./src/index.ts --outfile ./dist/index.js --format cjs","build:esm":"bun build ./src/index.ts --outfile ./dist/index.mjs --format esm","build:types":"tsc --emitDeclarationOnly --declaration --declarationMap"},"_npmUser":{"name":"principal-ai","email":"principle@principlemd.com"},"repository":{"url":"git+https://github.com/a24z-ai/themed-markdown.git","type":"git","directory":"packages/markdown-utils"},"_npmVersion":"10.9.2","description":"Core markdown parsing and presentation utilities without React dependencies","directories":{},"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/markdown-utils_0.1.1_1757478078678_0.07758628513746157","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@a24z/markdown-utils","version":"0.1.2","keywords":["markdown","parser","presentation","slides","utilities"],"author":{"name":"a24z Team"},"license":"MIT","_id":"@a24z/markdown-utils@0.1.2","maintainers":[{"name":"principal-ai","email":"principle@principlemd.com"}],"homepage":"https://github.com/a24z-ai/themed-markdown#readme","bugs":{"url":"https://github.com/a24z-ai/themed-markdown/issues"},"dist":{"shasum":"37e55c06732e044e49a25a1635d4e19949c32604","tarball":"https://registry.npmjs.org/@a24z/markdown-utils/-/markdown-utils-0.1.2.tgz","fileCount":42,"integrity":"sha512-dYYK1pGa3MUZByLqTgelRiZqe+k7V6X4gj3UEWYlT17HJ4lbfGoL9FupSoFuBoiufnM6FgXoeE209McOw3vFoQ==","signatures":[{"sig":"MEQCIBQ9ySgImlNBn1JZk8+YvJvwXoJDixbQBRi6zSCsD3msAiBooFHlrwSWLTOvwVm2quDvvJAswa7lhnTq47hHdptIYA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63633},"main":"./dist/cjs/index.js","types":"./dist/esm/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"types":"./dist/esm/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"bfb78575ce05d275765922fd5fd372d0a71b220c","scripts":{"dev":"npm run build --watch","test":"bun test","build":"npm run build:clean && npm run build:esm && npm run build:cjs && npm run build:types && npm run build:copy-package-files","clean":"rm -rf dist","build:cjs":"bun build ./src/index.ts --outfile ./dist/cjs/index.js --format cjs","build:esm":"bun build ./src/index.ts --outfile ./dist/esm/index.js --format esm","build:clean":"rm -rf dist","build:types":"tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./dist/esm","build:copy-package-files":"echo '{\"type\":\"module\"}' > dist/esm/package.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && cp -r dist/esm/*.d.ts dist/esm/*.d.ts.map dist/esm/types dist/esm/utils dist/cjs/ 2>/dev/null || true"},"_npmUser":{"name":"principal-ai","email":"principle@principlemd.com"},"repository":{"url":"git+https://github.com/a24z-ai/themed-markdown.git","type":"git","directory":"packages/markdown-utils"},"_npmVersion":"10.9.2","description":"Core markdown parsing and presentation utilities without React dependencies","directories":{},"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.0.4"},"_npmOperationalInternal":{"tmp":"tmp/markdown-utils_0.1.2_1757574296962_0.22688587282078254","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@a24z/markdown-utils","version":"0.1.3","description":"Core markdown parsing and presentation utilities without React dependencies","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","exports":{".":{"types":"./dist/esm/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"scripts":{"build":"npm run build:clean && npm run build:esm && npm run build:cjs && npm run build:types && npm run build:copy-package-files","build:clean":"rm -rf dist","build:esm":"bun build ./src/index.ts --outfile ./dist/esm/index.js --format esm","build:cjs":"bun build ./src/index.ts --outfile ./dist/cjs/index.js --format cjs","build:types":"tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./dist/esm","build:copy-package-files":"echo '{\"type\":\"module\"}' > dist/esm/package.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json && cp -r dist/esm/*.d.ts dist/esm/*.d.ts.map dist/esm/types dist/esm/utils dist/esm/diff dist/cjs/ 2>/dev/null || true","dev":"npm run build --watch","test":"bun test","clean":"rm -rf dist"},"keywords":["markdown","parser","presentation","slides","utilities"],"author":{"name":"a24z Team"},"license":"MIT","devDependencies":{"@types/bun":"latest","typescript":"^5.0.4"},"repository":{"type":"git","url":"git+https://github.com/a24z-ai/themed-markdown.git","directory":"packages/markdown-utils"},"_id":"@a24z/markdown-utils@0.1.3","gitHead":"fbcf27750cd9e383c4834c5bb06c353ee45f171c","bugs":{"url":"https://github.com/a24z-ai/themed-markdown/issues"},"homepage":"https://github.com/a24z-ai/themed-markdown#readme","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-+fJniqhqPkPw55r52qtnRPvoRucZXqvYWdnP4PtKxGVdBZbN76dvsn15pD6D0MS6xOBrzU48T9AXB9vctmQOFA==","shasum":"eb84ce37f1d6d02c9dbb3d9f438f73dc247b9b54","tarball":"https://registry.npmjs.org/@a24z/markdown-utils/-/markdown-utils-0.1.3.tgz","fileCount":67,"unpackedSize":146264,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC25bXS7CGNuH7WS69EkVkNh3jnhargf+JWOFVRHnx/jQIgDH+vw1zr7KhvRS2oQggPJFTXrbFvsuF8RT9WiW3V6D4="}]},"_npmUser":{"name":"fernando-ram-lugo","email":"principle@principlemd.com"},"directories":{},"maintainers":[{"name":"fernando-ram-lugo","email":"principle@principlemd.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdown-utils_0.1.3_1763079460219_0.6293831178677092"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-09T22:20:12.196Z","modified":"2025-11-14T00:17:40.667Z","0.1.0":"2025-09-09T22:20:12.499Z","0.1.1":"2025-09-10T04:21:18.872Z","0.1.2":"2025-09-11T07:04:57.148Z","0.1.3":"2025-11-14T00:17:40.418Z"},"bugs":{"url":"https://github.com/a24z-ai/themed-markdown/issues"},"author":{"name":"a24z Team"},"license":"MIT","homepage":"https://github.com/a24z-ai/themed-markdown#readme","keywords":["markdown","parser","presentation","slides","utilities"],"repository":{"type":"git","url":"git+https://github.com/a24z-ai/themed-markdown.git","directory":"packages/markdown-utils"},"description":"Core markdown parsing and presentation utilities without React dependencies","maintainers":[{"name":"fernando-ram-lugo","email":"principle@principlemd.com"}],"readme":"# @a24z/markdown-utils\n\nCore markdown parsing and presentation utilities without React dependencies. Extract slides, parse chunks, and handle markdown transformations.\n\n## Installation\n\n```bash\nnpm install @a24z/markdown-utils\n# or\nbun add @a24z/markdown-utils\n```\n\n## Features\n\n- 📝 **Markdown parsing** - Parse markdown into typed chunks\n- 🎯 **Slide extraction** - Split markdown into presentation slides\n- 🔀 **Presentation diffing** - Compare two presentations slide-by-slide\n- 🔌 **Extensible** - Plugin system for custom chunk types\n- 🚀 **Zero React dependencies** - Pure TypeScript utilities\n- 📦 **Lightweight** - ~22KB bundled\n\n## Usage\n\n### Parse Markdown into Chunks\n\n```typescript\nimport { parseMarkdownChunks, CHUNK_TYPES } from '@a24z/markdown-utils';\n\nconst chunks = parseMarkdownChunks(markdownContent, 'my-prefix');\n\nchunks.forEach(chunk => {\n  if (chunk.type === CHUNK_TYPES.MERMAID) {\n    // Handle mermaid diagram\n    console.log('Mermaid:', chunk.content);\n  }\n});\n```\n\n### Create Presentation from Markdown\n\n```typescript\nimport { parseMarkdownIntoPresentation, MarkdownPresentationFormat } from '@a24z/markdown-utils';\n\n// Split by horizontal rules (---)\nconst presentation = parseMarkdownIntoPresentation(\n  markdownContent,\n  MarkdownPresentationFormat.HORIZONTAL_RULE\n);\n\nconsole.log(`${presentation.slides.length} slides found`);\n```\n\n### Compare Two Presentations\n\n```typescript\nimport { diffPresentations, parseMarkdownIntoPresentation } from '@a24z/markdown-utils';\n\nconst beforePresentation = parseMarkdownIntoPresentation(beforeMarkdown);\nconst afterPresentation = parseMarkdownIntoPresentation(afterMarkdown);\n\nconst diff = diffPresentations(beforePresentation, afterPresentation);\n\nconsole.log(`${diff.summary.modified} slides modified`);\nconsole.log(`${diff.summary.added} slides added`);\nconsole.log(`${diff.summary.removed} slides removed`);\n\n// Iterate through slide-by-slide diffs\ndiff.slideDiffs.forEach(slideDiff => {\n  console.log(`Slide status: ${slideDiff.status}`);\n\n  if (slideDiff.status === 'modified') {\n    // Access line-by-line content changes\n    slideDiff.contentChanges?.forEach(change => {\n      if (change.type === 'add') {\n        console.log(`+ ${change.value}`);\n      } else if (change.type === 'remove') {\n        console.log(`- ${change.value}`);\n      }\n    });\n  }\n});\n```\n\n### Extend with Custom Chunks\n\n```typescript\nimport { BaseChunk, parseMarkdownChunks } from '@a24z/markdown-utils';\n\n// Define custom chunk type\ninterface MathChunk extends BaseChunk<'math_chunk'> {\n  formula: string;\n}\n\n// Custom parser\nconst mathParser = (content: string, idPrefix: string): MathChunk[] => {\n  // Parse LaTeX math blocks...\n  return [];\n};\n\n// Use with parser\nconst chunks = parseMarkdownChunks<MathChunk | ContentChunk>(\n  content,\n  'prefix',\n  [mathParser]\n);\n```\n\n## API\n\n### Types\n\n**Chunks:**\n- `BaseChunk<T>` - Base interface for extensible chunks\n- `MarkdownChunk`, `MermaidChunk`, `CodeChunk` - Built-in chunk types\n\n**Presentations:**\n- `MarkdownPresentation`, `MarkdownSlide` - Presentation types\n\n**Diffs:**\n- `PresentationDiff` - Complete diff analysis between two presentations\n- `SlideDiff` - Diff between two versions of a slide\n- `DiffSummary` - Summary statistics for a presentation diff\n- `DiffStatus` - Status of a slide: `'added' | 'removed' | 'modified' | 'unchanged' | 'moved'`\n- `TextDiff` - Line-level text change\n\n### Functions\n\n**Parsing:**\n- `parseMarkdownChunks()` - Parse markdown into typed chunks\n- `parseMarkdownIntoPresentation()` - Create presentation from markdown\n- `extractSlideTitle()` - Extract title from slide content\n\n**Diffing:**\n- `diffPresentations()` - Compare two presentations and generate diff\n- `calculateDiffSummary()` - Generate summary statistics from a diff\n- `diffText()` - Low-level line-by-line text comparison\n- `hasChanges()` - Check if a diff has any changes\n- `formatDiffSummary()` - Format summary as human-readable string\n\n**Utilities:**\n- `parseBashCommands()` - Parse bash code blocks\n- `transformImageUrl()` - Transform relative URLs to absolute\n- `slidesAreEqual()` - Check if two slides are identical\n- `normalizeText()` - Normalize text for comparison\n\n## License\n\nMIT - a24z Team","readmeFilename":"README.md"}