From 371b80baa2a27a1d0bd1d42a3599b62e628f4d7d Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Tue, 9 Jan 2024 18:16:34 +0100 Subject: [PATCH] feat: pandoc knowledge base article --- .vscode/settings.json | 2 ++ knowledge base/pandoc.md | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 knowledge base/pandoc.md diff --git a/.vscode/settings.json b/.vscode/settings.json index f20063a..c4bc2e4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -113,6 +113,7 @@ "opkg", "pacman", "pamac", + "pandoc", "passwordless", "pihole", "pinentry", @@ -128,6 +129,7 @@ "rfkill", "ripsecrets", "rmmod", + "roff", "rootlv", "rootvg", "runcmd", diff --git a/knowledge base/pandoc.md b/knowledge base/pandoc.md new file mode 100644 index 0000000..c1ea308 --- /dev/null +++ b/knowledge base/pandoc.md @@ -0,0 +1,53 @@ +# Pandoc + +1. [TL;DR](#tldr) +1. [Further readings](#further-readings) +1. [Sources](#sources) + +## TL;DR + +```sh +# Install. +apt install 'pandoc' +brew install 'pandoc' +dnf install 'pandoc' +yum install 'pandoc' +zypper install 'pandoc-cli' + +# Convert between formats. +# If the format is not specified, it will try to guess. +pandoc -f 'html' -t 'markdown' 'input.html' +pandoc -r 'html' -w 'markdown' 'https://www.fsf.org' +pandoc --from 'markdown' --write 'docx' 'input.md' +pandoc --read 'markdown' --to 'rtf' 'input.md' +pandoc -o 'output.tex' 'input.txt' +pandoc -s --output 'output.pdf' 'input.html' + +# Convert to PDF. +# The default way leverages LaTeX, requiring a LaTeX engine to be installed. +# Alternative engines allow ConTeXt, roff ms or HTML as intermediate formats. +pandoc … 'input.html' +pandoc … --pdf-engine 'context' 'https://www.fsf.org' +pandoc … --pdf-engine 'html' -c 'style.css' 'input.html' +``` + +## Further readings + +- [Website] + +## Sources + +All the references in the [further readings] section, plus the following: + +- [Creating a PDF] + + + + +[further readings]: #further-readings + + +[creating a pdf]: https://pandoc.org/MANUAL.html#creating-a-pdf +[website]: https://pandoc.org/