Modular compilation and build.yaml
Build Successful The Ravenous rulebook and balance report were built successfully.
Ravenous/ravenous_typst/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-08-21 04:25:59 +02:00
parent 1aa6c130dd
commit 9310caf37b
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
12 changed files with 170 additions and 65 deletions

View File

@ -13,6 +13,33 @@ typst compile main.typ main.pdf
typst compile balance_report.typ balance_report.pdf
```
All shared build settings live in `data/config/build.yaml`. To build the
player-facing edition with the predefined chapter exclusions, use one override:
```sh
typst compile --input preset=player-handbook main.typ player-handbook.pdf
```
The preset can be combined with independent origin and school selectors:
```sh
typst compile \
--input preset=player-handbook \
--input origin=dragon_1 \
--input school=artilleur \
main.typ dragon-1-artilleur-handbook.pdf
```
`origin` and `school` default to an empty string, which includes every entry.
Origins identify individual YAML variants such as `dragon_1`, `dragon_2`, or
`guivre_1`, rather than an entire origin family.
They can also be set persistently under `build` in the YAML. Invalid identifiers
fail compilation with an explicit error instead of producing an incomplete book.
Edit `build.disabled_chapters` for permanent project-specific exclusions, or
add another entry under `presets` for a reusable edition. Chapter IDs are the
names passed to `chapter-enabled` in `main.typ`.
For live rebuilding while editing, use:
```sh

View File

@ -1,5 +1,5 @@
#import "/setup/models/origin.typ": creature-title, render-creature
#import "/setup/setup.typ": theme
#import "/setup/setup.typ": theme, build-config, origin-enabled
//----- DOCUMENT -----
#let origins = (
@ -18,7 +18,25 @@
("Yénuï", "yenui", 2),
)
#let origin-ids = origins.fold((), (ids, origin) => {
let slug = origin.at(1)
let count = origin.at(2)
ids + range(1, count + 1).map(i => slug + "_" + str(i))
})
#assert(
build-config.origin == "" or build-config.origin in origin-ids,
message: "Unknown origin selector: " + build-config.origin,
)
#for (name, slug, count) in origins {
let selected-variants = range(1, count + 1).filter(i => (
origin-enabled(slug + "_" + str(i))
))
if selected-variants.len() == 0 {
continue
}
show heading: it => {
align(center)[#text(
size: creature-title.size,
@ -35,7 +53,7 @@
}
heading(level: 3)[#name]
for i in range(1, count + 1) {
for i in selected-variants {
render-creature(
yaml("/data/src/origines/" + slug + "_" + str(i) + ".yaml"),
)

View File

@ -1,4 +1,21 @@
#import "/setup/setup.typ": ddlvl, ravhelp
#import "/setup/setup.typ": ddlvl, ravhelp, build-config, school-enabled
#let school-ids = (
"heavy-weapon-specialist",
"einerjar",
"franc-tireur",
"protecteur",
"lancier",
"maitre-lames",
"artilleur",
"mage-bestial",
"guerrier-mage",
"sangremage",
)
#assert(
build-config.school == "" or build-config.school in school-ids,
message: "Unknown school selector: " + build-config.school,
)
= Écoles de combat <chap:ecoles_de_combat>
Les écoles de combat représentent un savoir ancestral, concentré en une seule discipline et affiné à travers les âges. Bien que toutes les techniques aient étés conçues pour être utilisées conjointement, de nombreux chasseurs décident de mixer les diverses écoles pour former un style qui leur est propre.
@ -82,32 +99,13 @@ Il est à noter que si une technique donne un effet sans préciser une limite de
#pagebreak()
#include "heavy_weapon_specialist.typ"
#pagebreak()
#include "einerjar.typ"
#pagebreak()
#include "franc_tireur.typ"
#pagebreak()
#include "protecteur.typ"
#pagebreak()
#include "lancier.typ"
#pagebreak()
#include "maitre_lames.typ"
#pagebreak()
#include "artilleur.typ"
#pagebreak()
#include "mage_bestial.typ"
#pagebreak()
#include "guerrier_mage.typ"
#pagebreak()
#include "sangremage.typ"
#pagebreak()
#if school-enabled("heavy-weapon-specialist") { include "heavy_weapon_specialist.typ"; pagebreak() }
#if school-enabled("einerjar") { include "einerjar.typ"; pagebreak() }
#if school-enabled("franc-tireur") { include "franc_tireur.typ"; pagebreak() }
#if school-enabled("protecteur") { include "protecteur.typ"; pagebreak() }
#if school-enabled("lancier") { include "lancier.typ"; pagebreak() }
#if school-enabled("maitre-lames") { include "maitre_lames.typ"; pagebreak() }
#if school-enabled("artilleur") { include "artilleur.typ"; pagebreak() }
#if school-enabled("mage-bestial") { include "mage_bestial.typ"; pagebreak() }
#if school-enabled("guerrier-mage") { include "guerrier_mage.typ"; pagebreak() }
#if school-enabled("sangremage") { include "sangremage.typ"; pagebreak() }

View File

@ -1,9 +1,6 @@
# Central configuration for the standalone balancing report.
# Configuration specific to the standalone balancing report.
# Ranges use inclusive `min` and `max` values.
build:
max_tier_exclusive: 5
weapons:
natural_precision: 7
die_sides: 10

39
data/config/build.yaml Normal file
View File

@ -0,0 +1,39 @@
# Central configuration shared by every Ravenous build target.
document:
name: Ravenous
title: Ravenous
copyright: Dandaedre
date: "2021"
color_scheme: warm
build:
# Data tiers are included while tier < max_tier_exclusive.
max_tier_exclusive: 5
warnings: true
# The default can be overridden without editing this file:
# typst compile --input preset=player-handbook main.typ player-handbook.pdf
preset: full
# Optional content selectors. Prefer command-line inputs for one-off books:
# --input origin=dragon_1 --input school=artilleur
# An empty value includes every origin or school.
origin: ""
school: ""
# Always excluded, in addition to the exclusions from the selected preset.
disabled_chapters: []
# Chapter IDs are defined in main.typ. Presets only list what they hide, so new
# chapters remain visible by default and a custom exclusion stays easy to audit.
presets:
full:
disabled_chapters: []
player-handbook:
disabled_chapters:
- acknowledgements
- geography
- game-master-help
- bestiary

@ -1 +1 @@
Subproject commit 4553fb36cb63e70965ff398817031f8646d63bae
Subproject commit de4fbf7832d468ada99c7739005de49fa591cb26

View File

@ -38,7 +38,7 @@
icon: true
short:
typst: 'box(height: 0.7em, baseline: 0.5pt, inset: 0pt, image("/images/icons/spider.svg"))'
description: '_Coût alternatif_ : Sang Bestial . Reprensente le sang d''un ennemi ; obtenu avec violence.'
description: '_Coût alternatif_ : Sang Bestial. Reprensente le sang d''un ennemi ; obtenu avec violence.'
group: "Écoles : Sangremage"
- key: cl_sgS

View File

@ -1,31 +1,31 @@
//----- Load the main document configuration -----
#import "/setup/setup.typ": config_main, disable-warnings
#import "/setup/setup.typ": config_main, disable-warnings, build-config, chapter-enabled
#show: config_main
//----- Enable this to suppress project warnings -----
// #disable-warnings()
//----- Apply the warning policy from data/config/build.yaml -----
#if not build-config.warnings { disable-warnings() }
//----- Front matter -----
#include "chapters/title.typ"
#include "chapters/acknowledgements.typ"
#if chapter-enabled("title") { include "chapters/title.typ" }
#if chapter-enabled("acknowledgements") { include "chapters/acknowledgements.typ" }
//----- Core rulebook chapters -----
#include "chapters/introduction/presentation.typ"
#include "chapters/introduction/geography.typ"
#include "chapters/hunters_and_calamities.typ"
#if chapter-enabled("presentation") { include "chapters/introduction/presentation.typ" }
#if chapter-enabled("geography") { include "chapters/introduction/geography.typ" }
#if chapter-enabled("hunters-and-calamities") { include "chapters/hunters_and_calamities.typ" }
//----- Additional chapters planned for later integration -----
#include "chapters/races.typ"
#include "chapters/rules/rules.typ"
#if chapter-enabled("races") { include "chapters/races.typ" }
#if chapter-enabled("rules") { include "chapters/rules/rules.typ" }
// #include "chapters/character_sheet.typ"
#include "chapters/creation.typ"
#include "chapters/experience_gains.typ"
#include "chapters/game_master_help.typ"
#include "chapters/bestiaire.typ"
#if chapter-enabled("creation") { include "chapters/creation.typ" }
#if chapter-enabled("experience-gains") { include "chapters/experience_gains.typ" }
#if chapter-enabled("game-master-help") { include "chapters/game_master_help.typ" }
#if chapter-enabled("bestiary") { include "chapters/bestiaire.typ" }
#include "chapters/origines.typ"
#include "chapters/schools/schools.typ"
#include "chapters/artisanat.typ"
#if chapter-enabled("origins") { include "chapters/origines.typ" }
#if chapter-enabled("schools") { include "chapters/schools/schools.typ" }
#if chapter-enabled("crafting") { include "chapters/artisanat.typ" }
// Tests
// #include "symbol_test.typ"

View File

@ -1,6 +1,5 @@
// Typed accessors and validation for the balance-report YAML configuration.
#let report-config = yaml("/data/config/balance_report.yaml")
#let build-settings = report-config.build
#let weapon-settings = report-config.weapons
#let sensitivity-settings = weapon-settings.sensitivity
#let armor-settings = weapon-settings.armor

View File

@ -1,12 +1,35 @@
// Shared build-time data limits, sourced from the report configuration.
// Tiers are included when `tier < max-tier-exclusive`.
#import "analysis/report_config.typ": build-settings
// Typed accessors and validation for the whole-project build configuration.
#let config = yaml("/data/config/build.yaml")
#let document-config = config.document
#let raw-build-config = config.build
#let presets = config.presets
// `--input preset=...` is the lightweight entry point for alternate editions.
#let selected-preset = sys.inputs.at("preset", default: raw-build-config.preset)
#assert(selected-preset in presets, message: "Unknown build preset: " + selected-preset)
#let selected-origin = sys.inputs.at("origin", default: raw-build-config.origin)
#let selected-school = sys.inputs.at("school", default: raw-build-config.school)
#let preset-disabled-chapters = presets.at(selected-preset).disabled_chapters
#let disabled-chapters = (
raw-build-config.disabled_chapters + preset-disabled-chapters
).dedup()
#let build-config = (
max-tier-exclusive: build-settings.max_tier_exclusive,
max-tier-exclusive: raw-build-config.max_tier_exclusive,
warnings: raw-build-config.warnings,
preset: selected-preset,
origin: selected-origin,
school: selected-school,
disabled-chapters: disabled-chapters,
)
#let max-tier-exclusive = build-config.max-tier-exclusive
#let tier-is-enabled(tier) = tier == none or tier < max-tier-exclusive
#let craft-tiers = range(0, max-tier-exclusive)
#let school-tiers = range(1, max-tier-exclusive)
#let chapter-enabled(id) = id not in disabled-chapters
#let origin-enabled(id) = selected-origin == "" or selected-origin == id
#let school-enabled(id) = selected-school == "" or selected-school == id
#assert(max-tier-exclusive > 1, message: "build.max_tier_exclusive must be greater than 1")

View File

@ -18,6 +18,9 @@
#let build_info = build_info
#let build-config = build_config.build-config
#let max-tier-exclusive = build_config.max-tier-exclusive
#let chapter-enabled = build_config.chapter-enabled
#let origin-enabled = build_config.origin-enabled
#let school-enabled = build_config.school-enabled
#let gls = model.gls
#let gls-description = model.gls-description
#let macros = macros

View File

@ -1,17 +1,18 @@
//----- Theme constructors -----
#import "themes.typ" as th
#import "../build_config.typ": document-config
// make-theme, make-theme-variable, fantasy-label,fantasy-rule,fantasy-section
//----- Project metadata -----
#let ravenous = (
name: "Ravenous",
title: "Ravenous",
copyright: "Dandaedre",
date: "2021",
name: document-config.name,
title: document-config.title,
copyright: document-config.copyright,
date: document-config.date,
)
//----- Select the active color scheme -----
#let color_scheme = "warm"
#let color_scheme = document-config.color_scheme
//----- Build the active theme and its variable form -----
#let theme = th.make-theme(theme-name: color_scheme)