Skip to content

Add interactive Mermaid diagram support for PDF exports in compendium - #300

Closed
makr-code with Copilot wants to merge 6 commits into
developfrom
copilot/integrate-interactive-mermaid-diagrams
Closed

makr-code with Copilot wants to merge 6 commits into
developfrom
copilot/integrate-interactive-mermaid-diagrams

Conversation

Copilot AI commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

The compendium needed interactive Mermaid diagrams for PDF exports. Standard PDF generators render Mermaid as code blocks, losing interactivity.

Implementation

Multi-layer approach for maximum compatibility:

1. Interactive HTML Generator (generate_interactive_pdf_with_embeds.py)

  • Extracts Mermaid blocks from markdown chapters
  • Generates standalone HTML with embedded Mermaid.js
  • Creates QR codes linking to hosted versions
  • Outputs metadata JSON for viewer integration
# Generates interactive HTML + QR codes for 17 diagrams
python3 generate_interactive_pdf_with_embeds.py

# Configure deployment URL via environment
export THEMIS_GITHUB_PAGES_URL="https://example.com/diagrams/"

2. PDF.js Viewer (interactive_pdf_viewer.html)

  • Browser-based PDF rendering with Mermaid overlay
  • Fullscreen diagram mode, zoom controls, keyboard shortcuts
  • Sidebar navigation for all diagrams

3. Features per Diagram

Each HTML includes:

  • Zoom/pan/reset controls
  • Theme toggle (light/dark)
  • SVG download
  • Click-to-inspect elements
  • Responsive design

Technical Notes

  • Cross-platform temp directories via tempfile.gettempdir()
  • GitHub Pages URL configurable via THEMIS_GITHUB_PAGES_URL env var
  • Demo script includes user confirmation for package installation
  • Tested with 17 diagrams across 4 chapters

Documentation

  • README_INTERACTIVE.md - Quick start guide
  • INTERACTIVE_PDF_MERMAID_GUIDE.md - Technical deep-dive comparing 4 approaches (Rich Media Annotations, Embedded Attachments, PDF Forms, Hybrid SVG+QR)
  • demo_interactive_mermaid.sh - Automated demo workflow
Original prompt

können interactive reactive mermaid diagramme in .\compendium (export pdf) integriert werden?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add interactive reactive mermaid diagrams to Compendium PDF export Add interactive Mermaid diagram support for PDF exports in compendium Jan 8, 2026
Copilot AI requested a review from makr-code January 8, 2026 21:45
@makr-code makr-code closed this Jan 9, 2026
@makr-code makr-code added this to the v1.0.2 milestone Mar 11, 2026
Copilot AI added a commit that referenced this pull request May 20, 2026
- Add RerouteSerializeFn tests (stub #252)
- AstVisitorFn bridge: TensorAwareQueryOptimizer (stub #275)
- ExactSimilarityFn bridge: TensorFingerprintGraph (stub #276)
- [[deprecated]] attribute: ggmlCorePtrs (stub #277)
- RpcPhase2Fn bridge: DistributedTransactionManager (stub #279)
- AuthorizeFn bridge: RopeApiHandler RBAC (stub #280)
- HttpPostFn bridge: AIPluginGenerator (stub #282)
- HTToTTFn bridge: HTTrain (stub #286)
- ModelPathProviderFn bridge: LoRATrainingService (stub #289)
- AllReduceCpuFn bridge: DistributedTrainer (stub #290)
- NlpContextFn bridge: AdaptiveShardRouter (stub #291)
- StringArrayFn bridge: PropertyGraphManager (stub #292)
- SchemaInspectorFn/SchemaValidatorFn: ImportApiHandler (stub #294)
- Lz4CompressFn/Lz4DecompressFn: SecureTransportClient (stub #295)
- SpamKeywordsProviderFn: FeedbackStore (stub #296)
- MODIFY path fix: FeedbackStore validateWithPlugin (stub #297)
- shared_ptr ResponseBuffer RAII: Http2Session (stub #298)
- ModelPathProviderFn: ThemisHelpLoRA Config (stub #299)
- IngestExternalFileFn: BackupManager (stub #300)
- StatsQueryFn: RopeApiHandler (stub #307)
- Update STUB_INVENTORY.md: 272->292 resolved, 44->24 active

Co-authored-by: Copilot <[email protected]>

Co-authored-by: makr-code <[email protected]>
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.

2 participants