1
0
Fork 0
mirror of https://github.com/benedictdudel/pandoc-letter-din5008.git synced 2024-08-16 10:19:49 +02:00

Update project description and usage guide

This commit is contained in:
Benedict Dudel 2022-12-19 23:00:20 +01:00
parent ead56427fa
commit 49f187427d

View file

@ -1,88 +1,47 @@
# Pandoc Letter Template (DIN 5008) # Pandoc Letter Template (DIN 5008)
## Description [Pandoc](https://pandoc.org/) template for writing letters in Markdown and converting them into PDFs
that follow the German national standard DIN 5008 for letter formatting. By using this
template, you can more efficiently create professional-looking letters in a
clean and organized manner. The template is customizable, so you can tailor it
to your specific needs.
This template allows you to write simple letters in Markdown and convert them ## Preview
into nice looking PDFs. The template is based on Koma Script and satisfies
the German DIN 5008 norm for letters.
## Example
A simple letter in Markdown looks like the following:
```markdown
---
author: Max Mustermann
phone: +49 1234 56789
email: max.mustermann@beispiel.de
date: 01.08.2016
place: Musterstadt
subject: Titel vom Brief
return-address:
- Musterstraße
- 12345 Berlin
address:
- Musterfirma GmbH
- Max Mustermann
- Musterstraße
- 12345 Musterstadt
opening: Sehr geehrte Damen und Herren,
closing: Mit freundlichen Grüßen
enclosed: Muster, Muster, Muster
ps: |
\textbf{Postskriptum \today}
Noch ein Gedanke zum Schluss.
...
```
The compiled result will then look like this:
![alt Letter](https://github.com/benedu/pandoc-letter/raw/master/example/letter.png) ![alt Letter](https://github.com/benedu/pandoc-letter/raw/master/example/letter.png)
You can also download the compiled PDF [here](https://github.com/benedu/pandoc-letter/raw/master/example/letter.pdf).
## Requirements ## Requirements
In order to use the template you must have installed the following components:
- [Pandoc](http://pandoc.org/installing.html) - [Pandoc](http://pandoc.org/installing.html)
- [LaTeX](https://latex-project.org/ftp.html) - [LaTeX](https://latex-project.org/ftp.html)
- [csquotes](https://ctan.org/pkg/csquotes)
## Usage ## Usage
Before you can make use of the template you need to move the LaTeX template file Clone this repository or download the template with the following command:
into Pandocs template directory:
``` ```bash
mkdir -p ~/.pandoc/templates curl https://raw.githubusercontent.com/benedictdudel/pandoc-letter-din5008/master/letter.latex --create-dirs -o ~/.pandoc/templates/letter.latex
mv your-repo-path/letter.latex ~/.pandoc/templates/
``` ```
After creating a letter written in Markdown you can compile it into PDF with the Write your letter in markdown, using the provided [`example/letter.md`](https://raw.githubusercontent.com/benedictdudel/pandoc-letter-din5008/master/example/letter.md) file as a
following line: guide. You can download the example `letter.md` file with the following command:
`pandoc letter.md -s -o letter.pdf --template="letter"` ```bash
curl https://raw.githubusercontent.com/benedictdudel/pandoc-letter-din5008/master/example/letter.md -o letter.md
```
To convert the markdown file to a PDF run:
## Configuration ```bash
pandoc letter.md -s -o letter.pdf --template="letter"
```
The following yaml variables are supported: ## Customization
- `opening` You can customize the look and feel of the generated PDF by modifying the
- `closing` variables. See [`example/letter.md`](https://raw.githubusercontent.com/benedictdudel/pandoc-letter-din5008/master/example/letter.md) for a full list of available variables.
- `enclosed`
- `ps`
- `author`
- `phone`
- `email`
- `place`
- `subject`
- `return-address`
- `address`
If you want to add some options to the `scrlttr2` document class, you can list ## Contact
them via the `letteroption` yaml variable.
If you have any questions, feel free to open an issue [here](https://github.com/benedictdudel/pandoc-letter-din5008/issues) or contact me via twitter at [@benedictdudel](https://twitter.com/benedictdudel)