Skip to content

Commit 4857cd1

Browse files
committed
Update man page.
1 parent 572d801 commit 4857cd1

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

MANUAL.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Pandoc User's Guide
33
author: John MacFarlane
4-
date: November 02, 2021
4+
date: November 20, 2021
55
---
66

77
# Synopsis

man/pandoc.1

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'\" t
2-
.\" Automatically generated by Pandoc 2.16
2+
.\" Automatically generated by Pandoc 2.16.1
33
.\"
4-
.TH "Pandoc User\[cq]s Guide" "" "November 02, 2021" "pandoc 2.16.1" ""
4+
.TH "Pandoc User\[cq]s Guide" "" "November 20, 2021" "pandoc 2.16.2" ""
55
.hy
66
.SH NAME
77
pandoc - general markup converter
@@ -304,6 +304,8 @@ if you need extensions not supported in \f[C]gfm\f[R].
304304
\f[C]twiki\f[R] (TWiki markup)
305305
.IP \[bu] 2
306306
\f[C]vimwiki\f[R] (Vimwiki)
307+
.IP \[bu] 2
308+
the path of a custom Lua reader, see Custom readers and writers below
307309
.PP
308310
Extensions can be individually enabled or disabled by appending
309311
\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
@@ -432,7 +434,7 @@ markup)
432434
.IP \[bu] 2
433435
\f[C]zimwiki\f[R] (ZimWiki markup)
434436
.IP \[bu] 2
435-
the path of a custom Lua writer, see Custom writers below
437+
the path of a custom Lua writer, see Custom readers and writers below
436438
.PP
437439
Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
438440
\f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
@@ -1598,6 +1600,11 @@ Error
15981600
T}
15991601
_
16001602
T{
1603+
1
1604+
T}@T{
1605+
PandocIOError
1606+
T}
1607+
T{
16011608
3
16021609
T}@T{
16031610
PandocFailOnWarningError
@@ -1703,6 +1710,11 @@ T}@T{
17031710
PandocFilterError
17041711
T}
17051712
T{
1713+
84
1714+
T}@T{
1715+
PandocLuaError
1716+
T}
1717+
T{
17061718
91
17071719
T}@T{
17081720
PandocMacroLoop
@@ -6216,7 +6228,7 @@ Include source position attributes when parsing \f[C]commonmark\f[R].
62166228
For elements that accept attributes, a \f[C]data-pos\f[R] attribute is
62176229
added; other elements are placed in a surrounding Div or Span elemnet
62186230
with a \f[C]data-pos\f[R] attribute.
6219-
.SS Extension: \f[C]short_subsuperscript\f[R]
6231+
.SS Extension: \f[C]short_subsuperscripts\f[R]
62206232
.PP
62216233
Parse multimarkdown style subscripts and superscripts, which start with
62226234
a `\[ti]' or `\[ha]' character, respectively, and include the
@@ -7810,26 +7822,44 @@ text style.
78107822
With these custom styles, you can use your input document as a
78117823
reference-doc while creating docx output (see below), and maintain the
78127824
same styles in your input and output files.
7813-
.SH CUSTOM WRITERS
7825+
.SH CUSTOM READERS AND WRITERS
78147826
.PP
7815-
Pandoc can be extended with custom writers written in Lua.
7827+
Pandoc can be extended with custom readers and writers written in Lua.
78167828
(Pandoc includes a Lua interpreter, so Lua need not be installed
78177829
separately.)
78187830
.PP
7819-
To use a custom writer, simply specify the path to the Lua script in
7820-
place of the output format.
7831+
To use a custom reader or writer, simply specify the path to the Lua
7832+
script in place of the input or output format.
78217833
For example:
78227834
.IP
78237835
.nf
78247836
\f[C]
78257837
pandoc -t data/sample.lua
7838+
pandoc -f my_custom_markup_language.lua -t latex -s
78267839
\f[R]
78277840
.fi
78287841
.PP
7829-
Creating a custom writer requires writing a Lua function for each
7830-
possible element in a pandoc document.
7831-
To get a documented example which you can modify according to your
7832-
needs, do
7842+
A custom reader is a Lua script that defines one function, Reader, which
7843+
takes a string as input and returns a Pandoc AST.
7844+
See the Lua filters documentation for documentation of the functions
7845+
that are available for creating pandoc AST elements.
7846+
For parsing, the lpeg parsing library is available by default.
7847+
To see a sample custom reader:
7848+
.IP
7849+
.nf
7850+
\f[C]
7851+
pandoc --print-default-data-file creole.lua
7852+
\f[R]
7853+
.fi
7854+
.PP
7855+
If you want your custom reader to have access to reader options
7856+
(e.g.\ the tab stop setting), you give your Reader function a second
7857+
\f[C]options\f[R] parameter.
7858+
.PP
7859+
A custom writer is a Lua script that defines a function that specifies
7860+
how to render each element in a Pandoc AST.
7861+
To see a documented example which you can modify according to your
7862+
needs:
78337863
.IP
78347864
.nf
78357865
\f[C]

0 commit comments

Comments
 (0)