From eebc106e75c94c0d6e8bbb5fede3d3094d4cf4f8 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 20 Aug 2026 01:43:05 +0200 Subject: [PATCH] Comment normalisation --- chapters/acknowledgements.typ | 22 +++--- chapters/craft/traps.typ | 10 --- chapters/origines.typ | 4 +- chapters/schools/artilleur.typ | 12 +--- chapters/schools/guerrier_mage.typ | 4 +- chapters/schools/mage_bestial.typ | 4 +- chapters/schools/sangremage.typ | 16 ++--- chapters/title.typ | 6 +- data/gen/build_info.typ | 2 +- data/src/glossaries/terms.yml | 8 +-- data/src/origines/leviathan_1.yaml | 2 +- main.typ | 10 +-- setup/glossary.typ | 8 +-- setup/macros.typ | 14 ++-- setup/model.typ | 26 +++---- setup/origin_models.typ | 32 +++------ setup/school_model.typ | 106 +++++++++++------------------ setup/set_tables.typ | 41 +++-------- setup/setup.typ | 18 ++--- setup/symbols.typ | 16 ++--- setup/themes.typ | 100 +++++++++++++-------------- setup/variables.typ | 8 +-- 22 files changed, 179 insertions(+), 290 deletions(-) diff --git a/chapters/acknowledgements.typ b/chapters/acknowledgements.typ index 8191ef9..128fc59 100644 --- a/chapters/acknowledgements.typ +++ b/chapters/acknowledgements.typ @@ -1,7 +1,7 @@ -// ----- Project data and theme ----- +//----- Project data and theme ----- #import "/setup/setup.typ": build_info, theme, theme-var -// ----- Edition title ----- +//----- Edition title ----- #align(center)[ #text( size: 24pt, @@ -24,7 +24,7 @@ ] #v(1.8em) -// ----- Build and version information ----- +//----- Build and version information ----- #align(center)[ #text(size: 9pt, fill: theme.muted)[ #emph[Copirightish#super[©] Dandaedre 2022–2024] @@ -48,7 +48,7 @@ #v(1.8em) -// ----- Define reusable credit entries ----- +//----- Define reusable credit entries ----- #let credit-left(label, content) = [ #text( weight: "bold", @@ -71,7 +71,7 @@ ] ] -// ----- Display project credits ----- +//----- Display project credits ----- #grid( columns: (1fr, 1fr), column-gutter: 2.5em, @@ -94,7 +94,7 @@ #v(1.8em) -// ----- List the color palette sources ----- +//----- List the color palette sources ----- #align(center)[ #text( size: 12pt, @@ -115,7 +115,7 @@ #v(1.8em) -// ----- List playtesting sessions and participants ----- +//----- List playtesting sessions and participants ----- #align(center)[ #text( size: 12pt, @@ -148,14 +148,12 @@ ) -// ----------------------------------------------------------------------------- -// Bottom of page -// ----------------------------------------------------------------------------- +//----- Bottom of page ----- #v(1fr) #align(center)[ - // ----- Display the project logo ----- + //----- Display the project logo ----- #image( "/images/icons/LogoNoush.jpg", width: 3.2cm, @@ -164,7 +162,7 @@ #v(1.5em) - // ----- Display the restricted-copy notice ----- + //----- Display the restricted-copy notice ----- #block( width: 100%, fill: theme.parchment, diff --git a/chapters/craft/traps.typ b/chapters/craft/traps.typ index 74025cd..03186bb 100644 --- a/chapters/craft/traps.typ +++ b/chapters/craft/traps.typ @@ -13,16 +13,6 @@ Créer un piège revient à définir l'effet qui est désiré de ce dernier, ain evaluate: "markup", theme-name: "steingrund", ) -// #let trap-data = csv("/data/src/craft/traps.csv") -// #st.set-table-style( -// table( -// columns: (1.4fr, auto, 3fr, 1.8fr, auto, auto), -// ..trap-data -// .flatten() -// .map(cell => [#eval(cell, mode: "markup", scope: macros.bigscope)]), -// ), -// table-theme: "steingrund", -// ) === Affliction Une affliction désigne n'importe quelle forme de @al_CC neutralisant temporairement un adversaire, cette altération sera déterminée par le @maitredejeu selon la nature du piège et sa description. diff --git a/chapters/origines.typ b/chapters/origines.typ index f32c776..47398ea 100644 --- a/chapters/origines.typ +++ b/chapters/origines.typ @@ -1,8 +1,6 @@ #import "/setup/origin_models.typ": creature-title, render-creature #import "/setup/setup.typ": theme -// ============================================================================= -// DOCUMENT -// ============================================================================= +//----- DOCUMENT ----- #let origins = ( ("Abyssal", "abyssal", 2), diff --git a/chapters/schools/artilleur.typ b/chapters/schools/artilleur.typ index 5d99f57..c88e8fb 100644 --- a/chapters/schools/artilleur.typ +++ b/chapters/schools/artilleur.typ @@ -1,8 +1,6 @@ #import "/setup/setup.typ": ddlvl, gls, school_presentation, st, theme -// ----------------------------------------------------------------------------- -// Artilleur -// ----------------------------------------------------------------------------- +//----- Artilleur ----- #school_presentation(( title: "Artilleur", @@ -25,9 +23,7 @@ techniques: "/data/src/schools/artilleur.tsv", introduction: [ - // ----------------------------------------------------------------------------- - // Mécaniques - // ----------------------------------------------------------------------------- + //----- Mécaniques ----- === Recul @@ -64,9 +60,7 @@ ayant infligé l'altération surchauffe. N'appliquez cet effet que sur l'action suivant celle où vous avez reçu cette altération. - // ----------------------------------------------------------------------------- - // Arbre d'artisanat du Canon Portatif - // ----------------------------------------------------------------------------- + //----- Arbre d'artisanat du Canon Portatif ----- #v(1fr) diff --git a/chapters/schools/guerrier_mage.typ b/chapters/schools/guerrier_mage.typ index 2a3f9d5..6924be4 100644 --- a/chapters/schools/guerrier_mage.typ +++ b/chapters/schools/guerrier_mage.typ @@ -18,9 +18,7 @@ techniques: "/data/src/schools/guerrier_mage.tsv", )) -// ----------------------------------------------------------------------------- -// Jauge de Manaessence -// ----------------------------------------------------------------------------- +//----- Jauge de Manaessence ----- === Jauge de Manaessence diff --git a/chapters/schools/mage_bestial.typ b/chapters/schools/mage_bestial.typ index c6e3557..7aeee9b 100644 --- a/chapters/schools/mage_bestial.typ +++ b/chapters/schools/mage_bestial.typ @@ -21,9 +21,7 @@ techniques: "/data/src/schools/mage_bestial.tsv", )) -// ----------------------------------------------------------------------------- -// Traits, aspects et passifs -// ----------------------------------------------------------------------------- +//----- Traits, aspects et passifs ----- #v(1.5em) diff --git a/chapters/schools/sangremage.typ b/chapters/schools/sangremage.typ index f1c9d86..0a0aaf0 100644 --- a/chapters/schools/sangremage.typ +++ b/chapters/schools/sangremage.typ @@ -16,9 +16,7 @@ techniques: "/data/src/schools/sangremage.tsv", )) -// ----------------------------------------------------------------------------- -// Coûts alternatifs -// ----------------------------------------------------------------------------- +//----- Coûts alternatifs ----- === Coûts alternatifs @@ -27,17 +25,13 @@ // - #strong[@no_cost:long @no_cost:short] --- #noCostDefinition() // (Vous pouvez utiliser leur coût alternatif de @sg_cost pour les utiliser.) -// ----------------------------------------------------------------------------- -// Attaque de Sangressance -// ----------------------------------------------------------------------------- +//----- Attaque de Sangressance ----- // === #sgAtk() // #sgAtkDefinition() -// ----------------------------------------------------------------------------- -// Canalisation -// ----------------------------------------------------------------------------- +//----- Canalisation ----- === Canalisation @@ -55,9 +49,7 @@ fin de la canalisation, celle-ci est interrompue et l'incantation est annulée. // ne se terminant pas. // ] -// ----------------------------------------------------------------------------- -// Canalisation Élémentaire -// ----------------------------------------------------------------------------- +//----- Canalisation Élémentaire ----- ==== Canalisation Élémentaire diff --git a/chapters/title.typ b/chapters/title.typ index 14851e2..6c11b60 100644 --- a/chapters/title.typ +++ b/chapters/title.typ @@ -1,7 +1,7 @@ -// ----- Load the active project theme ----- +//----- Load the active project theme ----- #import "/setup/setup.typ": theme -// ----- Render the document title page ----- +//----- Render the document title page ----- #page(numbering: none)[ #align(center + horizon)[ #text( @@ -30,7 +30,7 @@ ] ] -// ----- Separate the title page from the table of contents ----- +//----- Separate the title page from the table of contents ----- #pagebreak() #outline(title: "Table des matières") diff --git a/data/gen/build_info.typ b/data/gen/build_info.typ index 167f23b..0d35c4a 100644 --- a/data/gen/build_info.typ +++ b/data/gen/build_info.typ @@ -1,4 +1,4 @@ -// ----- Autogenerated build metadata ----- +//----- Autogenerated build metadata ----- #let build_info = ( build_commit : "bf2d02fc69b07241a01a01bd6aee1b858429a91c", build_commit_short : "bf2d02f", diff --git a/data/src/glossaries/terms.yml b/data/src/glossaries/terms.yml index bad242b..df64c79 100644 --- a/data/src/glossaries/terms.yml +++ b/data/src/glossaries/terms.yml @@ -311,19 +311,19 @@ - key: rl_copie short: Copie en Sangressence - description: 'Il s''agit d''une copie identique d''un point de vue fonctionnel, cependant, à la discrétion du joueur et \maitredejeu{}, cette copie pourra prendre une apparence totalement différente. À moins que la capacité ne le précise autrement, une copie en sangressence ne peut copier des effets uniques ou réservés si la personne à l''origine de la copie ne pourrait pas elle-même utiliser la cible de la copie.' + description: 'Il s''agit d''une copie identique d''un point de vue fonctionnel, cependant, à la discrétion du joueur et @maitredejeu, cette copie pourra prendre une apparence totalement différente. À moins que la capacité ne le précise autrement, une copie en sangressence ne peut copier des effets uniques ou réservés si la personne à l''origine de la copie ne pourrait pas elle-même utiliser la cible de la copie.' group: Termes utilisés - key: rl_proximite short: À proximité sort: proximité - description: 'Un combattant, créature ou chasseur est dit \emph{à proximité} lorsqu''il est situé à une distance inférieure à sa distance de demi-déplacement.' + description: 'Un combattant, créature ou chasseur est dit _à proximité_ lorsqu''il est situé à une distance inférieure à sa distance de demi-déplacement.' group: Termes utilisés - key: rl_portee short: À portée sort: portée - description: 'Un combattant, créature ou chasseur est dit \emph{à portée} lorsqu''il est situé dans une distance inférieure à la portée de son arme couramment équipée (ses poings si le chasseur ou la créature est désarmé·e) plus un demi déplacement. La portée correspond à la distance à laquelle le chasseur pourrait porter une attaque.' + description: 'Un combattant, créature ou chasseur est dit _à portée_ lorsqu''il est situé dans une distance inférieure à la portée de son arme couramment équipée (ses poings si le chasseur ou la créature est désarmé·e) plus un demi déplacement. La portée correspond à la distance à laquelle le chasseur pourrait porter une attaque.' group: Termes utilisés - key: rl_contact @@ -407,7 +407,7 @@ - key: ca_secondaire short: Secondaire - description: '(_Caractéristique_) Désigne toutes les caractéristiques dérivées des caractéristiques principales. Cette liste inclue (mais n''est pas limitée à) Torque, Vitesse, Vitesse aérienne, Saut hauteur, Saut longueur, Actions, @jauge, \jtox{} et @rl_satiete. Voir \reference{ssec:caracteristiques_secondaires}{Caractéristiques secondaires}.' + description: '(_Caractéristique_) Désigne toutes les caractéristiques dérivées des caractéristiques principales. Cette liste inclue (mais n''est pas limitée à) Torque, Vitesse, Vitesse aérienne, Saut hauteur, Saut longueur, Actions, @jauge, @rl_jauge_toxine et @rl_satiete. Voir \reference{ssec:caracteristiques_secondaires}{Caractéristiques secondaires}.' group: Termes utilisés - key: rl_reussite_totale diff --git a/data/src/origines/leviathan_1.yaml b/data/src/origines/leviathan_1.yaml index 1a73e88..d9bd3aa 100644 --- a/data/src/origines/leviathan_1.yaml +++ b/data/src/origines/leviathan_1.yaml @@ -48,7 +48,7 @@ stades: name: Totem Impie description: >- Sacrifiez un Totem Impie, Choisissez l'un - Gagnez acces à un élément de votre - choix\,; ou gagnez #resist(2) dans une résistance élémentaire de votre choix. + choix; ou gagnez #resist(2) dans une résistance élémentaire de votre choix. Vous ne pouvez avoir qu'un seul effet de Totem actif à la fois. - type: passive description: Initiative +5 diff --git a/main.typ b/main.typ index 2ecd5f8..fb60483 100644 --- a/main.typ +++ b/main.typ @@ -1,20 +1,20 @@ -// ----- Load the main document configuration ----- +//----- Load the main document configuration ----- #import "/setup/setup.typ": config_main, disable-warnings #show: config_main -// ----- Enable this to suppress project warnings ----- +//----- Enable this to suppress project warnings ----- // #disable-warnings() -// ----- Front matter ----- +//----- Front matter ----- #include "chapters/title.typ" #include "chapters/acknowledgements.typ" -// ----- Core rulebook chapters ----- +//----- Core rulebook chapters ----- #include "chapters/introduction/presentation.typ" #include "chapters/introduction/geography.typ" #include "chapters/hunters_and_calamities.typ" -// ----- Additional chapters planned for later integration ----- +//----- Additional chapters planned for later integration ----- #include "chapters/origines.typ" #include "chapters/schools/schools.typ" #include "chapters/artisanat.typ" diff --git a/setup/glossary.typ b/setup/glossary.typ index 3ab90df..48e261b 100644 --- a/setup/glossary.typ +++ b/setup/glossary.typ @@ -52,7 +52,7 @@ let result = (:) - // ----- Convert each YAML field to its Typst representation ----- + //----- Convert each YAML field to its Typst representation ----- let sort_key = "" for (key, value) in entry { result.insert( @@ -91,7 +91,7 @@ ) } - // ----- Fill in missing optional fields ----- + //----- Fill in missing optional fields ----- if "key" not in result { panic( "Glossary entry " @@ -144,7 +144,7 @@ let entries = () let key_sources = (:) - // ----- Normalize a single file into an array ----- + //----- Normalize a single file into an array ----- if type(files) != array { files = (files,) } @@ -174,7 +174,7 @@ entries } -// ----- Load all project glossaries ----- +//----- Load all project glossaries ----- #let glossary = read-glossary(( "/data/src/glossaries/general.yml", "/data/src/glossaries/classes.yml", diff --git a/setup/macros.typ b/setup/macros.typ index c4d3622..869829d 100644 --- a/setup/macros.typ +++ b/setup/macros.typ @@ -1,10 +1,10 @@ -// ----- Project theme ----- +//----- Project theme ----- #import "variables.typ": theme, theme-var #import "symbols.typ" as symbols #import "limits.typ": hunbal #import "@preview/glossarium:0.5.10": gls -// ----- The ubiquitous ddlvl macro ----- +//----- The ubiquitous ddlvl macro ----- #let ddlvl(n, plus: false, max_number: 5) = { let plus = if plus { "+" @@ -26,7 +26,7 @@ ddlvl(n, plus: plus, max_number: 4) } -// ----- Generic repeating macro ----- +//----- Generic repeating macro ----- // // Examples: // #repeat(3, [X]) -> XXX @@ -59,7 +59,7 @@ #let winelvl(lvl) = { repeat(lvl, symbols.wine-box, max-number: 3) } #let timelvl(lvl) = { repeat(lvl, symbols.time-box, max-number: 3) } -// ----- Difficulty level macro ----- +//----- Difficulty level macro ----- #let difficulty-stars(difficulty, max: 5) = { for i in range(max) { if difficulty >= i + 1 { @@ -77,7 +77,7 @@ } } } -// ----- Resistance level ----- +//----- Resistance level ----- #let resist(n) = { if n == 0 { "( )" @@ -92,7 +92,7 @@ } } -// ----- Create a styled reminder/information box ----- +//----- Create a styled reminder/information box ----- #let memo_box(title: "À retenir", content) = { block( fill: theme.parchment, @@ -106,7 +106,7 @@ ] } -// ----- Inline help ----- +//----- Inline help ----- #let inline_help(content) = { emph[( #content )] } diff --git a/setup/model.typ b/setup/model.typ index cdbe0b9..59e1c2d 100644 --- a/setup/model.typ +++ b/setup/model.typ @@ -20,7 +20,7 @@ theme, theme-var, ) = { - // ----- PAGE AND TYPOGRAPHY ----- + //----- PAGE AND TYPOGRAPHY ----- set page( paper: "a4", @@ -52,7 +52,7 @@ numbering: theme-var("heading-numbering"), ) - // ----- HEADING HELPERS ----- + //----- HEADING HELPERS ----- // Return a heading's displayed number, except for level 1 let heading-number(it) = { @@ -79,7 +79,7 @@ } } - // ----- HEADINGS ----- + //----- HEADINGS ----- // Level 1: major section show heading.where(level: 1): set align(center) @@ -188,7 +188,7 @@ ] ] - // ----- INLINE FORMATTING ----- + //----- INLINE FORMATTING ----- // Style strong emphasis using the theme show strong: it => text( @@ -211,7 +211,7 @@ fill: theme.link, ) - // ----- KEY TERMS ----- + //----- KEY TERMS ----- show "ravenous": ( text( @@ -219,14 +219,14 @@ ) ) - // ----- TABLES ----- + //----- TABLES ----- // Apply the theme's default table border set table( stroke: 0.5pt + theme.border, ) - // ----- GLOSSARY SETUP ----- + //----- GLOSSARY SETUP ----- // Enable glossary rendering and register project entries show: make-glossary @@ -243,7 +243,7 @@ } } - // ----- GLOSSARY ENTRY RENDERER ----- + //----- GLOSSARY ENTRY RENDERER ----- // Render an individual glossary entry as a themed card let print-glossary-entry(entry, ..) = { @@ -275,7 +275,7 @@ ) let has-alts = entry.custom != none and "alts" in entry.custom - // ----- GLOSSARY CARD ----- + //----- GLOSSARY CARD ----- block( width: 100%, @@ -297,7 +297,7 @@ ), )[ - // ----- ENTRY HEADER ----- + //----- ENTRY HEADER ----- #grid( columns: ( @@ -353,7 +353,7 @@ // ] else [], ) - // ----- ENTRY DESCRIPTION ----- + //----- ENTRY DESCRIPTION ----- #if entry.description != none [ #block( @@ -373,7 +373,7 @@ ] ] - // ----- ALTERNATIVE NAMES ----- + //----- ALTERNATIVE NAMES ----- #if has-alts [ #v(0.55em) @@ -412,7 +412,7 @@ ] } - // ----- DOCUMENT AND GLOSSARY ----- + //----- DOCUMENT AND GLOSSARY ----- // Render the main document content document diff --git a/setup/origin_models.typ b/setup/origin_models.typ index 5e02cae..d1ad9ab 100644 --- a/setup/origin_models.typ +++ b/setup/origin_models.typ @@ -2,13 +2,9 @@ #import "setup.typ": ddlvl, macros // #import "variables.typ" -// ============================================================================= -// CREATURE RENDERER -// ============================================================================= +//----- CREATURE RENDERER ----- -// ----------------------------------------------------------------------------- -// STYLE CONFIGURATION -// ----------------------------------------------------------------------------- +//----- STYLE CONFIGURATION ----- // Main spacing rhythm. #let creature-spacing = ( @@ -109,9 +105,7 @@ inset: 2pt, ) -// ----------------------------------------------------------------------------- -// STAGE NAMES -// ----------------------------------------------------------------------------- +//----- STAGE NAMES ----- #let stage-name(number) = { ( @@ -131,9 +125,7 @@ #let eval-typst(markup) = { eval(markup, mode: "markup", scope: macros.bigscope) } -// ----------------------------------------------------------------------------- -// FLUFF -// ----------------------------------------------------------------------------- +//----- FLUFF ----- #let fluff(content, author) = { block( @@ -157,9 +149,7 @@ ] } -// ----------------------------------------------------------------------------- -// ABILITY -// ----------------------------------------------------------------------------- +//----- ABILITY ----- #let render-ability(type, description, name: none) = { let label = if type == "actif" { @@ -219,9 +209,7 @@ ] } -// ----------------------------------------------------------------------------- -// STATS -// ----------------------------------------------------------------------------- +//----- STATS ----- #let render-stats(stats) = { if stats.max != none { @@ -255,9 +243,7 @@ } } -// ----------------------------------------------------------------------------- -// STAGE -// ----------------------------------------------------------------------------- +//----- STAGE ----- #let render-stage(stage) = { block( @@ -305,9 +291,7 @@ ] } -// ----------------------------------------------------------------------------- -// CREATURE -// ----------------------------------------------------------------------------- +//----- CREATURE ----- #let render-creature(data) = { show heading: it => { diff --git a/setup/school_model.typ b/setup/school_model.typ index abc4a9c..d41558f 100644 --- a/setup/school_model.typ +++ b/setup/school_model.typ @@ -1,12 +1,11 @@ -// ----- Project theme ----- +//----- Project theme ----- #import "variables.typ": theme, theme-var #import "spacers.typ" as spacers #import "set_tables.typ" as st #import "macros.typ" as macros -// ============================================================================= -// ----- Technique TSV importer ----- +//----- Technique TSV importer ----- // // Imports technique data from a TSV file and renders it as tiered tables. // @@ -22,9 +21,8 @@ // Tier 2 // Technique Niv Type Coût [jauge] Effet ... // ... -// ============================================================================= -// ----- Define the TSV column mapping ----- +//----- Define the TSV column mapping ----- // The TSV keeps blood / jauge / other costs separate. // They are merged into a single displayed "Coût" cell. #let technique-columns = ( @@ -37,11 +35,9 @@ effect: 6, ) -// ============================================================================= -// ----- TSV parsing helpers ----- -// ============================================================================= +//----- TSV parsing helpers ----- -// ----- Safely retrieve a cell with a fallback value ----- +//----- Safely retrieve a cell with a fallback value ----- #let cell(row, index, default: "") = { if index < row.len() { row.at(index) @@ -50,17 +46,17 @@ } } -// ----- Check whether a row contains no data ----- +//----- Check whether a row contains no data ----- #let is-empty-row(row) = { row.all(value => value.trim() == "") } -// ----- Check whether a row is a repeated TSV header ----- +//----- Check whether a row is a repeated TSV header ----- #let is-header-row(row) = { row.len() > 0 and cell(row, 0).trim() == "Technique" } -// ----- Extract the tier number from a tier marker row ----- +//----- Extract the tier number from a tier marker row ----- #let tier-name(row) = { if row.len() == 0 { none @@ -74,11 +70,9 @@ } } } -// ============================================================================= -// ----- Technique cost formatting ----- -// ============================================================================= +//----- Technique cost formatting ----- -// ----- Merge blood, jauge and other costs into one displayed cell ----- +//----- Merge blood, jauge and other costs into one displayed cell ----- #let format-cost(blood, jauge, other) = { let parts = () @@ -99,7 +93,7 @@ } } -// ----- Convert a TSV row into the table's five displayed cells ----- +//----- Convert a TSV row into the table's five displayed cells ----- #let technique-row(row) = { let c = technique-columns @@ -118,9 +112,7 @@ eval(cell(row, c.effect), mode: "markup", scope: macros.bigscope), ) } -// ============================================================================= -// ----- Render a single technique tier ----- -// ============================================================================= +//----- Render a single technique tier ----- #let technique-tier-table(tier, rows) = { st.set-table-style( @@ -134,7 +126,7 @@ 0.72cm, 1fr, ), - // ----- Use continuous backgrounds without column gutters ----- + //----- Use continuous backgrounds without column gutters ----- column-gutter: 0pt, row-gutter: 0pt, stroke: none, @@ -146,9 +138,7 @@ left, ), - // ------------------------------------------------------------------------- - // Tier title - // ------------------------------------------------------------------------- + //----- Tier title ----- ..( table.cell( [ @@ -184,9 +174,7 @@ ), ), - // ------------------------------------------------------------------------- - // Table header - // ------------------------------------------------------------------------- + //----- Table header ----- table.header( [Technique], @@ -195,9 +183,7 @@ [Coût], [Effet], ), - // ------------------------------------------------------------------------- - // Technique rows - // ------------------------------------------------------------------------- + //----- Technique rows ----- ..rows .enumerate() @@ -211,23 +197,21 @@ } -// ============================================================================= -// ----- Parse all technique tiers ----- -// ============================================================================= +//----- Parse all technique tiers ----- -// ----- Group TSV rows by their tier markers ----- +//----- Group TSV rows by their tier markers ----- #let parse-techniques(data) = { let tiers = () let current-tier = none let current-rows = () for row in data { - // ----- Ignore empty separator rows ----- + //----- Ignore empty separator rows ----- if is-empty-row(row) { continue } - // ----- Start a new tier when a tier marker is found ----- + //----- Start a new tier when a tier marker is found ----- let tier = tier-name(row) if tier != none { @@ -245,19 +229,19 @@ continue } - // ----- Ignore repeated TSV headers ----- + //----- Ignore repeated TSV headers ----- if is-header-row(row) { continue } - // ----- Add technique rows to the current tier ----- + //----- Add technique rows to the current tier ----- // Rows before the first tier are ignored. if current-tier != none { current-rows.push(row) } } - // ----- Save the final tier ----- + //----- Save the final tier ----- if current-tier != none { tiers.push(( current-tier, @@ -268,11 +252,9 @@ tiers } -// ============================================================================= -// ----- Public technique importer ----- -// ============================================================================= +//----- Public technique importer ----- -// ----- Import a TSV file and render its technique tiers ----- +//----- Import a TSV file and render its technique tiers ----- #let techniques(path) = { let data = csv( path, @@ -282,7 +264,7 @@ let tiers = parse-techniques(data) for (index, tier) in tiers.enumerate() { - // ----- Limit the number of rendered tiers ----- + //----- Limit the number of rendered tiers ----- // TODO: Remove this magic value if (index >= 4) { break } @@ -294,27 +276,23 @@ rows, ) - // ----- Add spacing between tiers, but not after the last ----- + //----- Add spacing between tiers, but not after the last ----- if index < tiers.len() - 1 { v(0.7em) } } } -// ============================================================================= -// ----- Class presentation template ----- -// ============================================================================= +//----- Class presentation template ----- -// ----- Render the complete presentation for a class ----- +//----- Render the complete presentation for a class ----- #let school_presentation(class_info) = { set text( font: theme-var("font"), fill: theme.ink, ) - // --------------------------------------------------------------------------- - // ----- Header ----- - // --------------------------------------------------------------------------- + //----- Header ----- align(center)[ #text( @@ -327,7 +305,7 @@ #v(0.35em) - // ----- Ornamental divider ----- + //----- Ornamental divider ----- #grid( columns: (1fr, auto, 1fr), column-gutter: 0.55em, @@ -352,16 +330,14 @@ v(1em) - // --------------------------------------------------------------------------- - // ----- Illustration and introduction ----- - // --------------------------------------------------------------------------- + //----- Illustration and introduction ----- grid( columns: (1.05fr, 1.7fr), column-gutter: 1.3em, align: top, - // ----- Class illustration ----- + //----- Class illustration ----- [ #block( fill: theme.parchment-dark, @@ -380,7 +356,7 @@ ] ], - // ----- Class introduction ----- + //----- Class introduction ----- [ #spacers.fantasy-section("PRÉSENTATION", theme-name: "warm")[ #text( @@ -392,9 +368,7 @@ v(1em) - // --------------------------------------------------------------------------- - // ----- Class profile and mechanics ----- - // --------------------------------------------------------------------------- + //----- Class profile and mechanics ----- spacers.fantasy-rule(theme-name: "warm") @@ -405,7 +379,7 @@ column-gutter: 1.2em, align: top, - // ----- Class profile / radar ----- + //----- Class profile / radar ----- [ #block( fill: theme.parchment, @@ -423,9 +397,9 @@ ] ], - // ----- Class mechanics ----- + //----- Class mechanics ----- [ - // ----- Exclusive mechanic ----- + //----- Exclusive mechanic ----- #block( fill: theme.parchment-dark, stroke: 0.8pt + theme.gold, @@ -463,7 +437,7 @@ #v(0.7em) - // ----- Display the class difficulty rating ----- + //----- Display the class difficulty rating ----- #grid( columns: (1fr, auto), align: horizon, @@ -487,7 +461,7 @@ class_info.introduction pagebreak() } - // ----- Techniques section ----- + //----- Techniques section ----- heading("Techniques", level: 3, numbering: none, outlined: false) techniques(class_info.techniques) diff --git a/setup/set_tables.typ b/setup/set_tables.typ index 16c51e6..a59aa4c 100644 --- a/setup/set_tables.typ +++ b/setup/set_tables.typ @@ -1,6 +1,4 @@ -// ============================================================================= -// INNATE TABLE STYLE -// ============================================================================= +//----- INNATE TABLE STYLE ----- // // Applies the project's theme to ordinary Typst tables: // @@ -21,15 +19,12 @@ // #set-table-style(theme: theme) // #set-table-style(theme: other-theme) // -// ============================================================================= #import "variables.typ": theme #import "symbols.typ" as symbols #import "themes.typ": resolve-table-theme, themes -// ============================================================================= -// CONFIGURATION -// ============================================================================= +//----- CONFIGURATION ----- #let innate-table-config = ( // Geometry @@ -54,9 +49,7 @@ alternating: true, ) -// ============================================================================= -// THEME RESOLUTION -// ============================================================================= +//----- THEME RESOLUTION ----- // COLOURS @@ -89,9 +82,7 @@ } -// ============================================================================= -// INNATE TABLE STYLE -// ============================================================================= +//----- INNATE TABLE STYLE ----- #let set-table-style( original-table, @@ -110,9 +101,7 @@ alternating } - // --------------------------------------------------------------------------- - // TABLE GEOMETRY - // --------------------------------------------------------------------------- + //----- TABLE GEOMETRY ----- set table( column-gutter: innate-table-config.column-gutter, @@ -126,9 +115,7 @@ // No outer grid. stroke: stroke, - // ------------------------------------------------------------------------- - // Cell fills - // ------------------------------------------------------------------------- + //----- Cell fills ----- // // Row 0 is treated as the header. // @@ -147,9 +134,7 @@ }, ) - // --------------------------------------------------------------------------- - // BODY TEXT - // --------------------------------------------------------------------------- + //----- BODY TEXT ----- show table.cell: set text( size: if text-size != none { text-size } else { @@ -158,9 +143,7 @@ fill: table-body-text(table-theme: table-theme), ) - // --------------------------------------------------------------------------- - // HEADER - // --------------------------------------------------------------------------- + //----- HEADER ----- show table.cell: it => { set text( @@ -184,9 +167,7 @@ } } - // --------------------------------------------------------------------------- - // HEADER INSET - // --------------------------------------------------------------------------- + //----- HEADER INSET ----- show table.header: it => { table.cell( @@ -198,9 +179,7 @@ )[it] } - // --------------------------------------------------------------------------- - // BODY CELL BORDERS - // --------------------------------------------------------------------------- + //----- BODY CELL BORDERS ----- set table.cell( stroke: ( diff --git a/setup/setup.typ b/setup/setup.typ index 740ef0d..636ad8a 100644 --- a/setup/setup.typ +++ b/setup/setup.typ @@ -1,15 +1,15 @@ -// ----- Project variables ----- +//----- Project variables ----- #import "variables.typ": ravenous, theme, theme-var #import "limits.typ": hunbal #import "/data/gen/build_info.typ": build_info -// ----- Imports ----- +//----- Imports ----- #import "model.typ" as model #import "macros.typ" as macros #import "symbols.typ" as symbols #import "set_tables.typ" as st #import "csv_table.typ" as csv_import -// ----- Re-expose shared project data ----- +//----- Re-expose shared project data ----- #let ravenous = ravenous #let theme = theme #let theme-var = theme-var @@ -23,29 +23,29 @@ #let bigscope = macros.bigscope #let csv-table = csv_import.csv-table -// ----- Public template for class presentations ----- +//----- Public template for class presentations ----- #let school_presentation = model.school_presentation -// ----- Alias for the project's help box ----- +//----- Alias for the project's help box ----- #let ravhelp = macros.memo_box #let inline_help = macros.inline_help -// ----- Configure warnings for the project namespace ----- +//----- Configure warnings for the project namespace ----- #import "@preview/uniwarn:0.1.1" as uwarn #let ns = "transfer_warnings" #uwarn.register-namespace(ns) // will panic if already registered by another package -// ----- Define project-specific warning helpers ----- +//----- Define project-specific warning helpers ----- #let nogls = uwarn.warning.with(namespace: ns, prefix: "[glos] ") // #let ravhelp = uwarn.warning.with(namespace: ns, prefix: "[hlpb] ") #let warn = uwarn.warning.with(namespace: ns, prefix: "[warn] ") #let comment = uwarn.warning.with(namespace: ns, prefix: "[info] ") -// ----- Enable or disable project warnings ----- +//----- Enable or disable project warnings ----- #let disable-warnings = uwarn.disable-warnings.with(ns) #let enable-warnings = uwarn.enable-warnings.with(ns) -// ----- Apply the Ravenous model to the main document ----- +//----- Apply the Ravenous model to the main document ----- #let config_main(variables: ravenous, document) = { show: model.model(ravenous, document, theme, theme-var) } diff --git a/setup/symbols.typ b/setup/symbols.typ index 5218e2f..63edfbf 100644 --- a/setup/symbols.typ +++ b/setup/symbols.typ @@ -127,18 +127,14 @@ image("/images/icons/wine-fill.svg"), ) -// ============================================================================= -// SVG RECOLORING -// ============================================================================= +//----- SVG RECOLORING ----- #let re-colorize(svg-box, color) = { let current = svg-box let source = none let image-node = none - // --------------------------------------------------------------------------- - // Unwrap boxes until we find an image source. - // --------------------------------------------------------------------------- + //----- Unwrap boxes until we find an image source. ----- for _ in range(2) { let direct-source = current.at("source", default: none) @@ -179,9 +175,7 @@ return svg-box } - // --------------------------------------------------------------------------- - // Recolor black. - // --------------------------------------------------------------------------- + //----- Recolor black. ----- let replacement = color.to-hex() let black-pattern = regex( @@ -195,9 +189,7 @@ return svg-box } - // --------------------------------------------------------------------------- - // Preserve sizing. - // --------------------------------------------------------------------------- + //----- Preserve sizing. ----- let image-width = image-node.at("width", default: auto) let image-height = image-node.at("height", default: auto) diff --git a/setup/themes.typ b/setup/themes.typ index 3c12540..7e6a3e5 100644 --- a/setup/themes.typ +++ b/setup/themes.typ @@ -1,8 +1,8 @@ -// ----- Available color themes ----- +//----- Available color themes ----- #let default-theme = "warm" #let themes = ( warm: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#302c26"), muted-ink: rgb("#716957"), gold: rgb("#9b8050"), @@ -15,31 +15,31 @@ blood: rgb("#7A2424"), muted: rgb("#756B5D"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#7A2424"), heading-accent: rgb("#9b8050"), heading-subtle: rgb("#716957"), emphasis: rgb("#7A2424"), link: rgb("#7A2424"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "❖", chapter-symbol: "✧", small-symbol: "•", bullet-symbol: "–", separator-symbol: "◆", - // ----- Progress bar and the sort ----- + //----- Progress bar and the sort ----- progress-full: "●", progress-half: "◐", progress-void: "○", - // ----- Misc ----- + //----- Misc ----- star: "★", font: "Libertinus Serif", ), steel: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#292B32"), muted-ink: rgb("#626873"), gold: rgb("#7187A0"), @@ -52,14 +52,14 @@ blood: rgb("#526D85"), muted: rgb("#69717C"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#526D85"), heading-accent: rgb("#7187A0"), heading-subtle: rgb("#626873"), emphasis: rgb("#526D85"), link: rgb("#526D85"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "◆", chapter-symbol: "◇", @@ -67,7 +67,7 @@ ), fangdrael: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#29302A"), muted-ink: rgb("#687064"), gold: rgb("#7F8F62"), @@ -80,14 +80,14 @@ blood: rgb("#536B45"), muted: rgb("#6D7568"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#536B45"), heading-accent: rgb("#7F8F62"), heading-subtle: rgb("#687064"), emphasis: rgb("#536B45"), link: rgb("#536B45"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "❦", chapter-symbol: "›", @@ -95,7 +95,7 @@ ), bw: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#202020"), muted-ink: rgb("#666666"), gold: rgb("#777777"), @@ -108,7 +108,7 @@ blood: rgb("#444444"), muted: rgb("#707070"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#202020"), heading-accent: rgb("#484848"), heading-subtle: rgb("#666666"), @@ -117,7 +117,7 @@ ), high-contrast: ( - // ----- Core colors ----- + //----- Core colors ----- ink: rgb("#111111"), muted-ink: rgb("#333333"), gold: rgb("#005A9C"), @@ -130,7 +130,7 @@ blood: rgb("#A40000"), muted: rgb("#444444"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#003B66"), heading-accent: rgb("#005A9C"), heading-subtle: rgb("#333333"), @@ -139,7 +139,7 @@ ), yon-sen: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#292724"), muted-ink: rgb("#625D54"), vermilion: rgb("#9E3B2F"), @@ -157,7 +157,7 @@ border: rgb("#C8BDA8"), muted: rgb("#777064"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#743129"), heading-accent: rgb("#304C5E"), heading-subtle: rgb("#625D54"), @@ -165,7 +165,7 @@ link: rgb("#304C5E"), blood: rgb("#8C3029"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "一、", section-symbol: "※", separator-symbol: "—", @@ -173,7 +173,7 @@ quote-symbol: "「", ), steingrund: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#25262B"), muted-ink: rgb("#686A73"), gold: rgb("#8E96A8"), @@ -186,14 +186,14 @@ blood: rgb("#6F2535"), muted: rgb("#747781"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#572331"), heading-accent: rgb("#7D879B"), heading-subtle: rgb("#686A73"), emphasis: rgb("#78283B"), link: rgb("#53667D"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "I.", section-symbol: "†", chapter-symbol: "✠", @@ -201,18 +201,18 @@ bullet-symbol: "–", separator-symbol: "❖", - // ----- Progress bar and the sort ----- + //----- Progress bar and the sort ----- progress-full: "◆", progress-half: "◈", progress-void: "◇", - // ----- Misc ----- + //----- Misc ----- star: "✦", font: "Libertinus Serif", ), anankar: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#3A3025"), muted-ink: rgb("#796C59"), gold: rgb("#B28A45"), @@ -225,14 +225,14 @@ blood: rgb("#8B4930"), muted: rgb("#81735E"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#715126"), heading-accent: rgb("#A97E39"), heading-subtle: rgb("#796C59"), emphasis: rgb("#8B4930"), link: rgb("#426E72"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "☥", chapter-symbol: "◇", @@ -240,18 +240,18 @@ bullet-symbol: "›", separator-symbol: "◆", - // ----- Progress bar and the sort ----- + //----- Progress bar and the sort ----- progress-full: "◆", progress-half: "◈", progress-void: "◇", - // ----- Misc ----- + //----- Misc ----- star: "✦", font: "Libertinus Serif", ), drekinsteps: ( - // ----- Base colors ----- + //----- Base colors ----- ink: rgb("#33251F"), muted-ink: rgb("#765B4E"), gold: rgb("#C08A3E"), @@ -264,14 +264,14 @@ blood: rgb("#A83224"), muted: rgb("#7D6557"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#8E2C20"), heading-accent: rgb("#C0782D"), heading-subtle: rgb("#765B4E"), emphasis: rgb("#B53B26"), link: rgb("#9A4325"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "◆", chapter-symbol: "✦", @@ -279,17 +279,17 @@ bullet-symbol: "›", separator-symbol: "✧", - // ----- Progress bar and the sort ----- + //----- Progress bar and the sort ----- progress-full: "◆", progress-half: "◈", progress-void: "◇", - // ----- Misc ----- + //----- Misc ----- star: "★", font: "Libertinus Serif", ), draan: ( - // ----- Base colors ----- + //----- Base colors ----- // Deep abyssal blue-violet rather than conventional black/brown. ink: rgb("#25223D"), muted-ink: rgb("#665E82"), @@ -299,7 +299,7 @@ gold: rgb("#5F9189"), dark-gold: rgb("#3F6965"), - // ----- Parchment colors ----- + //----- Parchment colors ----- // Alien stone / fungal / bruised-paper palette. // Each layer shifts hue rather than simply changing brightness. parchment: rgb("#E2DFE8"), @@ -313,7 +313,7 @@ blood: rgb("#713F70"), muted: rgb("#706A82"), - // ----- Semantic colors ----- + //----- Semantic colors ----- heading: rgb("#513B72"), heading-accent: rgb("#4F817B"), heading-subtle: rgb("#665E82"), @@ -323,7 +323,7 @@ // Cold turquoise contrasts strongly with the violet ink. link: rgb("#397A76"), - // ----- Heading and decorative symbols ----- + //----- Heading and decorative symbols ----- heading-numbering: "1.", section-symbol: "◈", chapter-symbol: "⬖", @@ -331,23 +331,23 @@ bullet-symbol: "›", separator-symbol: "◇", - // ----- Progress bar and the sort ----- + //----- Progress bar and the sort ----- progress-full: "⬢", progress-half: "◐", progress-void: "⬡", - // ----- Misc ----- + //----- Misc ----- star: "✦", font: "Libertinus Serif", ), ) -// ----- Return the complete selected theme ----- +//----- Return the complete selected theme ----- #let make-theme(theme-name: default-theme) = { themes.at(theme-name) } -// ----- Return a safe dynamic theme-variable accessor ----- +//----- Return a safe dynamic theme-variable accessor ----- #let make-theme-variable(theme-name: default-theme) = { let symfinder(name) = { if theme-name in themes { @@ -360,9 +360,7 @@ symfinder } -// ============================================================================= -// THEMATIC LABELS & DIVIDERS -// ============================================================================= +//----- THEMATIC LABELS & DIVIDERS ----- #let resolve-table-theme(theme-name) = if theme-name == none { themes.at(default-theme) } else { @@ -373,9 +371,7 @@ } } -// ============================================================================= -// LABEL -// ============================================================================= +//----- LABEL ----- #let fantasy-config = ( // Label @@ -435,9 +431,7 @@ } -// ============================================================================= -// RULE -// ============================================================================= +//----- RULE ----- #let fantasy-rule( theme-name: none, @@ -465,9 +459,7 @@ } -// ============================================================================= -// SECTION -// ============================================================================= +//----- SECTION ----- #let fantasy-section( title, diff --git a/setup/variables.typ b/setup/variables.typ index 5fd9e8d..534e87b 100644 --- a/setup/variables.typ +++ b/setup/variables.typ @@ -1,8 +1,8 @@ -// ----- Theme constructors ----- +//----- Theme constructors ----- #import "themes.typ" as th // make-theme, make-theme-variable, fantasy-label,fantasy-rule,fantasy-section -// ----- Project metadata ----- +//----- Project metadata ----- #let ravenous = ( name: "Ravenous", title: "Ravenous", @@ -10,9 +10,9 @@ date: "2021", ) -// ----- Select the active color scheme ----- +//----- Select the active color scheme ----- #let color_scheme = "warm" -// ----- Build the active theme and its variable form ----- +//----- Build the active theme and its variable form ----- #let theme = th.make-theme(theme-name: color_scheme) #let theme-var = th.make-theme-variable(theme-name: color_scheme)