feat: MDX rendering support in books island #30

Closed
mik-tf wants to merge 0 commits from development_mdx_rendering into development
Owner

Summary

Add client-side MDX rendering to the books island. When hero_books returns content_type: "mdx" with raw MDX source in content_raw, the island:

  1. Shows server-side HTML fallback immediately (for fast first paint)
  2. Loads mdx-js + React from CDN via dynamic import()
  3. Compiles raw MDX source client-side
  4. Renders JSX components with custom component mappings:
    • <Tabs> / <TabItem> — tabbed content panels
    • <CodeBlock> — syntax-highlighted code with copy button
    • <Callout> / <Admonition> — info/warning/error boxes
    • <Details> — collapsible sections
    • Embedded iframes (YouTube, Canva) — pass through as-is
  5. Replaces fallback with fully rendered MDX output
  6. Falls back gracefully to server HTML if compilation fails

Closes #29

Dependencies

  • hero_books PR #66 — backend content_type + content_raw fields (must be merged first)
## Summary Add client-side MDX rendering to the books island. When hero_books returns `content_type: "mdx"` with raw MDX source in `content_raw`, the island: 1. Shows server-side HTML fallback immediately (for fast first paint) 2. Loads [mdx-js](https://mdxjs.com/) + React from CDN via dynamic `import()` 3. Compiles raw MDX source client-side 4. Renders JSX components with custom component mappings: - `<Tabs>` / `<TabItem>` — tabbed content panels - `<CodeBlock>` — syntax-highlighted code with copy button - `<Callout>` / `<Admonition>` — info/warning/error boxes - `<Details>` — collapsible sections - Embedded iframes (YouTube, Canva) — pass through as-is 5. Replaces fallback with fully rendered MDX output 6. Falls back gracefully to server HTML if compilation fails Closes #29 ## Dependencies - [hero_books PR #66](https://forge.ourworld.tf/lhumina_code/hero_books/pulls/66) — backend `content_type` + `content_raw` fields (must be merged first)
feat: add client-side MDX rendering in books island
Some checks failed
Build and Test / build (pull_request) Failing after 14s
11bf9e759e
When the hero_books backend returns content_type="mdx" with raw MDX
source in content_raw, the books island now:

1. Shows the server-side HTML fallback immediately (stripped JSX)
2. Loads mdx-js + React from CDN via dynamic import
3. Compiles raw MDX source client-side
4. Renders JSX components with custom component mappings:
   - Tabs/TabItem — tabbed content panels
   - CodeBlock — syntax-highlighted code
   - Callout/Admonition — info/warning/error boxes
   - Details — collapsible sections
5. Replaces the fallback HTML with the fully rendered MDX output

Falls back gracefully to server HTML if MDX compilation fails.

Closes #29

Co-Authored-By: mik-tf <mik@threefold.io>
mik-tf changed title from WIP: feat: MDX rendering support in books island to feat: MDX rendering support in books island 2026-02-26 04:24:21 +00:00
Author
Owner

Consolidated into PR #35 (development_consolidated) which merges all 7 open PRs plus the books island WASM fix. Closing this PR — changes are included in the consolidated branch.

Consolidated into PR #35 (development_consolidated) which merges all 7 open PRs plus the books island WASM fix. Closing this PR — changes are included in the consolidated branch.
mik-tf closed this pull request 2026-03-02 15:22:16 +00:00
Some checks failed
Build and Test / build (pull_request) Failing after 14s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos!30
No description provided.