wiki/tests.lisp
#+title: A test page #+startup: overview
Preamble mentions #XYZ123 before any heading.
* First figure :PROPERTIES: :ID: XYZ123 :END:
A paragraph with *bold*, italic, verbatim, code, a link,
and a plain page link. A mention of #UVW456 and a dangling
#ZZZ999. A star * alone and 2 * 3 are not emphasis; nor is foo_bar.
- first item
- second item that wraps a line
- third
*item*
- one
- two
keep < this & that
| Head A | Head B |
|---|---|
| a1 | b1 |
** NEXT A work mark :PROPERTIES: :ID: UVW456 :END:
Intent: mention #XYZ123 with a link.
* Second figure without an ID
Nothing here refers to anything.
The work mark links to XYZ123 with an id: link, so it is a backlink.
#+title: Captures
* Media
:PROPERTIES:
:ID: CAP12G
:END:
Depending on luv-wiki-site loads every page into its org-file component.
render-op places pages in the site directory, untranslated.
(in-package #:luv.example)
;;; A comment before the definition mentions #XYZ123.
(defun frob (x &optional y) "Frob X. See #XYZ123 and the missing #ZZZ999." (let ((sum (+ x (or y 1))) (name 'frob)) (list sum name #'car cl:car foo::bar :key #:g #(1 2) `(,x ,@y) #+sbcl :sbcl #-sbcl :other #\a 1.5 "s")))
(defmethod frob-method :around ((x integer) y) (call-next-method))
(defclass widget () ((a :initarg :a)))
One branch is taken on SBCL and keeps its form; the other is kept as text. Neither is evaluated.
Nothing was interned.
(in-package #:luv.example) (zdefun plain (x) x) (zdefun (semantic :zone :example/semantic :value (length xs)) (xs) xs) (zdefun ((setf property) :zone :example/property) (value object) value) (zdefmethod (operate :zone :example/operate) :around ((x integer) y) (call-next-method))
The CSS syntax reads quantities, slash pairs, and --references as objects, and everything else as usual.
Values: symbols are CSS words, quantities and references themselves, lists Lisp: CSS functions build calls, and any function may return values or declarations for the rule.
.a { color: var(--ink); margin: 0 auto; padding: 0.3rem clamp(1rem, 4vw, 3rem); border: 1px solid var(--rule); grid-template-columns: repeat(3, minmax(0, 1fr)); font: 700 0.72rem/1 var(--display-font); background: color-mix(in srgb, var(--paper) 94%, var(--accent)); font-family: "Public Sans", helvetica; }
Nesting: descendants, & for the parent, groups crossed with groups, media queries hoisted around the rule they wrap, mixins spliced in.
.door, .card { display: flex; gap: 1rem; outline: none; }
.door:hover, .door.selected, .card:hover, .card.selected { outline: none; }
.door h1, .card h1 { margin: 0; }
@media (max-width: 90ch) { .door, .card { display: block; } }
The tree is inspectable: a rule's children are declarations and rules.
The whole sheet has the palette first and the layout roles the dexp renderer emits.
(defun f (x) ;; c (let ((y 1)) (when x (list y :k "s"))))
A list with body forms is stacked: its head in a .head span, then rows.
The lambda list is head, the let form is body; the let binding (y 1) is a clause whose first symbol is not an operator.
Clause forms are tables: each clause a row with its key in a .head cell and its body in a .rest cell; a handler-case clause's key is the type and its lambda list.
Eclector recovers from unbalanced input, so boxes still appear; input that reads to nothing at all falls back to a <pre>.
The mention inside the docstring links to the figure.
(defun g (count &key (limit 3))
"Return COUNT items up to LIMIT, calling FROB on each; GPU acronyms
and *features* stay text; *special* names are code."
count)
Parameters and definitions become symbol references, lowercase.
Unknown acronyms stay prose; *name* reads as code, not bold.
ASDF's :IF-FEATURE keeps these systems registered for introspection on every host while making their build actions invalid away from Darwin. The wiki deliberately walks the complete component tree rather than only ASDF's active SUB-COMPONENTS, so Linux CI can render the Metal sources.
#+title: A test page #+startup: overview Preamble mentions #XYZ123 before any heading. * First figure :PROPERTIES: :ID: XYZ123 :END: A paragraph with *bold*, /italic/, =verbatim=, ~code~, a [[https://example.org][link]], and a plain [[file:other.org][page link]]. A mention of #UVW456 and a dangling #ZZZ999. A…
Multiplication and scalar scaling.
(&optional (text *page*) (name "test"))(string &key name pathname)((document document))((heading heading))(document)Test whether two compatible scalars are equal.
(inlines)(string)Emphasized text; VERBATIM and CODE hold one string child.
An Org bracket link.
A light #ID reference to a figure: a hash and six capitals or digits.
(&rest ids)An Org headline with its section and subheadings.
A run of prose; CHILDREN are inline objects.
A bulleted or numbered list of LIST-ITEMs.
A #+begin_src block with its language.
A #+begin_example block, kept verbatim.
A simple Org table without formulas.
Logical negation of one test or raw truth value.
(&key (code t))(domain x y z &optional (extent +vertex-extent+) (polarity 1))Pack a canonical site inside DOMAIN's box. No coordinate wraps: anchors range over [0, limit] per horizontal axis, and a site extending along an axis cannot begin on that axis's far boundary.
(id &optional (site *site*))(document)(site)(document &optional (site *site*))One Org page of the wiki as an ASDF component.
(system)(system)Test whether one compatible scalar is greater than another.
Render a wiki system, page, or asset into the static site.
((operation capture-op) (system asdf:system))(site directory &key (stylesheet t))Write every page of SITE, the figures index, and, unless STYLESHEET is NIL, the compiled stylesheet into DIRECTORY.
(in-package #:luv.example) ;;; A comment before the definition mentions #XYZ123. (defun frob (x &optional y) "Frob X. See #XYZ123 and the missing #ZZZ999." (let ((sum (+ x (or y 1))) (name 'frob)) (list sum name #'car cl:car foo::bar :key #:g #(1 2) `(,x ,@y) #+sbcl :sbcl #-sbcl :other #\a…
(text &key (name "string"))Read TEXT into a list of top-level LISP-NODEs, comments included, in order. Reader errors are recovered from where Eclector offers a restart and otherwise end the read; NAME labels warnings.
Logical conjunction of tests and raw truth values.
A parenthesized list; CHILDREN are nodes in order.
A ; or #| |# comment, TEXT included.
A quote-like prefix applied to one form.
A #( ) vector literal.
A #+ or #- guarded form.
(pathname &optional (text (uiop:read-file-string pathname)))(name definitions &key kind)The first definition whose name matches NAME, case-insensitively, with or without a package prefix on either side.
Construct a meaningful literal.
A canonical product of symbolic base dimensions raised to rational powers.
Two values joined by a slash, as in the font shorthand 0.72rem/1 or grid-area 1/3.
Subtraction or unary negation.
Constrain a quantity between compatible bounds.
(&rest nodes)SELECTOR { declarations }, and nested rules and at-rules whose selectors combine with this one.
(&rest colors)The CSS color-mix() of COLORS in the sRGB space, a percentage after a colour weighting it: (color-mix --paper 94% --accent).
(&rest families)(&body body)The declarations BODY makes, read as a rule body, for a rule to include: the way to write a mixin.
PROPERTY: VALUES; -- the property a keyword, the values a list written space-separated.
((selector selector-list))(&optional (styles *styles*))Test whether one compatible scalar is less than another.
(text &key package)Read TEXT and render it structurally; on any failure fall back to a plain <pre>, so a page never loses its code.
COND, CASE, HANDLER-CASE and other clause forms are tables (#4175NC): each clause a row with its key or test in the first column and its body forms stacked in the second, aligned across the clauses.
(site)An alist of (definition . ids) for code mentions no figure resolves, leaving out the definitions of test systems.
The repository root: the directory holding the primary ASD files and wiki/.
(&rest names)Table of contents: every page with its figures, IDs, and work marks. Give page names to restrict.
(arguments)(&rest statuses)
Six hex digits are a colour, never a figure ID.