HTML Tools (htmlTools)

Estimated reading time: less than 1 minute

The htmlTools module provides HTML text processing and manipulation tools, with support for auto-translation, Wiki syntax parsing, and SugarCube macro integration.

Access via maplebirch.tool.text or shortcut maplebirchFrameworks.addText().

Usage

const text = maplebirch.tool.text;

Core Methods

MethodDescription
reg(key, fn)Register a text processor
delete(key)Remove a registered processor
replaceText()Replace text in passage
replaceLink()Replace link text in passage

Example

maplebirch.tool.text.reg("gameStatus", (tools) => {
  tools
    .text("Status:", "header")
    .line(`Health: ${V.health}/${V.maxHealth}`)
    .line(`Gold: ${V.gold}`);
});