8000 GitHub - Gugatec/markdowndown · GitHub
[go: up one dir, main page]

Skip to content

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

📥

MarkdownDown

Convert any webpage to a clean markdown w/ images downloaded.

This is a fork of asadm/markdowndown (live demo), set up for self-hosting via Docker: the frontend's Mixpanel analytics call has been removed so nothing phones home, and images/tags are published for both linux/amd64 and linux/arm64.

🚀 Features

  • Convert webpage to markdown using Puppeteer and Turndown
  • Clean up content using Mozilla Readability
  • Download images, embed them in markdown, and download as a zip
  • Transform final markdown using GPT3/4 step (like summarization, removing links, changing formatting, etc.)
  • Also returns a clean HTML version of the webpage

🐳 Run with Docker

Pull the pre-built multi-arch image from Docker Hub:

docker run -d \
  --name markdowndown \
  -p 3000:3000 \
  -e OPENAI_API_KEY= \
  gugatec/markdowndown:latest

Then open http://localhost:3000, or POST a URL to http://localhost:3000/api/tomd.

Or with docker compose (see composer.yaml in this repo — builds locally from source, or pulls gugatec/markdowndown:latest if you skip build). Since the file isn't named compose.yaml/docker-compose.yml, pass -f explicitly:

docker compose -f composer.yaml up -d

All environment variables below are optional; a plain docker run with no env vars works for basic URL → Markdown conversion.

Deploying to a machine without this source tree (e.g. a NAS)? Use deploy/synology/composer.yaml instead — it's image-only (no build: section), so it always pulls from Docker Hub rather than trying to build locally.

Available tags

Tag Platforms Notes
latest linux/amd64, linux/arm64 Multi-arch manifest — Docker automatically pulls the layers for your platform. Use this unless you have a specific reason not to.
v1-amd64 linux/amd64 only For explicitly pinning to Intel/AMD 64-bit.
v1-arm64 linux/arm64 only For explicitly pinning to ARM64 (aarch64) — Apple Silicon, Raspberry Pi 4+, many ARM NAS/servers.
YYYY-MM-DD-HHMM linux/amd64, linux/arm64 Dated multi-arch snapshot, pushed alongside latest on every release (see build.sh).

Note: latest already only downloads the layers for your platform — the per-architecture tags don't reduce download size, they're for explicit pinning/clarity.

📦 Installation (without Docker)

If you want to run this locally without Docker, clone the repository and run:

npm install
npm run dev

By default, this will spawn and use a local puppeteer instance to convert the webpage to markdown.

If you want to use Browserless, you can set the BROWSERLESS_KEY environment variable (in a .env or .env.local file) to your Browserless API key and it will use that instead.

There is also a cloudflare worker (under ./cfworker directory) that uses Browser Rendering API instead of a puppeteer instance. If you deploy that, you can set the HTMLFETCH_API environment variable to the URL of the cloudflare worker and it will use that instead.

🤖 More Info on GPT Pass

Current LLM models are not good at returning entire markdown file after processing it. So, we instruct the model to only return list of edits that it wants to make to the markdown file. I then apply these edits to the markdown file and return the final markdown file to the user. This works well in GPT3 and is actually quite great in GPT4.

See _gpt.js to see how this is done.

You need to set the OPENAI_API_KEY environment variable to your OpenAI API key to use this feature.

License

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

About

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0