Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdpdf

mdpdf reads Markdown, parses it into an mdast syntax tree with the markdown crate, and renders that tree to PDF with genpdf.

Usage

cargo run -- document.md
cargo run -- document.md --output document.pdf
cat document.md | cargo run -- - --output document.pdf

When no output path is provided, file input uses the same name with a .pdf extension. Stdin input uses output.pdf.


Supported Markdown Examples

All the common things are supported

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Paragraphs And Inline Formatting

This is a paragraph with strong text, emphasized text, both even, deleted text, and inline code.

Links preserve their readable text: the Rust website.

This line has a hard break.
The next sentence follows it.

Also headings can contain styling

Lists

  • An unordered item
  • An item with nested content
    • A nested unordered item
    • Another nested item
  • The final unordered item
  1. An ordered item
  2. Another ordered item

Block Quotes

A block quote has a frame around it.

It can contain multiple paragraphs.

Code Blocks

fn main() {
println!("Hello from a monospaced code block");
}

Thematic Break


Local Images

Images are resolved relative to this Markdown file:

A small happy frog

inline image A small happy frog is a thing

GFM Tables

Feature Status Notes
Headings Supported Six levels
Code Supported Monospaced
Tables Supported GFM syntax
italics bold inline

Remote images, raw HTML, MDX, and mathematical notation are not rendered yet. Local image paths must exist when the Markdown file is converted.

About

CLI to convert Markdown to tiny beautiful PDFs

Topics

Resources

Stars

22 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages