Pandoc: Difference between revisions

From wikinotes
Line 48: Line 48:
You can dump the raw template (which is rendered using [[haskell doctemplates]]) with
You can dump the raw template (which is rendered using [[haskell doctemplates]]) with
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
pandoc document-css --print-default-data-file=templates/styles.html
pandoc --print-default-data-file=templates/styles.html
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Syntax Highlighting -->
</blockquote><!-- Syntax Highlighting -->

Revision as of 20:00, 9 July 2022

Text format converter.

Documentation

man pandoc https://man.archlinux.org/man/community/pandoc/pandoc.1.en
github https://github.com/jgm/pandoc

Locations

/usr/share/pandoc/data/templates/styles.html css partial/template

Usage

pandoc --list-input-formats
pandoc --list-extensions

pandoc \
    -f ${IN_FORMAT} \
    -t ${TO_FORMAT} \
    -o ${OUTFILE}

Examples

cat file.rst | pandoc -f rst -t html      # read stdin, render to stdout
pandoc -f docx input.docx                #
pandoc -o output.pdf -f docx input.docx  #

Syntax Highlighting

pandoc uses haskell skylighting to render syntaxhighlighting for various output formats.
You can enable this using the pandoc ... --standalone param.

You can dump the raw template (which is rendered using haskell doctemplates) with

pandoc --print-default-data-file=templates/styles.html