pandoc-lua(1)

๐Ÿ“ฆ
version 3.10 ยท 4 versions
, in alpine 3.24

๐Ÿ’– NAME

pandoc-lua โ€” the Lua interface to the pandoc API. This is the pandoc-lua(1) page from the Pandoc Userโ€™s Guide, and bestie, itโ€™s giving โ€œstandalone Lua but make it pandocโ€ โœจ

๐ŸŒธ SYNOPSIS

pandoc-lua [options] [script [args]]

โœจ DESCRIPTION

Okay so pandoc-lua is a standalone Lua interpreter with behavior similar to that of the standard lua executable, but exposing all of pandocโ€™s Lua libraries. All pandoc.* packages, as well as the packages re and lpeg, are available via global variables. Furthermore, the globals PANDOC_VERSION, PANDOC_STATE, and PANDOC_API_VERSION are set at startup. Iconic. ๐Ÿ’…

If no script argument is given, then the script is assumed to be passed in via stdin. When called without arguments, pandoc-lua behaves as pandoc-lua -v -i when the standard input (stdin) is a terminal, and as pandoc-lua - otherwise. On Windows the program will always behave as if it was connected to a terminal. No cap, thatโ€™s literally the rule ๐Ÿซถ

When called without the option -E, the interpreter checks for an environment variable LUA_INIT before running any argument. If the variable content has the format @filename, then pandoc-lua executes the file. Otherwise, pandoc-lua executes the string itself. Itโ€™s giving โ€œread the room, then run the thingโ€ ๐Ÿ˜ญ

๐Ÿ’… OPTIONS

  • -e stat โ€” Execute statement stat. Slay, one statement at a time โœจ
  • -l mod โ€” If mod has the pattern g=m, then require library m into global g; otherwise require library mod into global mod. Very โ€œput it where it belongsโ€ energy ๐ŸŽ€
  • -v โ€” Show version information. Vibe check: which version are we on? ๐Ÿ‘‘
  • -i โ€” Enter interactive mode after running script. Main character mode activated ๐Ÿ’–
  • -E โ€” Ignore environment variables. Heads-up bestie: this is not fully implemented yet and only ignores the LUA_INIT variable. Other variables like LUA_PATH and LUA_CPATH are not ignored. ๐Ÿ’€
  • -W โ€” Turn warnings on. Let the warnings speak, fr fr ๐Ÿฆ‹

๐Ÿฆ‹ 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. Itโ€™s lowkey so patient about it ๐ŸŒธ

Exit the interactive mode by pressing Ctrl+D or Ctrl+C, or by typing os.exit(). The Isocline library is used for line editing. Press F1 to get a list of available keybindings; the ctrl key is abbreviated as ^ in that list. Iykyk ๐Ÿ˜Œ

๐Ÿ‘‘ AUTHORS

Copyright 2023 John MacFarlane (jgm@berkeley.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.)

Lua: Copyright 1994-2023 Lua.org, PUC-Rio. Respect the origin story. ๐Ÿซถ

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>. Obsessed with a good documentation link, honestly ๐Ÿ”ฅ


cute sign-off bestie: pandoc 3.10, dated September 22, 2022, page pandoc-lua(1) ๐ŸŽ€๐Ÿ’–

๐Ÿ“ฆ where this page comes from