title | author | date |
---|---|---|
Markdown to HTML test page |
John |
May 10, 2018 |
Create the page with pandoc -s test.md -o out.html --css=simple_floatTOC_wnormalize.css --template=template.html --mathjax --toc --toc-depth=1
pandoc
[options] [input-file]...
Pandoc is a [Haskell] library for converting from one markup format to another, and a command-line tool that uses this library.
Pandoc can convert between numerous markup and word processing formats,
including, but not limited to, various flavors of [Markdown], [HTML],
[LaTeX] and [Word docx]. For the full lists of input and output formats,
see the --from
and --to
[options below][General options].
Pandoc can also produce [PDF] output: see [creating a PDF], below.
Pandoc's enhanced version of Markdown includes syntax for [tables], [definition lists], [metadata blocks], [footnotes], [citations], [math], and much more. See below under [Pandoc's Markdown].
Pandoc has a modular design: it consists of a set of readers, which parse text in a given format and produce a native representation of the document (an abstract syntax tree or AST), and a set of writers, which convert this native representation into a target format. Thus, adding an input or output format requires only adding a reader or writer. Users can also run custom [pandoc filters] to modify the intermediate AST.
Because pandoc's intermediate representation of a document is less expressive than many of the formats it converts between, one should not expect perfect conversions between every format and every other. Pandoc attempts to preserve the structural elements of a document, but not formatting details such as margin size. And some document elements, such as complex tables, may not fit into pandoc's simple document model. While conversions from pandoc's Markdown to all formats aspire to be perfect, conversions from formats more expressive than pandoc's Markdown can be expected to be lossy.
If no input-files are specified, input is read from stdin.
Output goes to stdout by default. For output to a file,
use the -o
option:
pandoc -o output.html input.txt
By default, pandoc produces a document fragment. To produce a standalone
document (e.g. a valid HTML file including <head>
and <body>
),
use the -s
or --standalone
flag:
pandoc -s -o output.html input.txt
For more information on how standalone documents are produced, see [Templates] below.
If multiple input files are given, pandoc
will concatenate them all (with
blank lines between them) before parsing. (Use --file-scope
to parse files
individually.)
#include <stdio.h>
int main(void) {
int x, y, z;
while (1) {
x = 0;
y = 1;
do {
printf("%d\n", x);
z = x;
x = y;
y = z;
} while (x < 255);
}
}