pandoc 으로 파일 컨버트하기
업데이트: Link
Pandoc 사용하여 파일 컨버트
Homepage: https://pandoc.org/ Manual: https://pandoc.org/MANUAL.html
install pandoc
웹사이트의 download 페이지에서 다운로드 받아 설치하거나 mac 사용자라면 brew 를 통해 설치할 수 있다.
brew install pandoc
convert file
하나의 파일만 포멧한다면 아래의 형식으로 terminal 창에 명령을 입력해 컨버팅할 수 있다.
# excample: pandoc {original_file_path} -f {original_file_format} -t {output_file_format} -s -o {output_file_path}
pandoc ./origin.md -f markdown -t docx -s -o converted.docx
사용 가능한 input file formats
Specify input format. FORMAT can be:
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 accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.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)- the path of a custom Lua reader, see Custom readers and writers below
사용 가능한 output file formats
Specify output format. FORMAT can be:
asciidoc
(AsciiDoc) orasciidoctor
(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
ordocbook4
(DocBook 4)docbook5
(DocBook 5)docx
(Word docx)dokuwiki
(DokuWiki markup)epub
orepub3
(EPUB v3 book)epub2
(EPUB v2)fb2
(FictionBook2 e-book)gfm
(GitHub-Flavored Markdown), or the deprecated and less accuratemarkdown_github
; usemarkdown_github
only if you need extensions not supported ingfm
.haddock
(Haddock markup)html
orhtml5
(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 forjats_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 readers and writers below
convert directory
sh 파일을 만들어서 루프 실행
find ./ -iname "*.md" -type f -exec sh -c 'pandoc "${0}" -f markdown -t docx -s -o "${0%.md}.docx"' {} \;
댓글남기기