cli-pandoc
Skill3 starsChanged 8 months agoMITView on GitHub
Covers effective use of Pandoc for converting between document formats including Markdown, HTML, DOCX, PDF, EPUB, LaTeX, and dozens more. Activates when the user wants to convert documents, generate PDFs from Markdown, create slide decks, manage citations, or batch-convert between wiki/documentation formats.
In this repository95 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-architectSkill
- architect-plan-for-dispatchSkill
- automate-auditSkill
- brain-dumpSkill
- chat-to-code-promptSkill
- cli-apifySkill
- cli-batSkill
- cli-duckdbSkill
- cli-fdSkill
- cli-ffmpegSkill
- cli-fzfSkill
- cli-ghSkill
- cli-httpieSkill
- cli-imagemagickSkill
- cli-jqSkill
- cli-lazygitSkill
- cli-playwrightSkill
- cli-ripgrepSkill
- cli-sqliteSkill
- cli-yqSkill
- cli-yt-dlpSkill
- codebase-reviewSkill
- context-summarySkill
- decomposeSkill
- delegateSkill
- design-a-systemSkill
- design-doc-reviewSkill
- devils-advocateSkill
- gh-repo-createSkill
- ig-savesSkill
- interrogateSkill
- mentor-aristotleSkill
- mentor-attiaSkill
- mentor-aureliusSkill
- mentor-bloomSkill
- mentor-brownSkill
- mentor-buffettSkill
- mentor-builderSkill
- mentor-carnegieSkill
- mentor-clearSkill
- mentor-councilSkill
- mentor-cunninghamSkill
- mentor-dalioSkill
- mentor-davinciSkill
- mentor-demingSkill
- mentor-ferrissSkill
- mentor-feynmanSkill
- mentor-franklSkill
- mentor-garyveeSkill
- mentor-godinSkill
- mentor-gogginsSkill
- mentor-greeneSkill
- mentor-holidaySkill
- mentor-hormoziSkill
- mentor-houselSkill
- mentor-jockoSkill
- mentor-jungSkill
- mentor-kahnemanSkill
- mentor-kingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 344
cli-imagemagick: Use ImageMagick to resize or optimize images before embedding them in Pandoc documents.
- Very specific: line 345
fd:: Use fd -e md to find all Markdown files in a project, then pipe into a batch Pandoc conversion loop
- Very specific: line 346
cli-fzf (fzf): Use fd -e md | fzf to interactively select a document before running pandoc on it
- Very specific: line 347
jq/yq: Use yq to manipulate YAML metadata blocks before passing documents to Pandoc.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pandoc — Universal Document Converter
Repo: https://github.com/jgm/pandoc
Convert between Markdown, HTML, DOCX, PDF, EPUB, LaTeX, reStructuredText, and 40+ other formats. The definitive tool for document format conversion.
When to Activate
Manual triggers:
- "Convert Markdown to PDF/DOCX/HTML"
- "Generate a PDF from my notes"
- "Create slides from Markdown"
- "Convert between document formats"
- "Add a table of contents to this doc"
Auto-detect triggers:
- User has a
.mdfile and needs a different format for sharing - User is writing documentation and needs it in multiple output formats
- User mentions citations, bibliographies, or academic writing
- User wants to convert wiki/Confluence/Notion exports to another format
Key Commands
Basic Conversion
pandoc input.md -o output.pdf # Markdown to PDF (via LaTeX)
pandoc input.md -o output.docx # Markdown to Word
pandoc input.md -o output.html # Markdown to HTML
pandoc input.html -o output.md # HTML to Markdown
pandoc input.docx -o output.md # Word to Markdown (extract content)
pandoc input.md -o output.epub # Markdown to EPUB
pandoc input.md -o output.tex # Markdown to LaTeX sourceSpecify Formats Explicitly (-f / -t)
pandoc -f markdown -t html input.md -o output.html
pandoc -f docx -t markdown input.docx -o output.md
pandoc -f rst -t markdown input.rst -o output.md
pandoc -f mediawiki -t markdown input.wiki -o output.md
pandoc -f org -t markdown input.org -o output.mdList All Supported Formats
pandoc --list-input-formats # All formats Pandoc can read
pandoc --list-output-formats # All formats Pandoc can writeHTML Output
# Standalone HTML (includes <html><head> tags)
pandoc input.md -o output.html --standalone
# With custom CSS
pandoc input.md -o output.html --standalone --css=style.css
# Embed CSS inline
pandoc input.md -o output.html --standalone \
--variable=css:"body { font-family: sans-serif; max-width: 800px; margin: auto; }"
# Self-contained HTML (embeds images, CSS, JS)
pandoc input.md -o output.html --standalone --self-containedPDF Output
PDF generation requires a PDF engine. Pandoc supports several:
# Via LaTeX (best quality, requires TeX Live or MacTeX)
pandoc input.md -o output.pdf --pdf-engine=pdflatex
pandoc input.md -o output.pdf --pdf-engine=xelatex # Unicode/font support
pandoc input.md -o output.pdf --pdf-engine=lualatex
# Via wkhtmltopdf (HTML-based, no LaTeX needed)
pandoc input.md -o output.pdf --pdf-engine=wkhtmltopdf
# Via weasyprint (CSS-based)
pandoc input.md -o output.pdf --pdf-engine=weasyprintPDF Page and Margin Settings
pandoc input.md -o output.pdf \
-V geometry:margin=1in \
-V geometry:papersize=letter \
-V fontsize=12pt \
-V mainfont="Georgia"DOCX Output
# Basic Word output
pandoc input.md -o output.docx
# Apply a reference document for styles
pandoc input.md -o output.docx --reference-doc=template.docx
# Generate a default reference doc to customize
pandoc --print-default-data-file reference.docx > template.docxTable of Contents
pandoc input.md -o output.pdf --toc # Add TOC
pandoc input.md -o output.pdf --toc --toc-depth=2 # TOC up to H2
pandoc input.md -o output.html --toc --standalone # TOC in HTML
pandoc input.md -o output.docx --toc # TOC in WordMetadata
Command-line Metadata
pandoc input.md -o output.pdf \
--metadata title="My Document" \
--metadata author="Jane Smith" \
--metadata date="2024-03-28"YAML Metadata Block (in Markdown file)
---
title: "My Document"
author: "Jane Smith"
date: "2024-03-28"
abstract: "This document covers..."
lang: "en"
---
# Introduction
...Metadata File
# Store metadata separately
pandoc input.md --metadata-file=meta.yaml -o output.pdfTemplates
Use a Custom Template
pandoc input.md -o output.pdf --template=mytemplate.tex
pandoc input.md -o output.html --template=mytemplate.htmlPrint Default Template (to customize)
pandoc --print-default-template=latex > template.tex
pandoc --print-default-template=html5 > template.htmlTemplate Variables
pandoc input.md -o output.pdf \
--variable=documentclass:article \
--variable=classoption:twocolumn \
--variable=fontfamily:palatinoSlide Decks
reveal.js (HTML slides)
pandoc input.md -o slides.html -t revealjs --standalone
pandoc input.md -o slides.html -t revealjs \
--variable=theme:moon \
--variable=transition:slide \
--standalone
# Self-contained (embed reveal.js)
pandoc input.md -o slides.html -t revealjs --self-containedBeamer (PDF slides via LaTeX)
pandoc input.md -o slides.pdf -t beamer
pandoc input.md -o slides.pdf -t beamer \
--variable=theme:metropolis \
--variable=colortheme:craneSlide Structure in Markdown
# Section Title (becomes a section divider)
## Slide Title
Content for this slide.
- Bullet one
- Bullet two
## Next Slide
---
(Horizontal rule creates a new slide without a title)Citations and Bibliographies
# Add citations (BibTeX, CSL JSON, etc.)
pandoc input.md -o output.pdf \
--bibliography=references.bib \
--csl=apa.csl \
--citeproc
# Popular CSL styles (download from https://github.com/citation-style-language/styles)
# chicago-author-date.csl, ieee.csl, nature.csl, apa.csl
# Inline citation syntax in Markdown
# [@smith2024] — author-date
# [-@smith2024] — suppress author
# [@smith2024, p. 42] — page numberLua Filters
Filters let you transform the document AST programmatically.
pandoc input.md -o output.html --lua-filter=my-filter.luaExample Lua Filter (make all links open in new tab)
-- newwindow.lua
function Link(el)
el.attributes.target = "_blank"
return el
endpandoc input.md -o output.html --lua-filter=newwindow.lua --standaloneAdvanced Patterns
Batch Conversion with fd
# Convert all Markdown files in a project to HTML
fd -e md | while read f; do
pandoc "$f" -o "${f%.md}.html" --standalone
done
# Markdown to PDF for all files in docs/
fd -e md . docs/ | while read f; do
pandoc "$f" -o "pdf/$(basename ${f%.md}).pdf" --pdf-engine=xelatex
doneConcatenate Multiple Files
# Single PDF from multiple Markdown files (ordered)
pandoc chapter1.md chapter2.md chapter3.md -o book.pdf --toc
# Combine all Markdown files in a directory
cat *.md | pandoc -f markdown -o combined.pdfInclude Files (Markdown Extension)
!include chapter1.md
!include chapter2.mdpandoc --lua-filter=include-files.lua input.md -o output.pdf
# (requires https://github.com/pandoc/lua-filters/tree/master/include-files)Convert Confluence / MediaWiki
# Confluence storage format to Markdown
pandoc -f html -t markdown confluence-export.html -o output.md
# MediaWiki to Markdown
pandoc -f mediawiki -t gfm input.wiki -o output.md # GitHub-flavored Markdown
# Org-mode to Markdown
pandoc -f org -t markdown input.org -o output.mdProfessional PDF with Custom LaTeX Template
# Minimal LaTeX template variables for clean PDFs
pandoc input.md -o output.pdf \
--pdf-engine=xelatex \
-V geometry:margin=1in \
-V fontsize=11pt \
-V mainfont="Palatino" \
-V monofont="JetBrains Mono" \
-V colorlinks=true \
-V linkcolor=blue \
--highlight-style=tango \
--tocHTML to Clean Markdown (web scraping aid)
# Fetch a web page and convert to Markdown
curl -s https://example.com/article | pandoc -f html -t markdown -o article.md
# Remove extra blank lines
pandoc -f html -t markdown --wrap=none input.html -o output.mdSupported Formats Reference
| Direction | Formats |
| Read (input) | Markdown (CommonMark, GFM, MMD, Pandoc), HTML, DOCX, ODT, LaTeX, EPUB, RST, Org, MediaWiki, Textile, JATS, OPML, CSV |
| Write (output) | All of above + PDF, reveal.js, Beamer, DokuWiki, Jira, ICML (InDesign), Jupyter, man page, PowerPoint (PPTX) |
Markdown Flavor Options
pandoc -f commonmark # CommonMark spec
pandoc -f gfm # GitHub-Flavored Markdown
pandoc -f markdown # Pandoc's extended Markdown (default, most features)
pandoc -f markdown-smart # Disable smart punctuationChaining with Other Skills
- cli-imagemagick: Use ImageMagick to resize or optimize images before embedding them in Pandoc documents; convert PDF output pages to PNG with ImageMagick
- fd: Use
fd -e mdto find all Markdown files in a project, then pipe into a batch Pandoc conversion loop - cli-fzf (fzf): Use
fd -e md | fzfto interactively select a document before runningpandocon it - jq/yq: Use
yqto manipulate YAML metadata blocks before passing documents to Pandoc; usejqto work with Pandoc's JSON AST format (pandoc -t json)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

