Skip to content

Commit ee83ca8

Browse files
committed
Initial commit
0 parents  commit ee83ca8

23 files changed

Lines changed: 8559 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build-and-lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
cache: npm
17+
- run: npm ci
18+
- run: npm run build:chrome
19+
- run: npm run lint

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
node_modules/
2+
dist/
3+
artifacts/
4+
5+
# OS files
6+
.DS_Store
7+
Thumbs.db
8+
9+
# Editor
10+
.vscode/
11+
.idea/
12+
*.swp
13+
*.swo
14+
15+
# Claude Code
16+
.claude/
17+
CLAUDE.md

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 auy
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# HTML2MD
2+
3+
A browser extension that adds a sidebar to DevTools for converting selected HTML elements to Markdown. Supports Chrome, Edge, and Firefox.
4+
5+
## Features
6+
7+
- Select any element in the Elements inspector and instantly see its Markdown conversion
8+
- Live preview of the rendered Markdown
9+
- Copy to clipboard or download as `.md` file
10+
- Strips scripts, styles, and unnecessary attributes automatically
11+
12+
## Install from Store
13+
14+
*Coming soon* - Chrome Web Store | Firefox Add-ons | Edge Add-ons
15+
16+
## Development
17+
18+
### Prerequisites
19+
20+
- Node.js 20+
21+
- npm
22+
23+
### Setup
24+
25+
```bash
26+
git clone https://github.com/auy/HTML2MD.git
27+
cd html2md
28+
npm install
29+
```
30+
31+
### Build
32+
33+
```bash
34+
npm run build # Production build (Chrome/Edge)
35+
npm run build:firefox # Production build (Firefox)
36+
```
37+
38+
### Run with Auto-Install
39+
40+
```bash
41+
npm run start:chrome # Chrome (auto-downloads Chrome for Testing)
42+
npm run start:edge # Microsoft Edge
43+
npm run start:firefox # Mozilla Firefox
44+
```
45+
46+
Open DevTools (F12) > Elements tab > look for the **HTML2MD** sidebar tab.
47+
48+
### Other Commands
49+
50+
```bash
51+
npm run dev # Watch mode (rebuilds on file changes)
52+
npm run lint # Validate extension with web-ext lint
53+
npm run package # Zip dist/ for store submission
54+
```
55+
56+
## Cross-Platform Support
57+
58+
Works on Windows, macOS, Linux, and WSL. Platform detection is automatic.
59+
60+
## How It Works
61+
62+
1. **Cleaning** - Strips `<script>`, `<style>`, `<noscript>` tags and non-essential attributes
63+
2. **Conversion** - [Turndown](https://github.com/mixmark-io/turndown) converts HTML to Markdown (ATX headings, fenced code blocks, GFM strikethrough)
64+
3. **Preview** - [marked](https://github.com/markedjs/marked) renders the Markdown back to HTML for preview
65+
66+
## Contributing
67+
68+
1. Fork the repository
69+
2. Create a feature branch (`git checkout -b feature/my-feature`)
70+
3. Commit your changes
71+
4. Push to the branch and open a Pull Request
72+
73+
## License
74+
75+
[MIT](LICENSE)

0 commit comments

Comments
 (0)