Skip to content

Simple utility to convert from markdown format into pretty PDF document. It is written in Rust programming language.

License

Notifications You must be signed in to change notification settings

GeorgyFirsov/md_to_pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

md_to_pdf

Brief

Simple utility to convert from Markdown format into pretty PDF document. It is written in Rust programming language using several libraries:

  • comrak to convert markdown into HTML,
  • wkhtmltopdf to parse HTML with embedded CSS and render PDF document.

How it works

This small console app converts Markdown text directly into HTML document, which is extended and decorated by CSS styles. Full CSS style is embedded into the application as a resource and then inserted into the HTML document. After that application parses some HTML tokens and extends them by adding custom classes to them. This HTML document is converted into PDF file.

Installing

Linux and macOS

Depends on wkhtmltopdf that can be downloaded and installed with a package manager as such as apt, pacman or Homebrew. After installing this dependency run:

cargo install --git https://github.com/GeorgyFirsov/md_to_pdf.git

Usage

./md_to_pdf -i ../my_awesome_document.md -o ../output/my_awesome_document.pdf

Example

Current Markdown document (this README.md) is converted into the following PDF: Example

About

Simple utility to convert from markdown format into pretty PDF document. It is written in Rust programming language.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published