Skip to content

feat: add direct single markdown rendering API#9

Merged
developer0hye merged 4 commits into
mainfrom
feat/single-markdown-api
Mar 9, 2026
Merged

feat: add direct single markdown rendering API#9
developer0hye merged 4 commits into
mainfrom
feat/single-markdown-api

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

  • Add SingleMarkdownFileSystem to marknest-core implementing IndexedFileSystem, wrapping a single markdown byte buffer without ZIP overhead
  • Add render_markdown_entry and render_markdown_entry_with_options public APIs to marknest-core
  • Add renderMarkdown(md_bytes, filename, options) WASM binding to marknest-wasm
  • Update web app to use renderMarkdown for single .md preview rendering, skipping ZIP decompression on each re-render

Related: #8

Test plan

  • Core: 5 new tests covering basic rendering, custom options, title derivation, unresolvable local images, and invalid UTF-8 rejection
  • WASM: 2 new tests covering direct markdown rendering with default and custom options
  • All 42 existing tests pass with no regressions
  • WASM target (wasm32-unknown-unknown) compiles cleanly
  • Manual: upload a single .md file in the web app and verify preview renders without ZIP wrapping delay

🤖 Generated with Claude Code

developer0hye and others added 4 commits March 9, 2026 15:48
Add a lightweight filesystem implementation that wraps a single markdown
byte buffer, bypassing ZIP construction/parsing for self-contained
markdown files. This enables direct rendering without ZIP overhead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Expose render_markdown_entry_with_options through a renderMarkdown
JavaScript binding, allowing the browser to render a single markdown
file without constructing or parsing a ZIP archive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
When a single markdown file is uploaded, store its raw bytes and use
the new renderMarkdown WASM binding for preview rendering. This skips
ZIP decompression and re-analysis on each options change. ZIP is still
built for operations that need it (debug bundle, server fallback).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye developer0hye merged commit c9b6127 into main Mar 9, 2026
2 checks passed
@developer0hye developer0hye deleted the feat/single-markdown-api branch March 9, 2026 06:59
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