Skip to content

Text Formatting

LlaGuiTo edited this page Sep 28, 2026 · 1 revision

Text formatting

Applies to all versions (1.21.1 and 26.2).

All text shown in a book (page text fields, template text, landing_text, tooltips) is processed for $(...) commands. A command is written as $(name) or, for functions that take an argument, $(name:argument). Text can be nested and styles stack.

Color codes

Code Description
$(0) … $(9) Minecraft color by code (0 is black, 9 is blue).
$(a) … $(f) Minecraft colors (a is green … f is white).
$(#rgb) Short hexadecimal color, for example $(#f00) for red.
$(#rrggbb) Full hexadecimal color, for example $(#ff8800).

$(nocolor) resets the color to the book's base text color.

"text": "$(c)Red $()plain $(#4a9)green-ish"

Style codes

Code Alias Effect
$(l) $(bold) Bold
$(o) $(italic), $(italics) Italic
$(n) $(underline) Underline
$(m) $(strike) Strikethrough
$(k) $(obf) Obfuscated

Note the ambiguity: $(l) (no colon) is bold, while $(l:...) (with a colon) is a link. The same applies to $(k) (obfuscated) versus $(k:...) (keybind).

Resetting

Code Description
$() Reset styles, links and tooltips. $() is also produced by the /$ macro.
$(reset) Alias of $().
$(clear) Alias of $().

Because a bare reset is easy to write by accident, the /$ macro is provided so that $(/$) expands to $().

Line breaks

Code Description
$(br) Single line break.
$(br2) Double line break (blank line). Aliases: $(2br), $(p).

The <br> macro also expands to $(br).

Lists

Code Description
$(li) First-level bullet.
$(li2) Second-level bullet (hollow).
$(li3) … Deeper levels alternate between filled and hollow.

The default macro $(list expands to $(li, so $(list) works and produces a first-level bullet.

Links

Links use the l function and are closed with $(/l):

$(l:target)link text$()
  • External links: if the target starts with http: or https:, it opens in the browser. An external link is marked with a trailing arrow glyph.
  • Internal links: otherwise the target is an entry or category id. If it has no namespace, the book's own namespace is used. An optional #anchor navigates to the page carrying that anchor.
  • $(l:entry#anchor) jumps to the page whose anchor field matches.
  • A link shows a tooltip with the target's name, or "(Locked)" if it is still locked.
"text": "$(l:mymod:basics/introduction)Read the introduction$() or $(l:https://github.com/codex-skd/vellumli)visit the repository$()."

Tooltips

$(t:tooltip text)visible text$()

The tooltip alias works too: $(tooltip:tooltip text). Closed with $(/t). Hovering the visible text shows the tooltip.

Keybinds

$(k:key.jump)

Shows the currently bound key for the keybind, with a tooltip. A missing keybind shows "N/A".

Commands

$(c:/give @s minecraft:stone)Give me stone$()

Clicking the text runs the command. The command alias is $(command:...). The argument must begin with /. Closed with $(/c).

Player name

$(playername) is replaced with the current player's name.

Macros

Macros are simple text substitutions applied before commands are processed. Default macros:

Macro Expands to
$(list $(li
/$ $()
<br> $(br)
$(item) $(#b0b) (a soft blue, for items)
$(thing) $(#490) (a soft green, for things)

You can add or override macros with the macros object in book.json. Substitution is repeated until it reaches a fixpoint, up to ten passes; a warning is logged if it does not settle (for example with a circular macro).

"macros": {
  "$(mana)": "$(#55aaff)"
}

Extending the parser

Mods can register their own commands and functions on the client with VellumliAPI.get().registerCommand(...) and registerFunction(...). See API.

Clone this wiki locally