{"id":50418774,"url":"https://github.com/developer0hye/marknest","last_synced_at":"2026-05-31T07:05:03.817Z","repository":{"id":343472202,"uuid":"1175880214","full_name":"developer0hye/marknest","owner":"developer0hye","description":"Markdown to PDF converter with Mermaid diagrams, LaTeX math, themes, and batch conversion. CLI + WASM.","archived":false,"fork":false,"pushed_at":"2026-03-13T15:30:43.000Z","size":11317,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T18:28:36.733Z","etag":null,"topics":["agent-skill","claude-code-skill","cli","converter","documentation","latex","markdown","markdown-to-pdf","md2pdf","mermaid","pdf","rust","wasm"],"latest_commit_sha":null,"homepage":"https://dontsendfile.com/md2pdf","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer0hye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-08T10:01:44.000Z","updated_at":"2026-03-26T09:43:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/developer0hye/marknest","commit_stats":null,"previous_names":["developer0hye/marknest"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/developer0hye/marknest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fmarknest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fmarknest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fmarknest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fmarknest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer0hye","download_url":"https://codeload.github.com/developer0hye/marknest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer0hye%2Fmarknest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33722189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-skill","claude-code-skill","cli","converter","documentation","latex","markdown","markdown-to-pdf","md2pdf","mermaid","pdf","rust","wasm"],"created_at":"2026-05-31T07:05:03.097Z","updated_at":"2026-05-31T07:05:03.810Z","avatar_url":"https://github.com/developer0hye.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MarkNest\n\n[![CI](https://github.com/developer0hye/marknest/actions/workflows/readme-corpus.yml/badge.svg)](https://github.com/developer0hye/marknest/actions/workflows/readme-corpus.yml)\n[![Crates.io](https://img.shields.io/crates/v/marknest)](https://crates.io/crates/marknest)\n[![npm](https://img.shields.io/npm/v/marknest)](https://www.npmjs.com/package/marknest)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\nA Markdown workspace analyzer and PDF converter. Upload a ZIP, point to a folder, or pass a single `.md` file — MarkNest resolves local images, renders Mermaid diagrams and math, and produces print-ready PDFs.\n\n**Try it online:** [dontsendfile.com/md2pdf](https://www.dontsendfile.com/md2pdf)\n\nhttps://github.com/user-attachments/assets/489b1b61-a840-4374-8eb5-d90d5fa1f4db\n\n## Features\n\n- **Workspace-aware** — analyzes folders, ZIP archives, and GitHub URLs; resolves relative image paths automatically\n- **Mermaid \u0026 Math** — renders fenced Mermaid diagrams to SVG and LaTeX math via MathJax, with configurable `off`/`auto`/`on` modes\n- **Themes \u0026 styling** — built-in presets (`default`, `github`, `docs`, `plain`), custom CSS, header/footer templates, per-side margins\n- **Batch conversion** — convert all Markdown files in a workspace at once, preserving directory structure\n- **Browser \u0026 CLI** — WASM-powered browser preview with no server upload, plus a native CLI for local and CI workflows\n- **PDF quality controls** — page size, orientation, table of contents, PDF metadata, print-layout page breaks\n- **Security built in** — Zip Slip prevention, path traversal blocking, HTML sanitization on by default, archive size limits\n- **Offline rendering** — Mermaid, MathJax, and html2pdf.js assets are vendored locally; no external CDN required\n- **Remote images** — best-effort fetch and inline of HTTP images across CLI, browser, and fallback flows\n- **Local fallback server** — Playwright-driven Chromium PDF generation for high-quality output when browser export isn't enough\n- **Docker image** — single image bundles CLI, fallback server, Chromium, and fonts for reproducible builds\n\n## Quick Start\n\n```bash\n# Install\ncargo install marknest\n\n# Install a headless browser for PDF rendering\nnpx playwright install chromium\n\n# Convert a Markdown file to PDF\nmarknest convert README.md -o README.pdf\n```\n\n## Installation\n\n### Cargo (from crates.io)\n\n```bash\ncargo install marknest\n```\n\n### npm / npx\n\n```bash\n# Run without installing\nnpx marknest convert README.md -o output.pdf\n\n# Or install globally\nnpm install -g marknest\nmarknest convert README.md -o output.pdf\n```\n\n### From source\n\n```bash\ngit clone https://github.com/developer0hye/marknest.git\ncd marknest\ncargo install --path crates/marknest\n```\n\n### Docker\n\n```bash\ndocker build -t marknest .\n\n# CLI usage\ndocker run --rm -v \"$PWD\":/work -w /work marknest marknest convert README.md -o README.pdf\n\n# Fallback server (default CMD)\ndocker run --rm -p 3476:3476 marknest\n```\n\n### Browser prerequisite\n\nPDF rendering requires a local Chromium-based browser. If none is installed:\n\n```bash\nnpx playwright install chromium\n# or for headless-only environments:\nnpx playwright install --with-deps chromium\n```\n\nBrowser discovery order: `MARKNEST_BROWSER_PATH` env var \u003e Playwright headless shell \u003e system Chrome/Edge/Chromium.\n\n## Usage\n\n### Validate\n\nCheck workspace structure, image links, and Mermaid/Math blocks without generating a PDF.\n\n```bash\nmarknest validate README.md\nmarknest validate ./docs.zip --entry docs/README.md\nmarknest validate ./docs --all --report report.json\nmarknest validate ./docs --all --strict\n```\n\n### Convert — single file\n\n```bash\nmarknest convert README.md -o README.pdf\nmarknest convert README.md --theme github --landscape -o README.pdf\nmarknest convert README.md --toc --mermaid auto --math auto -o README.pdf\nmarknest convert README.md --css custom.css --header-template header.html -o README.pdf\nmarknest convert README.md --page-size letter --margin-top 24 --margin-bottom 24 -o README.pdf\nmarknest convert README.md --title \"Guide\" --author \"Team\" --subject \"Arch\" -o README.pdf\n```\n\n### Convert — ZIP or folder (batch)\n\n```bash\nmarknest convert ./docs --out-dir ./pdf\nmarknest convert ./docs.zip --all --out-dir ./pdf\nmarknest convert ./docs.zip --entry docs/README.md -o out.pdf\n```\n\n### Convert — GitHub URL\n\n```bash\nmarknest convert https://github.com/user/repo -o output.pdf\nmarknest convert https://github.com/user/repo/blob/main/docs/guide.md -o guide.pdf\nmarknest convert https://github.com/user/repo/tree/v2.0 --all --out-dir ./pdf\n```\n\nSet `GITHUB_TOKEN` or `GH_TOKEN` for private repositories or to avoid API rate limits.\n\n### Debug artifacts\n\n```bash\nmarknest convert README.md \\\n  --debug-html ./out/debug.html \\\n  --asset-manifest ./out/assets.json \\\n  --render-report ./out/report.json \\\n  -o README.pdf\n```\n\n### Configuration\n\nSettings can be provided through CLI flags, a config file, or environment variables.\n\n**Precedence:** CLI args \u003e config file \u003e environment variables \u003e built-in defaults\n\n```bash\n# Use a config file\nmarknest convert README.md --config .marknest.toml -o README.pdf\n```\n\nConfig files are auto-discovered from `.marknest.toml` or `marknest.toml` in the working directory.\n\n| Environment Variable       | Purpose                        |\n| -------------------------- | ------------------------------ |\n| `MARKNEST_CONFIG`          | Path to config file            |\n| `MARKNEST_THEME`           | Default theme                  |\n| `MARKNEST_CSS`             | Path to custom CSS             |\n| `MARKNEST_TOC`             | Enable/disable TOC             |\n| `MARKNEST_SANITIZE_HTML`   | Enable/disable HTML sanitization |\n| `MARKNEST_BROWSER_PATH`    | Path to Chromium-based browser |\n| `MARKNEST_SERVER_ADDR`     | Fallback server bind address   |\n\n### Exit codes\n\n| Code | Meaning            |\n| ---- | ------------------ |\n| `0`  | Success            |\n| `1`  | Success with warnings |\n| `2`  | Validation failure |\n| `3`  | System failure     |\n\n## Web App\n\nThe browser app provides ZIP upload, entry selection, HTML preview, and PDF download — all client-side via WASM.\n\n```bash\ntrunk serve\n```\n\nExport modes:\n\n- **Browser Fast** — client-only PDF generation, no data leaves the browser\n- **High Quality Fallback** — sends ZIP to the local fallback server for Playwright/Chromium rendering\n\nThe web app also supports theme/CSS/margin/TOC/metadata controls, Mermaid/Math preview, debug bundle download, and batch ZIP export.\n\n## Fallback Server\n\n```bash\ncargo run -p marknest-server\n```\n\nListens on `http://127.0.0.1:3476` by default (override with `MARKNEST_SERVER_ADDR`). Accepts multipart ZIP uploads with output options and returns PDF or batch ZIP.\n\n## Project Structure\n\n| Path | Description |\n| ---- | ----------- |\n| `Cargo.toml` | Workspace definition |\n| `crates/marknest` | CLI binary: validation, conversion, config resolution, Playwright PDF |\n| `crates/marknest-core` | Core library: workspace analysis, HTML rendering |\n| `crates/marknest-server` | Local HTTP fallback service |\n| `crates/marknest-wasm` | WASM bindings for browser analysis and rendering |\n| `index.html`, `web/` | Browser app (Trunk) |\n| `runtime-assets/` | Vendored Mermaid, MathJax, html2pdf.js |\n| `validation/` | 60-entry README corpus and PDF fidelity validator |\n| `Dockerfile` | Shared CLI + server runtime image |\n\n## Development\n\n```bash\n# Format\ncargo fmt --all\n\n# Test\ncargo test\n\n# Check WASM target\ncargo check -p marknest-wasm --target wasm32-unknown-unknown\n\n# Install Playwright runtime for native PDF\nnpm ci --prefix crates/marknest/playwright-runtime\n\n# Install validation dependencies\nnpm ci --prefix validation\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper0hye%2Fmarknest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper0hye%2Fmarknest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper0hye%2Fmarknest/lists"}