Sign inSign up

aryansin1234/inkdown

By aryansin1234

โ€ขUpdated 5 months ago

Image
0

595

aryansin1234/inkdown repository overview

โ InkDown

Markdown in. Beautiful documents out.

Convert Markdown to pixel-perfect PDF and native Word DOCX documents โ€” with a web UI, REST API, and CLI. Everything is bundled in this image: Node 20, Chromium (for PDF), and Pandoc (for DOCX). No installs required on the host.

Docker Pulls Docker Image Size GitHub Node


โ Quick Start

docker run -p 3000:3000 aryansin1234/inkdown:latest

Then open http://localhost:3000โ  โ€” that's it.

๐ŸŽ Apple Silicon / ARM64 Mac? The image is built for linux/amd64. Use the platform flag:

docker run --platform linux/amd64 -p 3000:3000 aryansin1234/inkdown:latest

Or build a native ARM image locally:

git clone https://github.com/Aryansin1234/InkDown.git && cd InkDown
docker build -t inkdown:local .
docker run -p 3000:3000 inkdown:local

โ What is InkDown?

InkDown turns raw Markdown into documents you can actually share:

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚  Markdown   โ”‚ โ”€โ”€โ”€โ–ถ โ”‚   InkDown    โ”‚ โ”€โ”€โ”€โ–ถ โ”‚  PDF  or  DOCX   โ”‚
  โ”‚  Web ยท CLI  โ”‚      โ”‚  REST API    โ”‚      โ”‚  pixel-perfect   โ”‚
  โ”‚  REST API   โ”‚      โ”‚  โšก Engine    โ”‚      โ”‚  ready to share  โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Three ways to use it:

  • ๐ŸŒ Web UI โ€” drag & drop or paste Markdown, live preview, download the document
  • ๐Ÿ”Œ REST API โ€” call from any language, any platform
  • โŒจ๏ธ CLI โ€” node src/cli.js input.md output.pdf

โ Features

FeatureDetails
๐ŸŽจ Syntax Highlighting190+ languages, GitHub-light theme
๐Ÿ“Š Smart TablesPipe, grid, multiline tables โ€” borders & alignment
๐Ÿ“ˆ Mermaid DiagramsFlowcharts, sequence, Gantt, pie, ER, state, class, git graph, mindmap โ€” rendered as high-DPI PNG
๐Ÿ“„ Page Break Control<!-- pagebreak --> comments or auto-break before H1
๐Ÿ“‘ Table of ContentsAuto-generated, clickable TOC in both PDF and DOCX
๐Ÿ”ข Page NumbersFooter on every page: Title โ€” Page X / Y
โž— Math (LaTeX)Inline $E=mc^2$ and block $$...$$ equations via KaTeX
โšก PDF OutputHeadless Chrome via Puppeteer, A4 format, print-quality
๐Ÿ“ DOCX OutputNative Word documents via Pandoc โ€” real styles, embedded images
๐Ÿ‘๏ธ Live PreviewReal-time Markdown preview with Mermaid rendering
๐Ÿ”Œ REST API v1JSON body ยท file upload ยท URL fetch
๐Ÿ”’ API Key AuthOptional INKDOWN_API_KEYS env var
๐Ÿƒ Non-rootRuns as unprivileged inkdown user

โ Available Tags

TagDescription
latestMost recent stable build

โ Usage

โ One-liner
docker run -p 3000:3000 aryansin1234/inkdown:latest
โ Apple Silicon / ARM64 Mac
docker run --platform linux/amd64 -p 3000:3000 aryansin1234/inkdown:latest
โ Detached (background)
docker run -d --name inkdown --restart unless-stopped \
  -p 3000:3000 \
  aryansin1234/inkdown:latest
โ Docker Compose
services:
  inkdown:
    image: aryansin1234/inkdown:latest
    container_name: inkdown
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      # - INKDOWN_API_KEYS=your-secret-key
      # - INKDOWN_CORS_ORIGINS=https://myapp.com
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/v1/health', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s
docker compose up -d
โ With API Key (production)
docker run -d --name inkdown --restart unless-stopped \
  -p 3000:3000 \
  -e INKDOWN_API_KEYS=your-secret-key \
  aryansin1234/inkdown:latest

Pass the key in requests:

X-API-Key: your-secret-key
# or
Authorization: Bearer your-secret-key
โ Custom Port
docker run -p 8080:8080 -e PORT=8080 aryansin1234/inkdown:latest
โ Restrict CORS Origins
docker run -p 3000:3000 \
  -e INKDOWN_CORS_ORIGINS=https://myapp.com,https://staging.myapp.com \
  aryansin1234/inkdown:latest

โ Environment Variables

VariableDefaultDescription
PORT3000HTTP port the server listens on
INKDOWN_API_KEYS(unset โ€” open)Comma-separated API keys. When set, /api/v1/convert requires authentication.
INKDOWN_CORS_ORIGINS*Allowed CORS origins. Restrict in production.
PUPPETEER_EXECUTABLE_PATH/usr/bin/chromiumPre-configured โ€” no need to change
NODE_ENVproductionNode environment

โ REST API

Base URL: http://localhost:3000/api/v1

โ Health Check
curl http://localhost:3000/api/v1/health
{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "2026-05-16T00:00:00.000Z",
  "formats": ["pdf", "docx"]
}
โ Convert Markdown โ†’ PDF
curl -X POST http://localhost:3000/api/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello\n\nWorld!", "format": "pdf"}' \
  --output document.pdf
โ Convert Markdown โ†’ DOCX
curl -X POST http://localhost:3000/api/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello\n\nWorld!", "format": "docx"}' \
  --output document.docx
โ Convert with Options
curl -X POST http://localhost:3000/api/v1/convert \
  -H "Content-Type: application/json" \
  -d '{
    "markdown": "# Report\n\n## Chapter 1\n\nContent here.",
    "format": "pdf",
    "toc": true,
    "autoBreak": true,
    "title": "My Report"
  }' \
  --output report.pdf
โ Upload a File
curl -X POST http://localhost:3000/api/v1/convert \
  -F "[email protected]" \
  -F "format=pdf" \
  --output README.pdf
โ Convert from URL
curl -X POST http://localhost:3000/api/v1/convert \
  -H "Content-Type: application/json" \
  -d '{"url": "https://raw.githubusercontent.com/Aryansin1234/InkDown/main/README.md", "format": "pdf"}' \
  --output README.pdf
โ With API Key
curl -X POST http://localhost:3000/api/v1/convert \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"markdown": "# Hello", "format": "pdf"}' \
  --output document.pdf
โ Request Parameters
ParameterTypeDefaultDescription
markdownStringโ€”Raw Markdown content (use this or url or file upload)
urlStringโ€”Public HTTPS URL to a .md file
fileFileโ€”Multipart .md file upload
formatpdf | docxpdfOutput format
titleStringfilenameDocument title shown in PDF footer
tocBooleanfalseGenerate a Table of Contents
autoBreakBooleanfalseAuto page-break before every H1

Response: Binary file download with Content-Disposition: attachment. On error: { "error": "...", "code": "..." }


โ Supported Markdown Features

  • GFM tables โ€” pipe, grid, multiline, simple
  • Task lists โ€” - [x] done / - [ ] todo
  • Strikethrough โ€” ~~text~~
  • Footnotes โ€” [^1] with references
  • Definition lists โ€” Term / : Definition
  • Math โ€” inline $...$ and block $$...$$ via KaTeX
  • Mermaid diagrams โ€” fenced ```mermaid code blocks
    • Flowcharts (TD, LR), Sequence, Class, State, ER
    • Gantt charts, Pie charts, Git graphs, Mindmaps
  • Syntax highlighting โ€” 190+ languages via highlight.js
  • Page breaks โ€” <!-- pagebreak --> or <div style="page-break-after: always;"></div>
  • Auto page breaks โ€” optional break before every H1
  • Images โ€” local and remote, auto-inlined as base64
  • Raw HTML โ€” passed through to PDF, sanitized for DOCX

โ What's Inside the Image

ComponentVersionPurpose
node:20-slim20 LTSJavaScript runtime
Chromiumsystem (apt)Headless PDF rendering
Pandocsystem (apt)Native DOCX generation
Puppeteer^24Chrome automation
Mermaid^11Diagram rendering (bundled, no CDN)
marked^13Markdown โ†’ HTML parser
highlight.js^11Syntax highlighting
KaTeX^0.16LaTeX math rendering
Express^5HTTP server

Base image: node:20-slim (Debian) Exposed port: 3000 Image size: ~400 MB Architecture: linux/amd64 Runs as: non-root inkdown user


โ Security

  • Runs as a non-root user (inkdown) inside the container
  • URL fetching blocks private IPs, loopback, and cloud metadata endpoints (169.254.x.x)
  • Image inlining restricted to the document's own directory โ€” path traversal blocked
  • File uploads limited to 50 MB, only .md and .txt accepted
  • Set INKDOWN_API_KEYS to require authentication on the convert endpoint
  • Set INKDOWN_CORS_ORIGINS to restrict browser origins

โ Troubleshooting

IssueSolution
no matching manifest for linux/arm64Add --platform linux/amd64 to docker run
Conversion timeoutLarge documents with many Mermaid diagrams may take longer
DOCX won't open in WordEnsure you're on the latest image โ€” includes Pandoc 3.9 compatibility patches
Port already in useMap a different port: -p 8080:3000
Container exits immediatelyCheck logs: docker logs inkdown


Made with โ˜• โ€” your documents never leave your infrastructure.

Tag summary

Content type

Image

Digest

sha256:05d14c93dโ€ฆ

Size

814.8 MB

Last updated

5 months ago

docker pull aryansin1234/inkdown