Skip to content

Commit 2b46f7c

Browse files
committed
Add vars from #4499
1 parent 8a3d719 commit 2b46f7c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/extensions/lua-api.qmd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,30 @@ local utils = require("../utils")
103103
-- ...
104104
```
105105

106+
### Document Metadata
107+
108+
Extensions may need to access the path for the input and output files.
109+
Quarto makes these variables available:
110+
111+
| Function | Description |
112+
|--------------------------|--------------------------------------------------|
113+
| `quarto.doc.input_file` | Full path to input file for the current render. |
114+
| `quarto.doc.output_file` | Full path to output file for the current render. |
115+
116+
### Project Metadata
117+
118+
Extensions may need to know about paths relevant to the project.
119+
Quarto makes these variables available:
120+
121+
122+
| Function | Description |
123+
|-----------------------------------|-----------------------------------------------------------------------------------------------------------------|
124+
| `quarto.project.directory` | Full path to current project directory (`nil` if no project). |
125+
| `quarto.project.output_directory` | Full path to current project output directory (`nil` if no project). |
126+
| `quarto.project.offset` | Offset (relative path) from the directory of the current file to the root of the project (`nil` if no project). |
127+
| `quarto.project.profile` | List of currently active project profiles. |
128+
129+
106130
### Format Detection
107131

108132
Extensions will often need to detect the current format to create custom content depending on the target output medium. The `quarto.doc.is_format()` function

0 commit comments

Comments
 (0)