This project is a document generator to convert a YAML description of rules into formatted outputs (such as pdf / html). You can view the example output of the github workflow action here.
The YAML contains several levels of structures to organize the rules.
Contains the changelog entries. Entries can contain formatted text.
changelog:
- text: entry1
- text: entry2
Defines a chapter (numbered with 1.).
chapter: chapter_id
text: Chapter Title
sections:
- section:
...
- section:
...
Defines a section (numbered with 1.1.).
section: section_id
text: Formatted Section Title
toc_entry: (optional) alternate title for the table of contents (useful if the formatted title would break the toc)
snippet: (optional) snippet for the section
rules:
- rule:
...
- subsection:
...
Defines a subsection (numbered with 1.1.1.).
subsection: subsection_id
text: Formatted Subsection Text
toc: (optional indicator whether this subsection should be added to the table of contents)
steps: (optional indicator whether this subsection and any subelements should be referred to as 'step')
examples:
- text: Formatted Example Text
rules:
- rule:
...
- rule:
...
Defines a rule. A rule can be under a section (numbered with 1.1.1.) or nested below a rule (numbered with a.).
rule: rule_id
text: Formatted Rule Text
examples:
- text: Formatted Example Text
- text: Formatted Example Text
Timing structures can be added in the rules
block of a section.
timing_structure:
elements:
- text: Step 1
elements:
- text: Step A
elements:
- text: Step Z
- text: Step 2
Reference any identifier of a chapter, section, rule, or subrule.
{ref:ref_id}
A reference can contain a capital letter at the start, to indicate the reference text should be capitalized.
{ref:Ref_id}
Referencing multiple identifiers at once is possible with a ,
.
{ref:ref_1,ref_2,ref_3}
If you want a different word than and
to combine the reference, you can specify it after /
.
{ref/through:ref_1,ref_2,ref_3}
Embed an image in the document.
{img:img_name}
Indicates a game term.
{term:credits}
Indicates a subtype.
{subtype:connection}
Indicates a card name.
{card:Fermenter}
Indicates a product name.
{product:System Gateway}
Indicates a link to a website.
{link:website|https://nullsignal.games}
The use of the literal scalar style of the YAML spec is useful to define literal text.
text: |-
My text goes here.
Highlight a rule as new.
- rule:
new:
Highlight a piece of text as new.
text: This is old text. {n}This is new text.{/n}
For local development, simply run docker compose build
and docker compose up -d
.
For production deployment, do the following, after a successful docker login registry.digitalocean.com
:
docker compose pull
docker compose -f docker-compose.prod.yml -f docker-compose.yml up -d