Pandoc: Difference between revisions

From wikinotes
No edit summary
Line 28: Line 28:
cat file.rst | pandoc -f rst -t html      # read stdin, render to stdout
cat file.rst | pandoc -f rst -t html      # read stdin, render to stdout
pandoc -f docx input.docx                #
pandoc -f docx input.docx                #
pandoc -o output.pdf -f docx input.docx  #  
pandoc -o output.pdf -f docx input.docx  #
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Usage -->
</blockquote><!-- Usage -->
= Syntax Highlighting =
<blockquote>
pandoc uses [[haskell skylighting]] to render syntaxhighlighting for various output formats.
You can enable this using the <code>pandoc ... --standalone</code> param.
</blockquote><!-- Syntax Highlighting -->

Revision as of 16:33, 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

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.