Skip to content

1ps0/markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Viewer

A lightweight, browser-based markdown viewer with CommonMark support and dark mode.

Features

  • CommonMark Compliant: Full support for CommonMark markdown syntax
  • Dark Mode: Toggle between light and dark themes with persistent preferences
  • Drag & Drop: Simply drag markdown files onto the page to view them
  • No Dependencies: Pure JavaScript implementation, no external libraries required
  • Responsive Design: Clean, modern interface that works on all screen sizes
  • Syntax Support:
    • Headers (H1-H6)
    • Bold, italic, strikethrough text
    • Code blocks with language hints
    • Tables
    • Lists (ordered and unordered)
    • Blockquotes
    • Horizontal rules
    • Links and images

Getting Started

Installation

  1. Clone the repository or download the index.html file
  2. Open index.html in any modern web browser
  3. No build process or dependencies required!

Usage

  1. Open a file: Click "Choose File" or drag and drop a markdown file anywhere on the page
  2. Toggle theme: Click the moon/sun icon to switch between light and dark modes
  3. Supported formats: .md, .markdown, or .txt files

Browser Compatibility

Works with all modern browsers that support:

  • ES6 JavaScript
  • CSS Grid/Flexbox
  • Local Storage API

Tested on:

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Local Development

Since this is a single HTML file with embedded CSS and JavaScript, you can:

  1. Open directly in a browser:

    open index.html
  2. Or serve with any static server:

    python -m http.server 8000
    # Then navigate to http://localhost:8000

Architecture

The viewer is built as a single-page application with:

  • Embedded CSS: Includes both light and dark theme styles
  • MarkdownParser class: Custom CommonMark-compliant parser
  • Theme persistence: Saves preferences to localStorage
  • File handling: Supports both file input and drag-and-drop

License

MIT License - See LICENSE file for details

Support

For issues, feature requests, or questions, please open an issue on GitHub.

About

Portable monofile html markdown reader

Resources

Contributing

Stars

Watchers

Forks

Languages