From 4857cd176946fe6b3df1966963855d84f434831d Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Sat, 20 Nov 2021 23:19:22 -0800
Subject: [PATCH] Update man page.

---
 MANUAL.txt   |  2 +-
 man/pandoc.1 | 54 ++++++++++++++++++++++++++++++++++++++++------------
 2 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/MANUAL.txt b/MANUAL.txt
index 2053771c2..7e15e8833 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1,7 +1,7 @@
 ---
 title: Pandoc User's Guide
 author: John MacFarlane
-date: November 02, 2021
+date: November 20, 2021
 ---
 
 # Synopsis
diff --git a/man/pandoc.1 b/man/pandoc.1
index 5fb524b58..cbc100841 100644
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1,7 +1,7 @@
 '\" t
-.\" Automatically generated by Pandoc 2.16
+.\" Automatically generated by Pandoc 2.16.1
 .\"
-.TH "Pandoc User\[cq]s Guide" "" "November 02, 2021" "pandoc 2.16.1" ""
+.TH "Pandoc User\[cq]s Guide" "" "November 20, 2021" "pandoc 2.16.2" ""
 .hy
 .SH NAME
 pandoc - general markup converter
@@ -304,6 +304,8 @@ if you need extensions not supported in \f[C]gfm\f[R].
 \f[C]twiki\f[R] (TWiki markup)
 .IP \[bu] 2
 \f[C]vimwiki\f[R] (Vimwiki)
+.IP \[bu] 2
+the path of a custom Lua reader, see Custom readers and writers below
 .PP
 Extensions can be individually enabled or disabled by appending
 \f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
@@ -432,7 +434,7 @@ markup)
 .IP \[bu] 2
 \f[C]zimwiki\f[R] (ZimWiki markup)
 .IP \[bu] 2
-the path of a custom Lua writer, see Custom writers below
+the path of a custom Lua writer, see Custom readers and writers below
 .PP
 Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
 \f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
@@ -1598,6 +1600,11 @@ Error
 T}
 _
 T{
+1
+T}@T{
+PandocIOError
+T}
+T{
 3
 T}@T{
 PandocFailOnWarningError
@@ -1703,6 +1710,11 @@ T}@T{
 PandocFilterError
 T}
 T{
+84
+T}@T{
+PandocLuaError
+T}
+T{
 91
 T}@T{
 PandocMacroLoop
@@ -6216,7 +6228,7 @@ Include source position attributes when parsing \f[C]commonmark\f[R].
 For elements that accept attributes, a \f[C]data-pos\f[R] attribute is
 added; other elements are placed in a surrounding Div or Span elemnet
 with a \f[C]data-pos\f[R] attribute.
-.SS Extension: \f[C]short_subsuperscript\f[R]
+.SS Extension: \f[C]short_subsuperscripts\f[R]
 .PP
 Parse multimarkdown style subscripts and superscripts, which start with
 a `\[ti]' or `\[ha]' character, respectively, and include the
@@ -7810,26 +7822,44 @@ text style.
 With these custom styles, you can use your input document as a
 reference-doc while creating docx output (see below), and maintain the
 same styles in your input and output files.
-.SH CUSTOM WRITERS
+.SH CUSTOM READERS AND WRITERS
 .PP
-Pandoc can be extended with custom writers written in Lua.
+Pandoc can be extended with custom readers and writers written in Lua.
 (Pandoc includes a Lua interpreter, so Lua need not be installed
 separately.)
 .PP
-To use a custom writer, simply specify the path to the Lua script in
-place of the output format.
+To use a custom reader or writer, simply specify the path to the Lua
+script in place of the input or output format.
 For example:
 .IP
 .nf
 \f[C]
 pandoc -t data/sample.lua
+pandoc -f my_custom_markup_language.lua -t latex -s
 \f[R]
 .fi
 .PP
-Creating a custom writer requires writing a Lua function for each
-possible element in a pandoc document.
-To get a documented example which you can modify according to your
-needs, do
+A custom reader is a Lua script that defines one function, Reader, which
+takes a string as input and returns a Pandoc AST.
+See the Lua filters documentation for documentation of the functions
+that are available for creating pandoc AST elements.
+For parsing, the lpeg parsing library is available by default.
+To see a sample custom reader:
+.IP
+.nf
+\f[C]
+pandoc --print-default-data-file creole.lua
+\f[R]
+.fi
+.PP
+If you want your custom reader to have access to reader options
+(e.g.\ the tab stop setting), you give your Reader function a second
+\f[C]options\f[R] parameter.
+.PP
+A custom writer is a Lua script that defines a function that specifies
+how to render each element in a Pandoc AST.
+To see a documented example which you can modify according to your
+needs:
 .IP
 .nf
 \f[C]