Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ High-performance HTML → Markdown conversion powered by Rust. Shipping as a Rus
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/Goldziher/html-to-markdown/blob/main/LICENSE)
[![Discord](https://img.shields.io/badge/Discord-Join%20our%20community-7289da)](https://discord.gg/pXxagNK2zN)

## 🎮 Live Demo

**Try it now:** [https://goldziher.github.io/html-to-markdown/](https://goldziher.github.io/html-to-markdown/)

Experience the power of WebAssembly-based HTML to Markdown conversion directly in your browser!

## Documentation

- **JavaScript/TypeScript guides**:
Expand Down
11 changes: 11 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ tasks:
- task: build:wasm
- task: build:ts

build:demo:
desc: "Build and update the GitHub Pages demo"
cmds:
- ./scripts/build-demo.sh

serve:demo:
desc: "Serve the GitHub Pages demo locally"
dir: docs
cmds:
- python3 -m http.server 8000

build:wheel-prep:
desc: "Prepare CLI binary for wheel packaging"
cmds:
Expand Down
6 changes: 4 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand All @@ -15,7 +15,9 @@
"**/html-to-markdown-node/index.js",
"**/html-to-markdown-node/index.d.ts",
"**/html-to-markdown-wasm/**/*.js",
"**/html-to-markdown-wasm/**/*.d.ts"
"**/html-to-markdown-wasm/**/*.d.ts",
"docs/html_to_markdown_wasm.js",
"docs/html_to_markdown_wasm_bg.wasm"
],
"linter": {
"enabled": false
Expand Down
59 changes: 59 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# GitHub Pages Demo

This directory contains the live demo of the HTML to Markdown converter, powered by WebAssembly.

## 🌐 Live Demo

Visit the live demo at: **<https://goldziher.github.io/html-to-markdown/>**

## 🚀 Running Locally

To test the demo locally:

```bash
# Option 1: Using task
task serve:demo

# Option 2: Using Python
cd docs
python3 -m http.server 8000

# Option 3: Using Node.js
npx http-server docs -p 8000
```

Then open <http://localhost:8000> in your browser.

## 🔧 Building the WASM Files

When you update the Rust code and need to rebuild:

```bash
# Option 1: Using go-task (recommended)
go-task build:demo

# Option 2: Using the script
./scripts/build-demo.sh

# Option 3: Manual
cd crates/html-to-markdown-wasm
wasm-pack build --target web --out-dir dist-web
cd ../..
cp crates/html-to-markdown-wasm/dist-web/html_to_markdown_wasm.js docs/
cp crates/html-to-markdown-wasm/dist-web/html_to_markdown_wasm_bg.wasm docs/
```

Then commit and push to deploy:

```bash
git add docs/
git commit -m "Update demo"
git push
```

## 📝 Notes

- The WASM binary is ~2.6MB (optimized with `wasm-opt`)
- First load may take a moment to download and initialize WASM
- All conversion happens client-side - no data is sent to any server
- Must be served over HTTP/HTTPS (not `file://`) due to WASM/CORS requirements
Loading
Loading