Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/georgiifirsov/md_to_pdf
Simple utility to convert from markdown format into pretty PDF document. It is written in Rust programming language.
https://github.com/georgiifirsov/md_to_pdf
markdown pdf pdf-converter rust rust-lang rust-language
Last synced: about 1 month ago
JSON representation
Simple utility to convert from markdown format into pretty PDF document. It is written in Rust programming language.
- Host: GitHub
- URL: https://github.com/georgiifirsov/md_to_pdf
- Owner: GeorgiiFirsov
- License: gpl-3.0
- Created: 2021-05-04T10:36:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T15:38:24.000Z (6 months ago)
- Last Synced: 2024-10-12T13:22:28.323Z (about 1 month ago)
- Topics: markdown, pdf, pdf-converter, rust, rust-lang, rust-language
- Language: Rust
- Homepage:
- Size: 718 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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][1] 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
```shell
./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](./docs/images/example.png)[1]: https://wkhtmltopdf.org/downloads.html