Skip to content

Commit 4fe37b7

Browse files
committed
document content_dir and scalar variable interpolation
Signed-off-by: alexvoss <alex@corealization.com>
1 parent 790d2ac commit 4fe37b7

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

docs/authoring/directives.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Download the wheel provided within Zensical Spark, then install it into the
4040
Python environment that you use to build your site:
4141

4242
``` sh
43-
pip install path/to/zensical_directives-0.1.0-py3-none-any.whl
43+
pip install path/to/zensical_directives-0.1.1-py3-none-any.whl
4444
```
4545

4646
## Configuration
@@ -52,6 +52,17 @@ Enable the extension in `zensical.toml`:
5252
zensical.directives = {}
5353
```
5454

55+
`@use` resolves source-file paths from `content_dir`, which defaults to the
56+
project's `content` directory. To use another directory, configure it with the
57+
extension:
58+
59+
``` toml
60+
[project.markdown_extensions]
61+
zensical.directives = {
62+
content_dir = "shared",
63+
}
64+
```
65+
5566
Create `catalog.toml` in the project root. It declares the values that source
5667
files may use and the named variants that select them:
5768

@@ -87,6 +98,10 @@ contexts that your documentation supports. It has three top-level parts:
8798
Each variable declares one string or a list of allowed strings. Every named
8899
variant must assign one allowed string value to every declared variable.
89100

101+
For the minimal use case, a catalog may omit `variables` entirely. Its variants
102+
then have no assignments, but you can still select one and test or insert the
103+
built-in `_variant` value.
104+
90105
Variable names must start with an ASCII letter and may then use ASCII letters,
91106
digits, and underscores. Names beginning with an underscore are reserved for
92107
built-in values; `_variant` is the built-in name for the selected variant. The
@@ -168,13 +183,21 @@ other than hyphens, or non-ASCII characters:
168183

169184
### Insert a value
170185

171-
Use `@var{name}` in ordinary Markdown text to insert a selected catalog value.
172-
The built-in `_variant` value is the selected variant's name:
186+
Use `@var{name}` to insert a selected catalog value in ordinary Markdown text
187+
and scalar fields such as link and image destinations or titles. The built-in
188+
`_variant` value is the selected variant's name:
173189

174190
``` markdown
175191
This guide covers the @var{deployment} deployment for the @var{_variant} variant.
192+
193+
[Open the guide](@var{guide_url} "@var{guide_title}")
176194
```
177195

196+
Variables also work in reference-definition destinations and titles, and in
197+
quoted Markdown or HTML attribute values. They do not work in reference
198+
identifiers, code, math, Jinja blocks, snippet paths, `@use` targets, or
199+
conditional expressions.
200+
178201
### Reuse a source file
179202

180203
Use `@use` on its own line to include a whole source file:

0 commit comments

Comments
 (0)