https://github.com/lostatc/markdown.css
Style sheets for rendering Markdown as a pretty PDF
https://github.com/lostatc/markdown.css
markdown pandoc weasyprint
Last synced: over 1 year ago
JSON representation
Style sheets for rendering Markdown as a pretty PDF
- Host: GitHub
- URL: https://github.com/lostatc/markdown.css
- Owner: lostatc
- License: mit
- Created: 2024-06-09T13:58:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-28T04:21:44.000Z (over 1 year ago)
- Last Synced: 2025-01-22T03:46:03.569Z (over 1 year ago)
- Topics: markdown, pandoc, weasyprint
- Language: CSS
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown.css
This repository contains a collection of CSS stylesheets for rendering markdown
files as pretty PDFs via Pandoc/WeasyPrint.
To render a markdown file with the Beryl theme using Pandoc:
```shell
pandoc --pdf-engine weasyprint --css ./themes/beryl.css -o output.pdf input.md
```
*WeasyPrint is the default PDF engine as of Pandoc 3.4. If you're running
Pandoc 3.4 or higher, you can omit the `--pdf-engine weasyprint` parameter.*
## Themes
Below are examples of each theme provided in this repository.
### Beryl
- [Headings, inline markup, blockquotes, lists](./examples/beryl-typography.png)
- [Code blocks, tables](./examples/beryl-data.png)
- [Callouts](./examples/beryl-callouts.png)
### Stain
- [Headings, inline markup, blockquotes, lists](./examples/stain-typography.png)
- [Code blocks, tables](./examples/stain-data.png)
### Mark
- [Headings, inline markup, blockquotes, lists](./examples/mark-typography.png)
- [Code blocks, tables](./examples/mark-data.png)
### Lotus
- [Headings, inline markup, blockquotes, lists](./examples/lotus-typography.png)
- [Code blocks, tables](./examples/lotus-data.png)
## Callouts
The Beryl theme supports callouts, implemented entirely in CSS.
- [Markdown syntax example](./examples/beryl-callouts.md)
- [Generated PDF example](./examples/beryl-callouts.png)
## Page layout
These stylesheets use US Letter size pages by default. You can configure the
page size and margins by modifying the `@page` rule near the top of each CSS
file.
To use A4 size pages instead:
```css
@page {
size: A4;
margin: 0.5in;
background-color: var(--bg-color);
}
```
## Generating examples
The example images in this repo are generated using the
[Nushell](https://www.nushell.sh/) script
[./render-examples.nu](./render-examples.nu).