{highlight 'php'} ... {/highlight} writes its content as coloured
source code: every piece HTML-escaped and wrapped in a <span class="hl-...">
- comments, strings, numbers, keywords, variables, tags, attributes, functions - inside
<pre class="pad-highlight" data-lang="php"><code>. It is done on the
server by lib/highlight.php; no JavaScript library is loaded.
The content is taken as it stands, before the engine walks it: the braces of PHP, CSS, JSON
or of PAD itself need no {ignore}, and a field
inside is shown rather than resolved. The indent the lines share is taken off, so the sample can
be indented with the template. One exception: a {# comment #} is gone before any tag
sees it, so a PAD sample keeps none.
file= colours a file of the application instead of the content - its language
from the extension unless the first parameter says otherwise. It never reads a file outside the
application, under _config/ or a dotfile; such a name, or one that is not there,
is a strict error, as is a language that does not exist. lines numbers the lines
and mark sets some apart.
The default colours are written once a page under :where(), following the
page's color-scheme, so the page's own CSS wins. The highlight pipe
does the same for a value - {$query | highlight('sql')} - and
{source} shows the files behind a page as tabs, each
coloured this way.