Use pandoc simple tutorial

Use as a filter pandoc

Types of

pandoc

And press Enter. You should see the cursor is out there, waiting for you to type something. Input:

Hello *pandoc*!

- one
- two

When you have finished (the cursor should be at the beginning of the line), type [ Ctrl-DOS on]
the X-or Linux, or [ Ctrl-Z] then [ Enter] on Windows. You should now see your text converted to HTML!

<p>Hello <em>pandoc</em>!</p>
<ul>
<li>one</li>
<li>two</li>
</ul>

What just happened? When calling pandoc without specifying any input file, as it will "filter" operation, and outputs the acquired input terminal sent back from the terminal. You can use this feature to play pandoc.

By default, the input is interpreted as pandoc
Markdown, output as HTML. But we can change that. Let's try from converting HTML to
markdown:

pandoc -f html -t markdown

Now enter:

<p>Hello <em>pandoc</em>!</p>

And hit [ Ctrl-D] {.} Nowrap (or [ Ctrl-Z] {.} After nowrap [ Enter] {.} Nowrap on Windows). You should see:

Hello *pandoc*!
pandoc test1.md -f markdown -t html -s -o test1.html

File name test1.md tell the file you want to convert pandoc. The -s option is said to create an "independent" file with headers and footers, and not just a fragment. And -o test1.html said the output in a file in test1.html. Please note that we can -f markdown and -t html omitted because the default price is converted from HTML, but it does not hurt to include them.

Guess you like

Origin www.cnblogs.com/sogeisetsu/p/11372638.html