Skip to content

Commit 4c341e7

Browse files
authored
docs for quarto-cli#12326 (#1600)
1 parent 2efdb1a commit 4c341e7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/extensions/lua-api.qmd

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,13 @@ Quarto exposes paths to utilities that are likely to be useful to Lua extension
256256
| Function | Description |
257257
|------------------------------------|------------------------------------|
258258
| `quarto.paths.rscript()` | Returns the path to `Rscript` that Quarto uses in the `knitr` engine and R files for `quarto run` scripts |
259-
| `quarto.paths.tinytex_bin_dir()` | Returns the path to `TinyTeX` binaries directory (where `tlmgr`, `pdlatex` and others are). If Quarto did not install `TinyTeX` and does not found it, it will return `nil`. This means that PDF rendering by Quarto probably used tools found in PATH. |
259+
| `quarto.paths.tinytex_bin_dir()` | Returns the path to `TinyTeX` binaries directory (where `tlmgr`, `pdlatex` and others are). If Quarto did not install `TinyTeX` and does not found it, it will return `nil`. This means that PDF rendering by Quarto probably used tools found in PATH. |
260+
261+
### Shortcodes
262+
263+
Quarto offers the following helper functions for shortcode developers, to be typically used in shortcode handlers. See the [shortcode development](/docs/extensions/shortcodes.qmd) documentation for more:
264+
265+
| Function | Description |
266+
|----------|-------------|
267+
| `quarto.shortcode.read_arg(args, [n])` | Returns the `n`-th argument of the shortcode invocation |
268+
| `quarto.shortcode.error_output(name, message_or_args, context)` | Creates output to be used by shortcodes to depict an execution error, consistently with how Quarto shows such outputs |

docs/extensions/shortcodes.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Shortcodes are created using Lua. If you aren't familar with Lua (or with Pandoc
7070

7171
- [Lua Development](lua.qmd) (Lua is the language used to create shortcodes).
7272

73-
- [Lua API Reference](lua-api.qmd), which describes the Lua extension API for Quarto.
73+
- [Lua API Reference](lua-api.qmd), which describes the Lua extension API for Quarto. Specifically, consider consulting the `quarto.shortcode.*` entry points.
7474

7575
Shortcodes are implemented as Lua functions that take one or more arguments and return a Pandoc AST node (or list of nodes).
7676

0 commit comments

Comments
 (0)