A shortcut used in a form it lacks
A shortcut is used as a div (::: name), a span ([text]{.name}) or a heading (# Title {.name}), and renders only
the forms it can. A use in another form stops the build rather than render nothing in silence.
What it looks like
A line with [Quoted]{.pullquote} inline.
ERROR: shortcut 'pullquote' has no span form
│ [Quoted]{.pullquote}
A shortcut renders the forms it has templates for.
Use it as a div.
See https://keystone.knight-owl.dev/errors/shortcut-form/#another-form-has-a-template
[Centered]{.align style=center}
ERROR: shortcut 'align' has no span form
│ [Centered]{.align style="center"}
With no template, a shortcut renders the forms its chain declares.
Use it as a div.
See https://keystone.knight-owl.dev/errors/shortcut-form/#its-chain-doesnt-declare-that-form
# Preface {.font style=italic}
ERROR: shortcut 'font' has no heading form
│ # Preface {#preface .font style="italic"}
With no template, a shortcut renders the forms its chain declares.
Use it as a div or a span.
See https://keystone.knight-owl.dev/errors/shortcut-form/#its-chain-doesnt-declare-that-form
What it means
Another form has a template
pullquote has a template for a div — its rules, its quote and its attribution — and none for a span. A shortcut with a
template renders only its templates' forms, so it has nothing to render as a span or a heading.
Write it as a div
Put ::: pullquote and ::: around the text. A shortcut of your own can take
a span: template beside its body:, where its handler renders spans; see
Writing shortcuts.
Its chain doesn't declare that form
A shortcut with no template renders the forms the system shortcut it builds on declares: align aligns blocks, so it
has no span form, and font styles text, not headings.
Use a form it declares
The system shortcut reference shows each
shortcut's forms. To style a heading's text, put the span inside it —
# [Preface]{.font style=italic}; see
Writing shortcuts.
Related
- Content a shortcut doesn't take — the form is right, the content isn't.
- Writing shortcuts — templates, and the forms they give a shortcut.