Skip to content

Add GitHub Pages live demo with browser bundle - #41

Merged
jonathanKingston merged 2 commits into
mainfrom
docs/github-pages-live-demo
Jul 5, 2026
Merged

jonathanKingston merged 2 commits into
mainfrom
docs/github-pages-live-demo

Conversation

@jonathanKingston

Copy link
Copy Markdown
Collaborator

Summary

  • Add an interactive live demo at docs/index.html for GitHub Pages, with auto-streaming hero, side-by-side string vs DOM emitter comparison, and API snippets.
  • Bundle the library for the browser via esbuild (docs/streaming-markdown.browser.mjs) so highlight.js, entities, and dompurify resolve without a Node module graph.
  • Fall back to the DOMPurify sanitizer backend when the native Sanitizer API is unavailable (e.g. Firefox).
  • Add npm run build:demo to rebuild the browser bundle after library changes.

Test plan

  • Run cd docs && python3 -m http.server 8765 and open http://localhost:8765/
  • Confirm hero panel auto-streams markdown with pending block highlighting
  • Click preset buttons and Stream both — both panels render content
  • Verify in Firefox (no native Sanitizer API) that rendering works without console errors
  • Run npm run build:demo and confirm docs/streaming-markdown.browser.mjs regenerates

Made with Cursor

Jonathan Kingston and others added 2 commits July 5, 2026 21:06
Serve an interactive streaming markdown demo from docs/ for GitHub Pages.
Bundle highlight.js, entities, and DOMPurify via esbuild so bare module
specifiers work in the browser, and fall back to DOMPurify when the native
Sanitizer API is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the esbuild browser bundle and DOMPurify fallback over the bare
dist/ import that fails in browsers without a Node module graph.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jonathanKingston
jonathanKingston merged commit e34694d into main Jul 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant