Rules and presentation

Shared framework reference

Rules page format

Item Contract
First page /src/rules/index.bwss
Other page /src/rules/<slug>.bwss
Root One node. Use a Box.
Nodes Box, Image, Svg, Anchor
Text Plain strings in children. There is no Text node and no Markdown.
Links Anchor.href is #id, slug or slug#id, at most 256 characters.

This format is the same in every framework major.

Arrange nodes and text in Box.children. Image.src is the key of an image uploaded with upload_art. An unknown key fails the compile. Svg draws a vector shape from paths. BWSS styles lists each node's props and every style.

A Box or an Anchor may have an id, which a link reaches as #id. Write each id and each page slug with a letter first, then letters, digits, _ and -. An href takes only that form, so a link cannot reach a slug written another way. A link cannot leave the rules pages.

{
  "type": "Box",
  "id": "goal",
  "children": [
    "Complete three routes to win.",
    { "type": "Anchor", "href": "setup", "children": ["Set up the board"] }
  ]
}

Translated pages

Write a translated page in a folder named for its locale, with the same slug, such as /src/rules/fr/index.bwss. A translated page with no default page of its slug fails the compile. A player whose language has no version of a page reads the default page. Which locales a game has depends on its framework major: see that major's translation section.

Validation

write_file does not check a page. validate_code compiles every page and reports each problem with its file and the path to the node. commit refuses a page that does not compile with RULES_COMPILE_FAILED. Neither checks that a link reaches a page or an id, and Boardweaver adds no table of contents.

Need a hand with this?

Join our Discord