ColinOL

A Small Website

用户工具

站点工具


wiki:app:pandoc

Pandoc 标记语言转换

Pandoc是使用Haskell语言编写的一款跨平台、自由开源及命令行界面的标记语言转换工具,可实现不同标记语言间的格式转换,堪称该领域中的“瑞士军刀”。

以在windows中的使用方法为例:

  1. 下载最新版本,安装或解压缩到相应目录 pandoc-2.16.2-windows-x86_64.msi pandoc-2.16.2-windows-x86_64.zip
  2. 使用运行命令进行格式转换

示例1:dokuwiki格式转换为markdown格式,并导出

.\pandoc.exe -f markdown -t dokuwiki markdownfile.md -o dokuwikifile.txt

示例2:markdown格式转换为dokuwiki格式,并导出

.\pandoc.exe -f dokuwiki -t markdown dokuwikifile.txt -o markdownfile.md 

其他参考

  1. 使用pandoc转换md为PDF并添加中文支持 https://www.jianshu.com/p/7f9a9ff053bb

Pandoc 支持多种文件格式之间的转换:

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. It can convert from

  • bibtex (BibTeX bibliography)
  • biblatex (BibLaTeX bibliography)
  • commonmark (CommonMark Markdown)
  • commonmark_x (CommonMark Markdown with extensions)
  • creole (Creole 1.0)
  • csljson (CSL JSON bibliography)
  • csv (CSV table)
  • docbook (DocBook)
  • docx (Word docx)
  • dokuwiki (DokuWiki markup)
  • epub (EPUB)
  • fb2 (FictionBook2 e-book)
  • gfm (GitHub-Flavored Markdown), or the deprecated and less accurate markdown_github; use markdown_github only if you need extensions not supported in gfm.
  • haddock (Haddock markup)
  • html (HTML)
  • ipynb (Jupyter notebook)
  • jats (JATS XML)
  • jira (Jira/Confluence wiki markup)
  • json (JSON version of native AST)
  • latex (LaTeX)
  • markdown (Pandoc’s Markdown)
  • markdown_mmd (MultiMarkdown)
  • markdown_phpextra (PHP Markdown Extra)
  • markdown_strict (original unextended Markdown)
  • mediawiki (MediaWiki markup)
  • man (roff man)
  • muse (Muse)
  • native (native Haskell)
  • odt (ODT)
  • opml (OPML)
  • org (Emacs Org mode)
  • rtf (Rich Text Format)
  • rst (reStructuredText)
  • t2t (txt2tags)
  • textile (Textile)
  • tikiwiki (TikiWiki markup)
  • twiki (TWiki markup)
  • vimwiki (Vimwiki)

It can convert to

  • asciidoc (AsciiDoc) or asciidoctor (AsciiDoctor)
  • beamer (LaTeX beamer slide show)
  • bibtex (BibTeX bibliography)
  • biblatex (BibLaTeX bibliography)
  • commonmark (CommonMark Markdown)
  • commonmark_x (CommonMark Markdown with extensions)
  • context (ConTeXt)
  • csljson (CSL JSON bibliography)
  • docbook or docbook4 (DocBook 4)
  • docbook5 (DocBook 5)
  • docx (Word docx)
  • dokuwiki (DokuWiki markup)
  • epub or epub3 (EPUB v3 book)
  • epub2 (EPUB v2)
  • fb2 (FictionBook2 e-book)
  • gfm (GitHub-Flavored Markdown), or the deprecated and less accurate markdown_github; use markdown_github only if you need extensions not supported in gfm.
  • haddock (Haddock markup)
  • html or html5 (HTML, i.e. HTML5/XHTML polyglot markup)
  • html4 (XHTML 1.0 Transitional)
  • icml (InDesign ICML)
  • ipynb (Jupyter notebook)
  • jats_archiving (JATS XML, Archiving and Interchange Tag Set)
  • jats_articleauthoring (JATS XML, Article Authoring Tag Set)
  • jats_publishing (JATS XML, Journal Publishing Tag Set)
  • jats (alias for jats_archiving)
  • jira (Jira/Confluence wiki markup)
  • json (JSON version of native AST)
  • latex (LaTeX)
  • man (roff man)
  • markdown (Pandoc’s Markdown)
  • markdown_mmd (MultiMarkdown)
  • markdown_phpextra (PHP Markdown Extra)
  • markdown_strict (original unextended Markdown)
  • mediawiki (MediaWiki markup)
  • ms (roff ms)
  • muse (Muse),
  • native (native Haskell),
  • odt (OpenOffice text document)
  • opml (OPML)
  • opendocument (OpenDocument)
  • org (Emacs Org mode)
  • pdf (PDF)
  • plain (plain text),
  • pptx (PowerPoint slide show)
  • rst (reStructuredText)
  • rtf (Rich Text Format)
  • texinfo (GNU Texinfo)
  • textile (Textile)
  • slideous (Slideous HTML and JavaScript slide show)
  • slidy (Slidy HTML and JavaScript slide show)
  • dzslides (DZSlides HTML5 + JavaScript slide show),
  • revealjs (reveal.js HTML5 + JavaScript slide show)
  • s5 (S5 HTML and JavaScript slide show)
  • tei (TEI Simple)
  • xwiki (XWiki markup)
  • zimwiki (ZimWiki markup)
  • the path of a custom Lua writer, see Custom writers below
wiki/app/pandoc.txt · 最后更改: 2021/12/31 01:45 由 colin