Skip to content

chu23465/markdown-to-pdf

Repository files navigation

Markdown to PDF converter

Markdown TypeScript WebAssembly Bun Code Style: Google

The simplest Markdown To PDF Converter you've ever seen. No unnecessary frameworks, no BS, no fucking API calls, definitely no React. Website is ~370 KB gzip compressed.

Woprking - Converts a Markdown string/file to HTML using comrak-wasm, styles using GitHub Markdown CSS.

Automatically lints pushed code to Google TypeScript standard using gts.

Requirements:

To run locally, first clone the repository:

git clone --depth 1 https://github.com/chu23465/markdown-to-pdf

Then, to install dependencies:

cd markdown-to-pdf
bun install

There's a known bug in bun (Windows) that surfaces as a EINVAL lockfile error. If the working project directory is not in the primary drive where the OS install is located, it sometimes errors out. If that happens during install:

bunx jsr install @nick/comrak --npm

To run in Debug mode:

bun run ./debug.html

Various helper scripts

bun run <scriptname>

Scripts:-

Script Name Function
devDebug Lints and runs debug.html
debugBundle Debug bundler
bundle Production ready build folder for distribution
prodTest Tests production build in browser
lint Google TypeScript standard linting using gts
clean Clean gts output files
fix Formats files according to Google TypeScript
typecheck Type checking using tsc

This project was created using bun init. Bun is a fast all-in-one JavaScript runtime.

Warning

There is some absolutely cursed behavior in index.ts. Stay away for the sake of your sanity.

About

Simplest (~370 KB gzip compressed) Markdown To PDF Converter.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors