| Did you know ... | Search Documentation: |
| Pack tui -- tools/TUI_PLDOC.md |
Aliases (clauses of alias_drawable/2) are not documented with PLDoc
comments of their own. PLDoc keys a comment on a predicate, so a `%!` comment
above an alias clause would document a predicate that does not exist. Instead,
each alias carries a `/*<tui> comment, and tools/tui_doc.pl` transcribes them
all into the PLDoc comment of alias_drawable/2 in prolog/tui.pl.
The technical details (what the tool reads, how it checks, why) are in the
source of tools/tui_doc.pl.
/*<tui> hover(Style, Term) Draws Term, with the attributes Style added while the cursor is on it. Style is a list of attributes. */ tui:alias_drawable(hover(Style, Term), hover(Style, Term, _Group)).
A button, shown as ``┃Label┃``, highlighted when focused. A unit (see `unit(Drawable)`). - `' '`, `return` or `mouse(press, left)` become `button-pressed`
`[bold]` ). For anything else, glyphs included, use double backticks:
` ┃OK┃ `, ` [x] Title `.% Not this: private/1 is an alias any app can draw. tui:alias_drawable(public(X), private(X)). tui:alias_drawable(private(X), D) :- ... % This: tui:alias_drawable(public(X), D) :- private_drawable(X, D).
The exception is an alias drawn only so that events can find it:
events reach components through the aliases on the alias stack, so it
must be an alias. Document it in one line as part of the alias it
serves, as scroll_view/4 is ("Part of scroll(Size, Offset,
Content); not meant to be drawn directly."), and explain it in a `%`
comment by the code.
The PLDoc comment of alias_drawable/2 in prolog/tui.pl has a line
`% ## Aliases`. From there to its first @ tag (or its end), the comment is
generated; do not edit it by hand. It has a section for the core aliases
(drawable.pl, hover.pl, image.pl, loaded by library(tui)), then one
for each opt-in library, such as library(tui/components), each listing its
aliases alphabetically.
prolog/tui.pl.
Run it after changing an alias comment, and commit the result with the
change.doc test unit runs it.