Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
 
maxLevel4


Haskell 로 만들어진 converter 로 markdown, MediaWiki, textile, HTML, ms 워드(.docx), epub, PDF 등으로 변환이 가능한 유틸리티

설치

수동으로 설치

https://github.com/jgm/pandoc/releases 에 연결후 맨 아래 Downloads에서 사용하는 OS 에 맞는 버전 다운로드 

  • Windows

...

...

Package manager 로 설치

h4. CentOS
Code Block
yum install pandoc
Ubuntu
Code Block
sudo apt install pandoc


OS X
Code Block
brew install pandoc
Windows
Code Block
choco install pandoc
Code Block
scoop install pandoc

PDF 출력

pdf로 만들려면 Latex 패키지를 설치해야 하며 권장하는 패키지는 OS 마다 다름

Windows 에서는 https://miktex.org/ 를 OS X 는 http://www.tug.org/mactex/morepackages.html 를 설치하고 필요한 패키지는 tex의 패키지 매니저 사용

주요 옵션

Note

옵션 뒤에 파라미터가 있는 것은 파라미터 필수인 옵션(Ex: -o FILENAME)

옵션의미예제
-o FILENAME, --output=FILENAME저장할 파일명
-f FORMAT, --from=FORMAT소스 포맷
-t FORMAT,--to=FORMAT저장할 포맷

--toc

목차 생성
-S, --smartpandoc 이 소스 포맷을 판단해서 처리
-s, --standalone파일이 아닌 STDIN 에서 입력 수행
-c URL, --css=URL             변환시 사용할 CSS 의 URL
-H FILENAME, --include-in-header=FILENAME FILENAME 을 HEADER 로 사용
-A FILENAME, --include-after-body=FILENAMEFILENAME 을 footer 로 사용




사용 예제

cmd 나 쉘에서 pandoc 명령어로 원하는 포맷으로 변환

 


markdown 변환

...

Code Block
titletest.md
# Test!

This is a test of *pandoc*.

- list one
- list two

...


cmd 나 쉘에서 다음 명령어 실행

Code Block
pandoc test1.md -f markdown -t html -s -o test1.html

...

Expand
Code Block
languagexml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<h1 id="test">Test!</h1>
<p>This is a test of <em>pandoc</em>.</p>
<ul>
<li>list one</li>
<li>list two</li>
</ul>
</body>
</html>

markdown 을 MS WORD(docx) 로 변환


 

Code Block
pandoc test1.md -f markdown -t docx -s -o test1.docx

 

...


Asciidoc 변환


Code Block
pandoc -o security-basic.asciidoc security-basic.md


Ref

...