Skip to content

utkarsh5026/mdhd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

758 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MDHD Banner

MDHD

Turn walls of markdown into focused, distraction-free reading sessions.

Build Status License: MIT React TypeScript Vite Deployed on Vercel PRs Welcome

Live Demo Β· Report Bug Β· Request Feature


Table of Contents


About The Project

Long markdown documents are structurally rich but visually overwhelming. A single README.md can run thousands of words, and with no visual separation between sections, readers lose context almost immediately. The rise of AI has amplified this β€” LLMs generate markdown at machine speed (READMEs, design docs, changelogs, meeting notes), yet the tooling for reading it has barely moved.

MDHD is a pure client-side React application that solves this. It parses any markdown file into navigable sections β€” automatically, without configuration β€” and presents them as focused reading cards. Authors write standard markdown; MDHD handles the rest.

 README.md β€” The Problem                    MDHD β€” The Solution

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ## Introduction           β”‚           β”‚                               β”‚
β”‚ This tool helps you build β”‚           β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚ and deploy your project   β”‚           β”‚    β”‚  ## Installation     β”‚    β”‚
β”‚ with a single command.    β”‚           β”‚    β”‚                     β”‚    β”‚
β”‚ ## Installation           β”‚    ──►    β”‚    β”‚  Before you begin,  β”‚    β”‚
β”‚ Before you begin make     β”‚           β”‚    β”‚  make sure you have β”‚    β”‚
β”‚ sure you have node and    β”‚           β”‚    β”‚  node and git...    β”‚    β”‚
β”‚ git installed locally.    β”‚           β”‚    β”‚                     β”‚    β”‚
β”‚ ## Configuration          β”‚           β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚ Open the config file and  β”‚           β”‚                               β”‚
β”‚ set your environment vars.β”‚           β”‚     β—„  3 / 12  β–Ί    β–“β–“β–“β–‘β–‘   β”‚
β”‚ ## Advanced Usage         β”‚           β”‚                               β”‚
β”‚ ...                       β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                         One section. Full focus.
  3,000 words Β· infinite scroll            Progress you can see.

Every heading becomes a boundary. Instead of rendering the whole document at once, MDHD isolates each section into its own focused card, and the reader moves through them one by one β€” the reading experience of a presentation, with the content depth of documentation.

No backend. No accounts. All data stays in your browser.


Key Features

  • πŸ“– Smart Section Parsing β€” Automatically chunks any markdown by headings (#, ##, ###), with code-block-aware detection to avoid false splits
  • πŸƒ Card Mode β€” One focused section per screen with smooth 200ms fade transitions, arrow key / spacebar / swipe navigation
  • πŸ“œ Scroll Mode β€” Continuous reading with IntersectionObserver-based section tracking and automatic progress updates
  • 🧘 Zen Mode β€” Immersive, distraction-free fullscreen reading with auto-hiding controls
  • 🎨 50+ Color Themes β€” GitHub Dark, Dracula, Nord, Linear, Solarized, and more
  • πŸ”€ 28 Fonts β€” Serif, sans-serif, and monospace options optimized for long-form reading
  • βš™οΈ Typography Controls β€” Live adjustments for font size, line height, and content width
  • 🎭 Markdown Style Customization β€” Granular control over heading colors, blockquote styles, list markers, code block containers, and inline code appearance
  • πŸ“Š Reading Progress β€” Per-section and document-wide word-count-based progress tracking with milestone celebrations
  • πŸ—‚οΈ Table of Contents β€” Embedded sidebar with hierarchical tree view, repositionable to left or right, with reading progress indicators
  • πŸ” Search β€” Full-text search across all sections with instant navigation to results
  • 🎬 Presentation Mode β€” Turn any document into a slideshow with speaker notes, slide overview, and filmstrip view
  • πŸ“„ PDF Export β€” Export documents as formatted PDFs
  • πŸ’Ύ Offline File Storage β€” Client-side IndexedDB storage for persisting uploaded files across sessions
  • πŸ“‘ Multi-Tab System β€” Open multiple documents simultaneously with independent reading states per tab
  • ⌨️ Keyboard & Touch β€” Full keyboard navigation on desktop, native swipe gestures on mobile
  • πŸ”¬ Bionic Reading β€” Optional bold-prefix mode for improved focus and reduced mind-wandering
  • 🎯 Sentence Focus β€” Hover-activated sentence isolation that dims surrounding text for precision reading
  • πŸ–ΌοΈ Code Image Export β€” Export any code block as a styled image with OS window chrome, language icons, syntax themes, watermarks, and one-click presets
  • πŸ“· Photo Image Export β€” Export document images with filters, frames, captions, and custom styling options
  • 🎬 Rich Media Rendering β€” Images render with shimmer loading and inline captions; videos play natively; both support a bottom-sheet gallery view
  • πŸ“‹ Snippets Sheet β€” Browse all code snippets and media (images, videos) in a document from a single side panel
  • ✏️ Section Editor β€” Edit any markdown section in-place with live editor-preview sync
  • πŸ“€ Context Menu Exports β€” Right-click code blocks, tables, or images to export as image, CSV, Excel, or copy with line numbers
  • πŸ–ŒοΈ Reading Backgrounds β€” Customize with solid colors or background images with opacity, blur, and overlay controls
  • πŸ’» Code Display Settings β€” Toggle line numbers, code folding, word wrap, and language labels

Built With

Category Technology
Framework React 19 with React Compiler
Language TypeScript 5.7 (strict mode)
Build Tool Vite 6
Styling Tailwind CSS 4
State Zustand 5 (persisted to localStorage)
UI Primitives Radix UI
Markdown react-markdown + rehype/remark plugins
Syntax Highlighting CodeMirror 6 (lazy-loaded)
File Storage IndexedDB
Routing React Router 7
Deployment Vercel

Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/utkarsh5026/mdhd.git
    cd mdhd
  2. Install dependencies

    cd app
    bun install
  3. Start the development server

    bun run dev
  4. Open in your browser

    Navigate to http://localhost:5173 β€” the app is ready to use.

Build for Production

bun run build
bun run preview

Usage

Quick Start

  1. Upload a markdown file β€” Drag and drop any .md file onto the sidebar, or use the file picker
  2. Choose your reading mode β€” Toggle between Card Mode (one section at a time) and Scroll Mode (continuous reading)
  3. Navigate β€” Use ← β†’ arrow keys, Space, or swipe gestures in Card Mode
  4. Customize β€” Open the settings panel to adjust fonts, themes, and typography
  5. Enter Zen Mode β€” Strip away all UI chrome for an immersive reading experience

Keyboard Shortcuts

Key Action
← / β†’ Previous / Next section (Card Mode)
Space Next section
Escape Exit Zen Mode / Exit Fullscreen
Ctrl/Cmd + F Open search
Ctrl/Cmd + S Save edited content

Presentation Mode:

Key Action
β†’ / ↓ / Space Next slide
← / ↑ Previous slide
N Toggle speaker notes
G Toggle slide overview
F Toggle filmstrip
Escape Exit presentation

Supported Formats

MDHD accepts standard .md and .markdown files. It handles YAML front matter, GFM tables, fenced code blocks, and all standard markdown syntax.

For more detailed documentation, explore the live demo β€” the best way to understand MDHD is to use it.


Architecture

Data Flow

File Upload β†’ IndexedDB β†’ File Explorer (useFileStore)
  β†’ Tab Creation (useTabsStore) β†’ Markdown Parser (parseMarkdownIntoSections)
  β†’ Reading Core (useReading hook) β†’ Markdown Renderer β†’ Display

Dual Reading Modes

                      ReadingCore (Shared)
                              β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚                                    β”‚
      readingMode = 'card'              readingMode = 'scroll'
            β”‚                                    β”‚
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚   ContentReader     β”‚            β”‚  ScrollContentReader    β”‚
  β”‚                     β”‚            β”‚                         β”‚
  β”‚  β€’ One section      β”‚            β”‚  β€’ All sections stacked β”‚
  β”‚    per screen       β”‚            β”‚  β€’ IntersectionObserver β”‚
  β”‚  β€’ 200ms fade       β”‚            β”‚    tracks visible item  β”‚
  β”‚    transition       β”‚            β”‚  β€’ Sections auto-marked β”‚
  β”‚  β€’ Swipe gestures   β”‚            β”‚    read as scrolled     β”‚
  β”‚  β€’ Arrow / Space    β”‚            β”‚  β€’ Scroll progress      β”‚
  β”‚    key navigation   β”‚            β”‚    tracked (0–100%)     β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

State Management

Multiple Zustand stores power the app, all persisted to localStorage:

  • useTabsStore β€” Open documents, active tab, reading mode, per-tab progress, editor-preview sync state
  • useReadingSettingsStore β€” Font family, size, line height, content width
  • useThemeStore β€” Active color theme, syntax theme, bookmarked themes
  • useCodeImageExportStore β€” Code image export settings (theme, padding, OS chrome, watermark, presets)
  • usePhotoImageExportStore β€” Photo export settings (filters, frames, captions)

File Storage

Files are stored in IndexedDB (mdhd-files) with two object stores (files and directories). The tree is assembled on demand from parent-path indexes β€” no nested storage. Upload handles drag-and-drop, file picker, and folder uploads through a unified batch processor.

Bundle Optimization

Manual Vite chunking keeps initial load fast:

Chunk Contents
codemirror Syntax highlighting (~250KB), lazy-loaded
ui-vendor Radix UI + Lucide icons
state-vendor Zustand
vendor Remaining dependencies

Console/debugger statements are stripped, Gzip + Brotli compression applied, and source maps are hidden in production.


Results & Impact

Switching from linear scroll to card-based reading had a measurable effect on engagement:

Metric Traditional Scroll MDHD Card View Outcome
Average Session Length 2m 15s 8m 45s 388% Increase
Completion Rate 18% 64% 3.5x Better
Bounce Rate 72% 24% Massive Drop

The card format creates natural checkpoints β€” finishing a section feels like progress, which keeps readers moving forward rather than giving up.


Roadmap

  • Card Mode with keyboard & swipe navigation
  • Scroll Mode with IntersectionObserver tracking
  • Zen Mode (distraction-free reading)
  • 50+ color themes & 28 fonts
  • IndexedDB file persistence
  • Multi-tab document system
  • Bionic Reading mode
  • Sentence Focus on Hover
  • Code Image Export β€” styled snapshots with OS chrome, language icons, and presets
  • Photo Image Export β€” export images with filters, frames, and captions
  • Context Menu Exports β€” right-click code, tables, and images to export as image/CSV/Excel
  • Snippets Sheet β€” browse all code and media in a document from one panel
  • Section Editor with live editor-preview sync
  • Rich Media Rendering β€” video support, shimmer loading, gallery view, inline captions
  • Presentation Mode β€” slideshow with speaker notes, overview, and filmstrip
  • PDF Export
  • Search across sections (Ctrl/Cmd+F)
  • Markdown style customization (headings, blockquotes, lists, code blocks)
  • Reading background customization (solid colors, images)
  • Embedded Table of Contents sidebar with left/right positioning
  • Scan Mode β€” collapse paragraphs to first-sentence previews
  • First Sentence Highlight β€” auto-emphasize the lead sentence of every paragraph
  • Dense Paragraph Indicator β€” visual cues for content-heavy blocks
  • Reading Ruler β€” line-tracking overlay for improved reading accuracy
  • Key Term Emphasis β€” auto-highlight heading terms in body text
  • Document virtualization for 100+ section documents
  • Export reading progress & annotations

See the open issues for a full list of proposed features and known issues.


Contributing

Contributions make the open-source community an incredible place to learn, inspire, and create. Any contribution you make is greatly appreciated.

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/amazing-feature
  3. Commit your changes
    git commit -m 'feat: add amazing feature'
  4. Push to the branch
    git push origin feature/amazing-feature
  5. Open a Pull Request

Development Commands

cd app
bun run dev              # Start dev server
bun run build            # TypeScript check + production build
bun run lint             # ESLint
bun run format           # Prettier format
bun run test             # Vitest (watch mode)
bun run test:run         # Vitest (single run)
bun run test:coverage    # Vitest with coverage
bun run knip             # Detect unused code/exports

Commit Convention

This project uses Conventional Commits enforced by commitlint + husky:

feat(scope): add new feature
fix(scope): resolve bug
refactor(scope): restructure code

License

Distributed under the MIT License. See LICENSE for more information.


Contact & Support

Utkarsh Priyadarshi

GitHub LinkedIn


Back to Top

Made with dedication and a lot of markdown.

About

MDHD is a markdown reader that transforms your lengthy documents into digestible, focused reading sessions πŸ€—πŸ€—

Topics

Resources

Stars

Watchers

Forks

Contributors