Content a shortcut doesn't take
A shortcut whose template has no slot renders the same content every time, and one whose handler renders from attributes alone has nowhere to put content. A use wrapping your text stops the build rather than drop the text.
What it looks like
# shortcuts.yaml
ornament:
class: align
body: |
~ ~ ~
::: ornament
Words
:::
ERROR: shortcut 'ornament' takes no content
│ ::: ornament
│ Words
Its template has no slot for content.
Leave the element empty.
See https://keystone.knight-owl.dev/errors/shortcut-content/#its-template-has-no-slot
::: pagebreak
Words
:::
ERROR: shortcut 'pagebreak' takes no content
│ ::: pagebreak
│ Words
Its handler renders from attributes alone.
Leave the element empty.
See https://keystone.knight-owl.dev/errors/shortcut-content/#its-handler-takes-none
What it means
Its template has no slot
ornament renders its template, ~ ~ ~, which has no element to hold content, so the words it wraps have nowhere to
go.
Leave it empty, or give the template a slot
Write ::: ornament with nothing inside. If the shortcut should hold your
text, give its template an empty element to fill — its slot — or name one
with content:; see Writing shortcuts.
Its handler takes none
pagebreak, vspace, rule, source and optional-source render from their attributes alone — a page break, a
space, a line, an attribution — so any shortcut built on one has nowhere to put content.
Leave it empty, and put the text beside it
Write ::: pagebreak with nothing inside, and the words before or after it.
To keep them together, put both in a template of your own; see
Writing shortcuts.
Related
- A shortcut used in a form it lacks — the use is in a form the shortcut has no template for.