Skip to content

auy/HTML2MD

Repository files navigation

HTML2MD

A browser extension that adds a sidebar to DevTools for converting selected HTML elements to Markdown. Supports Chrome, Edge, and Firefox.

Features

  • Select any element in the Elements inspector and instantly see its Markdown conversion
  • Live preview of the rendered Markdown
  • Copy to clipboard or download as .md file
  • Strips scripts, styles, and unnecessary attributes automatically

Install from Store

Coming soon - Chrome Web Store | Firefox Add-ons | Edge Add-ons

Development

Prerequisites

  • Node.js 20+
  • npm

Setup

git clone https://github.com/auy/HTML2MD.git
cd html2md
npm install

Build

npm run build              # Production build (Chrome/Edge)
npm run build:firefox      # Production build (Firefox)

Run with Auto-Install

npm run start:chrome       # Chrome (auto-downloads Chrome for Testing)
npm run start:edge         # Microsoft Edge
npm run start:firefox      # Mozilla Firefox

Open DevTools (F12) > Elements tab > look for the HTML2MD sidebar tab.

Other Commands

npm run dev                # Watch mode (rebuilds on file changes)
npm run lint               # Validate extension with web-ext lint
npm run package            # Zip dist/ for store submission

Cross-Platform Support

Works on Windows, macOS, Linux, and WSL. Platform detection is automatic.

How It Works

  1. Cleaning - Strips <script>, <style>, <noscript> tags and non-essential attributes
  2. Conversion - Turndown converts HTML to Markdown (ATX headings, fenced code blocks, GFM strikethrough)
  3. Preview - marked renders the Markdown back to HTML for preview

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes
  4. Push to the branch and open a Pull Request

License

MIT

About

Browser extension that converts selected HTML elements to Markdown in DevTools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors