How suryanshswarn09/markdown-pdf works
This is a React Markdown-and-LaTeX editor with a live preview and document export/printing tools. The principal workflow is editing Markdown, sanitizing math delimiters, rendering and highlighting the preview, then optionally generating a TOC or exporting/printing the document. The README documents additional editing, persistence, security, theme, and layout capabilities. App.jsx is indexed but unsampled, so internal links beyond documented behavior are dashed where their exact call sites could not be verified.
Main entry points: App.jsx App Shell · PrintModal.jsx Print Customizer · scrollSync.js Scroll Sync · printOptions.js Print Options
Components 18
Editing and Navigation
- App Shell
src/App.jsx - Markdown Editor
src/App.jsx - Editor Shortcuts
src/utils/editorKeyHandlers.js - TOC Generator
src/utils/tocGenerator.js - Scroll Sync
src/utils/scrollSync.js
Preview Rendering
- Math Sanitizer
src/utils/mathSanitizer.js - Markdown Renderer
src/App.jsx - Code Highlighter
src/utils/highlighter.js - Live Preview
src/App.jsx
Export and Print
- Document Export
src/utils/exportUtils.js - Print Customizer
src/components/PrintModal.jsx - Print Options
src/utils/printOptions.js - SVG Icons
src/components/Icons.jsx
Document Support
- Document Metrics
src/utils/documentStats.js - Theme Preferences
src/utils/themeUtils.js - Browser Storage
Other components
- User
- Browser
Connections 20
- User → App Shell: edits document
README.md - App Shell → Markdown Editor: handles input
- Markdown Editor → Editor Shortcuts: handles indentation
- App Shell → Math Sanitizer: sanitizes math
README.md - App Shell → Markdown Renderer: parses Markdown
README.md - Markdown Renderer → Code Highlighter: highlights code
- Markdown Renderer → Live Preview: renders preview
README.md - App Shell → TOC Generator: generates TOC
- Live Preview → Scroll Sync: syncs scrolling
- App Shell → Document Export: exports documents
- App Shell → Print Customizer: opens print layout
- Print Customizer → Print Options: uses presets
src/components/PrintModal.jsx - Print Customizer → SVG Icons: renders icons
src/components/PrintModal.jsx - App Shell → Document Metrics: calculates metrics
- App Shell → Theme Preferences: loads theme
- App Shell → Browser Storage: persists preferences
- Print Options → Browser Storage: reads and writes
- Scroll Sync → Browser Storage: reads and writes
- Theme Preferences → Browser Storage: persists theme
- App Shell → Browser: prints document