How des86532/markdown-quick-preview works
Markdown Quick Preview is a Chrome/Edge extension for turning pasted Markdown, URLs, and GitHub repository links into temporary preview tabs. The popup classifies input, saves pasted text when needed, and opens the viewer; the viewer fetches and organizes GitHub documents or loads URL/paste content, then renders Markdown or Mermaid. Users can save previews as quick links and configure GitHub token rules. The graph follows documented capabilities and sampled calls; external fetch details not visible in source excerpts are documented by the README.
Main entry points: viewer/main.ts Preview and navigation · popup/main.ts Input and quick links · github.ts GitHub tree and files · storage.ts Paste and token storage
Components 15
Extension entry points
- Input and quick links
src/popup/main.ts - Token settings UI
src/options/main.ts
Preview content workflow
- Preview and navigation
src/viewer/main.ts - Input classification
src/lib/detect.ts - GitHub tree and files
src/lib/github.ts - Document tree ordering
src/lib/book.ts - Markdown and Mermaid
src/lib/render.ts
Local persistence
- Paste and token storage
src/lib/storage.ts - Quick links
src/lib/links.ts
GitHub credentials
- Token matching and validation
src/lib/tokens.ts
Other components
- Extension user
- GitHub API
- Raw GitHub files
- User-supplied HTTP URL
- Rendered document
Connections 20
- Extension user → Input and quick links: enters input
src/popup/main.ts - Input and quick links → Input classification: classifies input
src/popup/main.ts - Input and quick links → Paste and token storage: saves pasted text
src/popup/main.ts - Input and quick links → Preview and navigation: opens preview tab
src/popup/main.ts - Input and quick links → Quick links: lists and deletes
src/popup/main.ts - Preview and navigation → Paste and token storage: loads paste
src/viewer/main.ts - Preview and navigation → GitHub tree and files: loads repository content
src/viewer/main.ts - GitHub tree and files → GitHub API: requests tree and files
src/lib/github.ts - GitHub tree and files → Raw GitHub files: fetches raw file
src/lib/github.ts - Preview and navigation → User-supplied HTTP URL: fetches requested URL
README.md - Preview and navigation → Document tree ordering: builds document tree
src/viewer/main.ts - Preview and navigation → Markdown and Mermaid: renders selected content
src/viewer/main.ts - Markdown and Mermaid → Rendered document: produces preview
src/lib/render.ts - Preview and navigation → Quick links: saves and checks links
src/viewer/main.ts - Extension user → Token settings UI: configures tokens
src/options/main.ts - Token settings UI → Token matching and validation: validates rules
src/options/main.ts - Token settings UI → Paste and token storage: loads and saves rules
src/options/main.ts - Paste and token storage → Token matching and validation: stores typed rules
src/lib/storage.ts - GitHub tree and files → Paste and token storage: loads token rules
src/lib/github.ts - GitHub tree and files → Token matching and validation: selects matching token
src/lib/github.ts