aboutsummaryrefslogtreecommitdiff
path: root/pandoc-cli/man/pandoc-lua.1
blob: addbcd4d9a98498e33aed79f9debde368cc1cfd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.\" Automatically generated by Pandoc 3.8.2
.\"
.TH "pandoc-lua" "1" "September 22, 2022" "pandoc 3.8.2" "Pandoc User\[cq]s Guide"
.SH SYNOPSIS
\f[CR]pandoc\-lua\f[R] [\f[I]options\f[R]] [\f[I]script\f[R]
[\f[I]args\f[R]]]
.SH DESCRIPTION
\f[CR]pandoc\-lua\f[R] is a standalone Lua interpreter with behavior
similar to that of the standard \f[CR]lua\f[R] executable, but exposing
all of pandoc\(cqs Lua libraries.
All \f[CR]pandoc.*\f[R] packages, as well as the packages \f[CR]re\f[R]
and \f[CR]lpeg\f[R], are available via global variables.
Furthermore, the globals \f[CR]PANDOC_VERSION\f[R],
\f[CR]PANDOC_STATE\f[R], and \f[CR]PANDOC_API_VERSION\f[R] are set at
startup.
.PP
If no script argument is given, then the script is assumed to be passed
in via \f[I]stdin\f[R].
When called without arguments, \f[CR]pandoc\-lua\f[R] behaves as
\f[CR]pandoc\-lua \-v \-i\f[R] when the standard input
(\f[CR]stdin\f[R]) is a terminal, and as \f[CR]pandoc\-lua \-\f[R]
otherwise.
On Windows the program will always behave as if it was connected to a
terminal.
.PP
When called without the option \f[CR]\-E\f[R], the interpreter checks
for an environment variable \f[CR]LUA_INIT\f[R] before running any
argument.
If the variable content has the format
\f[I]\f[CI]\(atfilename\f[I]\f[R], then \f[CR]pandoc\-lua\f[R] executes
the file.
Otherwise, \f[CR]pandoc\-lua\f[R] executes the string itself.
.SH OPTIONS
.TP
\f[CR]\-e stat\f[R]
Execute statement \f[CR]stat\f[R].
.TP
\f[CR]\-l mod\f[R]
If mod has the pattern \f[CR]g=m\f[R], then require library \f[CR]m\f[R]
into global \f[CR]g\f[R]; otherwise require library \f[CR]mod\f[R] into
global \f[CR]mod\f[R].
.TP
\f[CR]\-v\f[R]
Show version information.
.TP
\f[CR]\-i\f[R]
Enter interactive mode after running \f[I]script\f[R].
.TP
\f[CR]\-E\f[R]
Ignore environment variables.
This is not fully implemented yet and only ignores the
\f[CR]LUA_INIT\f[R] variable.
Other variables like \f[CR]LUA_PATH\f[R] and \f[CR]LUA_CPATH\f[R] are
\f[B]not\f[R] ignored.
.TP
\f[CR]\-W\f[R]
Turn warnings on.
.SH INTERACTIVE MODE
In interactive mode, the Lua interpreter repeatedly prompts and waits
for a line.
After reading a line, Lua first tries to interpret the line as an
expression.
If it succeeds, it prints its value.
Otherwise, it interprets the line as a statement.
If you write an incomplete statement, the interpreter waits for its
completion by issuing a different prompt.
.PP
Exit the interactive mode by pressing \f[CR]Ctrl\-D\f[R] or
\f[CR]Ctrl\-C\f[R], or by typing \f[CR]os.exit()\f[R].
The \f[I]Isocline\f[R] library is used for line editing.
Press \f[CR]F1\f[R] to get a list of available keybindings; the
\f[CR]ctrl\f[R] key is abbreviated as \f[CR]\(ha\f[R] in that list.
.SH AUTHORS
Copyright 2023 John MacFarlane (jgm\(atberkeley.edu) and contributors.
Released under the GPL, version 2 or later.
This software carries no warranty of any kind.
(See COPYRIGHT for full copyright and warranty notices.)
.PP
Lua: Copyright 1994\-2023 Lua.org, PUC\-Rio.
.PP
The Pandoc source code may be downloaded
from <https://hackage.haskell.org/package/pandoc> or
<https://github.com/jgm/pandoc/releases>.  Further
documentation is available at <https://pandoc.org>.