diff --git a/chapters/acknowledgements.typ b/chapters/acknowledgements.typ index e309fe4..98dc4a8 100644 --- a/chapters/acknowledgements.typ +++ b/chapters/acknowledgements.typ @@ -1,179 +1,178 @@ -#import "../setup/setup.typ": theme, build_info - -// ───────────────────────────────────────────── -// Title -// ───────────────────────────────────────────── +// ----- Project data and theme ----- +#import "../setup/setup.typ": build_info, theme +// ----- Edition title ----- #align(center)[ - #text( - size: 24pt, - weight: "bold", - fill: theme.blood, - )[À propos de cette édition] + #text( + size: 24pt, + weight: "bold", + fill: theme.blood, + )[À propos de cette édition] - #v(0.4em) + #v(0.4em) - #text( - size: 10pt, - fill: theme.gold, - )[✦ ── ❖ ── ✦] + #text( + size: 10pt, + fill: theme.gold, + )[✦ ── ❖ ── ✦] ] #v(1.8em) -// ───────────────────────────────────────────── -// Build information -// ───────────────────────────────────────────── - +// ----- Build and version information ----- #align(center)[ - #text(size: 9pt, fill: theme.muted)[ - #emph[Copirightish#super[©] Dandaedre 2022–2024] - ] + #text(size: 9pt, fill: theme.muted)[ + #emph[Copirightish#super[©] Dandaedre 2022–2024] + ] - #v(0.2em) + #v(0.2em) - #text( - size: 7.5pt, - fill: theme.muted, - )[ - #emph[#build_info.build_commit] - ] + #text( + size: 7.5pt, + fill: theme.muted, + )[ + #emph[ + Version + #if build_info.build_version != "" { + [#build_info.build_version ] + } + [@#build_info.build_commit_short] + ] + ] ] - #v(1.8em) -// ───────────────────────────────────────────── -// Credits -// ───────────────────────────────────────────── - +// ----- Define a reusable credit entry ----- #let credit(label, content) = [ - #text( - weight: "bold", - fill: theme.blood, - )[ #label ] + #text( + weight: "bold", + fill: theme.blood, + )[ #label ] - #h(0.5em) #content + #h(0.5em) #content ] +// ----- Display project credits ----- #grid( - columns: (1fr, 1fr), - column-gutter: 2.5em, - row-gutter: 1.2em, - credit[Auteur][Dandaedre], credit[Graphistozaure][Noushido], - credit[Relecteurs][ - Vicky, Durbin, Wulfran, John Von Frenetico - ], credit[Éditeur exécutif][Vicky], - credit[Éditeurs — contenu][ - Wulfran, Vicky, Vandole, Durbin, Yétie - ], credit[Éditeurs — règles][ - Vicky, Vandole, Durbin - ], + columns: (1fr, 1fr), + column-gutter: 2.5em, + row-gutter: 1.2em, + credit[Auteur][Dandaedre], credit[Graphistozaure][Noushido], + credit[Relecteurs][ + Vicky, Durbin, Wulfran, John Von Frenetico + ], + credit[Éditeur exécutif][Vicky], + + credit[Éditeurs — contenu][ + Wulfran, Vicky, Vandole, Durbin, Yétie + ], + credit[Éditeurs — règles][ + Vicky, Vandole, Durbin + ], ) #v(1.8em) -// ───────────────────────────────────────────── -// Color palettes -// ───────────────────────────────────────────── - +// ----- List the color palette sources ----- #align(center)[ - #text( - size: 12pt, - weight: "bold", - fill: theme.blood, - )[Palettes de couleurs] + #text( + size: 12pt, + weight: "bold", + fill: theme.blood, + )[Palettes de couleurs] - #v(0.5em) + #v(0.5em) - #text(size: 9pt)[ - Lost Century — CopheeMoth #h(1em) · #h(1em) Dynasty38 — Nicola #h(1em) · #h(1em) Blighted Paint — SurrealEmber - ] + #text(size: 9pt)[ + Lost Century — CopheeMoth #h(1em) · #h(1em) Dynasty38 — Nicola #h(1em) · #h(1em) Blighted Paint — SurrealEmber + ] ] #v(1.8em) -// ───────────────────────────────────────────── -// Playtesting -// ───────────────────────────────────────────── - +// ----- List playtesting sessions and participants ----- #align(center)[ - #text( - size: 12pt, - weight: "bold", - fill: theme.blood, - )[Testeurs] + #text( + size: 12pt, + weight: "bold", + fill: theme.blood, + )[Testeurs] - #v(0.6em) + #v(0.6em) ] #grid( - columns: (auto, 1fr), - column-gutter: 1em, - row-gutter: 0.45em, - [#text(weight: "bold", fill: theme.gold)[Session 1]], [Gregzel, Durbin, El Fredo, Wulfran], - [#text(weight: "bold", fill: theme.gold)[Session 2]], [Gregzel, Durbin, Vicky, Wulfran, Vandole], - [#text(weight: "bold", fill: theme.gold)[Session 3]], [Gregzel, Durbin, Vicky, Wulfran, Disturbed, El Fredo], - [#text(weight: "bold", fill: theme.gold)[Session 4]], [Gregzel, Durbin, Vicky, Wulfran, Disturbed, Vandole, Ily'], - [#text(weight: "bold", fill: theme.gold)[Session 5]], [Gregzel, Durbin, Vicky, Wulfran, Disturbed, Vandole, Ily', El Fredo], + columns: (auto, 1fr), + column-gutter: 1em, + row-gutter: 0.45em, + [#text(weight: "bold", fill: theme.gold)[Session 1]], + [Gregzel, Durbin, El Fredo, Wulfran], + + [#text(weight: "bold", fill: theme.gold)[Session 2]], + [Gregzel, Durbin, Vicky, Wulfran, Vandole], + + [#text(weight: "bold", fill: theme.gold)[Session 3]], + [Gregzel, Durbin, Vicky, Wulfran, Disturbed, El Fredo], + + [#text(weight: "bold", fill: theme.gold)[Session 4]], + [Gregzel, Durbin, Vicky, Wulfran, Disturbed, Vandole, Ily'], + + [#text(weight: "bold", fill: theme.gold)[Session 5]], + [Gregzel, Durbin, Vicky, Wulfran, Disturbed, Vandole, Ily', El Fredo], ) #v(1.8em) -// ───────────────────────────────────────────── -// Logo -// ───────────────────────────────────────────── - +// ----- Display the project logo ----- #align(center)[ - #image( - "../images/icons/LogoNoush.jpg", - width: 3.2cm, - ) + #image( + "../images/icons/LogoNoush.jpg", + width: 3.2cm, + ) ] #v(1.5em) -// ───────────────────────────────────────────── -// Restricted copy notice -// ───────────────────────────────────────────── - +// ----- Display the restricted-copy notice ----- #block( - width: 100%, - fill: theme.parchment, - stroke: 0.7pt + theme.gold, - inset: 12pt, - radius: 3pt, + width: 100%, + fill: theme.parchment, + stroke: 0.7pt + theme.gold, + inset: 12pt, + radius: 3pt, )[ - #align(center)[ - #text( - size: 9pt, - weight: "bold", - fill: theme.blood, - )[COPIE FOURNIE EN CADRE RESTREINT] - ] + #align(center)[ + #text( + size: 9pt, + weight: "bold", + fill: theme.blood, + )[COPIE FOURNIE EN CADRE RESTREINT] + ] - #v(0.5em) + #v(0.5em) - #align(center)[ - #text(size: 9pt)[ - #emph[ - Ne pas reproduire par des moyens normaux ou paranormaux. - ] - ] + #align(center)[ + #text(size: 9pt)[ + #emph[ + Ne pas reproduire par des moyens normaux ou paranormaux. + ] + ] - #v(0.7em) + #v(0.7em) - #text(size: 8.5pt)[ - Si vous lisez ceci, mais que je ne vous connais pas, vous êtes un vilain petit filou. + #text(size: 8.5pt)[ + Si vous lisez ceci, mais que je ne vous connais pas, vous êtes un vilain petit filou. - Si vous ignorez ce message en fermant les yeux pour ne pas le lire et passez à la page suivante, sachez que ça compte quand même et que vous n'êtes pas meilleur que moi. - ] - ] + Si vous ignorez ce message en fermant les yeux pour ne pas le lire et passez à la page suivante, sachez que ça compte quand même et que vous n'êtes pas meilleur que moi. + ] + ] ] #v(1em) +// ----- Display the document footer ----- #align(center)[ - #text(size: 7pt, fill: theme.muted)[ - ✦ RAVENOUS · LIVRE DE RÈGLES ✦ - ] + #text(size: 7pt, fill: theme.muted)[ + ✦ RAVENOUS · LIVRE DE RÈGLES ✦ + ] ] diff --git a/chapters/geography.typ b/chapters/geography.typ index 5e6de8d..e58ba3b 100644 --- a/chapters/geography.typ +++ b/chapters/geography.typ @@ -1,4 +1,4 @@ -#import "../setup/setup.typ": nogls, ravhelp ,warn, comment +#import "../setup/setup.typ": comment, nogls, ravhelp, warn = Géographie @@ -29,21 +29,21 @@ Technologie et niveau de vie sont extrêmement variés selon les régions du mon #v(1fr) #align(center)[ - #rotate(90deg)[ - #image( - "../images/maps/full_map.png", - width: 100%, - height: 65%, - fit: "contain", - ) - ] + #rotate(90deg)[ + #image( + "../images/maps/full_map.png", + width: 100%, + height: 65%, + fit: "contain", + ) + ] ] == Tribus nomades #align(right)[ - #image("../images/illustrations/example_geography.jpg", width: 2cm) + #image("../images/illustrations/example_geography.jpg", width: 2cm) ] Les tribus nomades Khâlikir et la caravane de Nâamzor, qui jamais ne s'arrête (ville marchande portée sur le dos d'une placide calamité) sont les deux seuls marchands à jamais parcourir tout Drâan. @@ -63,7 +63,7 @@ L'ordre des Gardiens de Treran, chargé de la défense de la capitale, Kraorst p === La guilde des Chasseurs #align(left)[ - #image("../images/illustrations/guild_master.jpg", width: 2cm) + #image("../images/illustrations/guild_master.jpg", width: 2cm) ] La base d'opération de l'ordre des chasseurs est située à Krâorst, avec à sa tête la Guildemaître Sabel Meilfort, tenant d'une serre de fer le groupe désuni et hétéroclite assurant la sécurité de l'ensemble du territoire. @@ -84,7 +84,7 @@ Organisation visant à maintenir le status quo et apaiser les fauteurs de troubl == Kraorst #align(left)[ - #image("../images/illustrations/geography/kraost_capitol.jpg", width: 4cm) + #image("../images/illustrations/geography/kraost_capitol.jpg", width: 4cm) ] La capitale officielle du Royaume, bastion millénaire surprotégé, offrant des remparts barbelés juchés de myriades de canon Essouflenfert, elle est, selon les affirmations de ses dirigeants, le dernier bastion de la civilisation humaine et l'ultime rempart contre l'éveil des calamités. Se targuant d'avoir jadis servi de forteresse ayant permis d'abattre une calamité, nombreux sont ceux qui sont prêts à croire en sa solidité millénaire, tout en oubliant parfois un peu trop le rôle de ses défenseurs, chasseurs de légendes ayant laissé leur vie pour cet exploit. La cité est emplie d'un incessant flot de population en quête de sécurité, savoir et richesses. Elle commence à faire montre des premiers signes de déclin ; la corruption s'installant peu à peu à toutes les strates de la société. @@ -109,7 +109,7 @@ Cité-état sur le chemin entre Thenet et Kraorst, Ebil s'est enrichie et agrand == Thenet #align(right)[ - #image("../images/illustrations/geography/thenet.jpg", width: 2cm) + #image("../images/illustrations/geography/thenet.jpg", width: 2cm) ] Ville maritime, constamment assiégée par les fils du Kraken et Léviathan, Thenet possède une flotte de navires équipés pour résister à leurs assauts. Souvent porteurs de la marque des calamité, assurément touchés par la folie, les navigateurs de Thenet forment une guilde à part chargée d'assurer la sécurité des côtes et la plupart du commerce extérieur du Royaume. Nombreux sont les chasseurs qui partent naviguer à Thenet pour profiter du danger et des chasses exceptionnelles que la haute mer propose. @@ -130,7 +130,7 @@ Désormais centre d'une attention incessante, la ville est active jour et nuit, == Baronnies Steingrund #align(right)[ - #image("../images/illustrations/geography/steingrund.jpg", width: 4cm) + #image("../images/illustrations/geography/steingrund.jpg", width: 4cm) ] Balayée par des vents glaciaux, déchirée par des éléments déchaînés presque six mois par an, les Baronnies laissent à penser qu'elles sont une région stérile et inhabitable, pourtant, comme toute terre de Dräan, elle regorge de richesses et de fertilité… Pour qui ose braver ses dangers. @@ -149,7 +149,7 @@ Tribus nomades parcourant les monts et steppes d'Anankar, les clans guerriers su Cette survie est en grande partie due à la très haute concentration de sang des calamités au sein de leurs populations. #align(right)[ - #image("../images/illustrations/geography/anankar.jpg", width: 3cm) + #image("../images/illustrations/geography/anankar.jpg", width: 3cm) ] En effet, presque tous les nomades partagent le sang des calamités, bien que très souvent en de faibles quantités. Leurs guerriers divins, caste composés de tous ceux ayant reçu la divine marque des calamités, sont révérés pour leurs aptitudes hors du commun et forment le cœur de leur mode de vie. À la fois protecteurs, navigateurs, chasseurs et guides spirituels, leur rôle s'étend à toutes les strates de leur société. @@ -162,7 +162,7 @@ Une autre distinction importante avec les autres nations est le statut des calam == Noocracie Fangdraël #align(left)[ - #image("../images/illustrations/geography/fangdrael.jpg", width: 4cm) + #image("../images/illustrations/geography/fangdrael.jpg", width: 4cm) ] Grandes citées dirigées par le conseil des Très Sages, la Noocracie Fangdraël regroupe un très grand nombre d'enfants de Dräan et une grande concentration de Marqués. Leurs chasseurs, bien moins individualistes que ceux du Royaume Tréorst, forment un ordre séculaire régissant tous les aspects liés à la cohabitation avec les fils de Calamités. @@ -175,7 +175,7 @@ Capables de maîtriser leurs égos et œuvrant au sein d'une communauté les gui #warn("No symbols for holy hunters")//($senholy$ $senhunter$) #align(right)[ - #image("../images/illustrations/geography/yon_sen.jpg", width: 2cm) + #image("../images/illustrations/geography/yon_sen.jpg", width: 2cm) ] Empire isolationniste, YonSen regroupe un grand nombre de clans guerriers poussant jusqu'à l'art le combat contre les fils des calamités. Fortement ancré dans leur culture guerrière, l'art du combat ne se perd jamais réellement même lors des grands reflux. diff --git a/chapters/hunters_and_calamities.typ b/chapters/hunters_and_calamities.typ index 7d5e921..8cd498b 100644 --- a/chapters/hunters_and_calamities.typ +++ b/chapters/hunters_and_calamities.typ @@ -1,15 +1,15 @@ #import "../setup/setup.typ": nogls - = Chasseurs et calamitées - == Les enfants des calamités Sur terre, sous la surface des mers et dans les cieux s'ébrouent bien plus que poissons, oiseaux et autres créatures au nombre variable d'appendices. Au-dessus de toute chaîne alimentaire, dans une classe à laquelle eux seuls appartiennent, les enfants des calamités sont les véritables maîtres de ce monde. Si certains sont de tailles raisonnables, tous sont bien plus dangereux que l'humain moyen. Qu'ils soient de voraces Jantan, des félidés plus gros que des tigres se déplaçant en meute, ou un majestueux et imposant Aämarost, draconide capable de projeter un humain dans les airs d'un simple battement de ses puissantes ailes, tous sont capables de décimer de larges groupes d'humains. La seule chance des mortels réside dans le fait que toutes puissantes qu'elles soient, ces créatures ne sont pas alliées. Disputes de territoires, migrations, hibernations et accouplements rythment la vie de ces monstres et celle de la frêle humanité qui en est tributaire. Les humains ne sont que des en-cas pour eux, à peine capables de momentanément satisfaire leur vorace appétit. #align(right)[ - #image("../images/illustrations/example_child.jpg", width: 25%) #text(size: 0.8em)[Un Zizfir juvénile.] + #image("../images/illustrations/example_child.jpg", width: 25%) #text( + size: 0.8em, + )[Un Zizfir juvénile.] ] Tous les enfants des calamités peuvent voir leur lignage remonter à l'une d'entre elles. Si ce lignage peut sembler parfois obscur d'un point de vue physique, comme dans le cas du Zizfir, fils de Beweül au corps presque humanoïde avec de puissantes ailes ainsi qu'une tête et des écailles de dragon, ils sont tous le reflet d'un ou plusieurs des aspects de leur illustre parent. Qu'il s'agisse de traits physiques ou de leurs capacités de sangressence comme physiques. Si l'on ne sait pas même aujourd'hui comment toutes ces créatures sont apparues, les théories vont de la corruption d'êtres vivants préexistants par l'essence des calamités en personne, à l'apparition spontanée par ces dernières ; l'essence est le seul élément qui les lie véritablement. Celle-ci semble fortement liée au sang et bien qu'aucune science empirique n'ait pu le vérifier, nombre de mages érudits ont manuscrit des bibliothèques entières sur le sujet. diff --git a/chapters/introduction/presentation.typ b/chapters/introduction/presentation.typ index e3c61e3..883c366 100644 --- a/chapters/introduction/presentation.typ +++ b/chapters/introduction/presentation.typ @@ -1,5 +1,4 @@ -#import "../../setup/setup.typ": nogls, gls, ravhelp - +#import "../../setup/setup.typ": gls, nogls, ravhelp = Introduction @fk_draan:short. diff --git a/chapters/introduction/presentation_old.typ b/chapters/introduction/presentation_old.typ index 3f6a0d7..158d27f 100644 --- a/chapters/introduction/presentation_old.typ +++ b/chapters/introduction/presentation_old.typ @@ -1,6 +1,5 @@ #import "../../setup/setup.typ": nogls, ravhelp - = Introduction Dräan est le monde des monstres, un monde dont les fondations sont perdues dans les limbes du temps et dans les cendres laissées par le passage de colosses immémoriaux. Les nations le composant luttent à la fois pour leur souveraineté et pour leur survie sur une terre régulièrement ravagée par le passage de ses vrais maîtres : les calamités. Car si les êtres peuplant ce monde l'oublient souvent, la planète bénéficie de son propre cycle d'existence, un cycle qui pousse au retour d'horreurs ancestrales capables de ravager même les villes les mieux défendues, les nations les plus puissantes. Dräan, le nom donné à la planète par ses habitants, a longtemps été considérée comme un être vivant à part entière et certaines pratiques rendent encore hommage au monstre-monde sur lequel vivent les insignifiants humains. C'est sur l'île considérée comme l'œil de la bête et autour duquel s'articulent tous les continents que vivent les plus grands monstres. La vie humaine n'a aucune valeur pour les prédateurs séculaires de ce monde, ils ne sont qu'un bétail de plus, des abeilles dont le miel est à récupérer. Leurs enfants sont nombreux et tout aussi dangereux, capables de dépasser les piètres créations des mortels et déchaîner les enfers par leur simple existence, arpentant le monde avec d'autant plus d'intensité que le retour de leurs géniteurs est proche. @@ -11,7 +10,6 @@ Pour se dresser entre eux et leurs proies, nuls autres que les Chasseurs --- des Dans ce jeu de rôle, les joueurs incarnent le rôle de ces chasseurs, élus maudits accomplissant leur tâche sans chercher la gloire ou la fortune. Face à des monstres représentant une menace mortelle, ils devront faire usage de tout l'arsenal mis à leur disposition pour vaincre les dangers très physiques de ce monde. - == Les calamités La légende veut qu'à l'aube des temps, le créateur de toute chose ait donné naissance à l'univers, et peuplé ses vastes étendues de milliers d'enfants ; brillants et ardents. Pendant des millénaires, ils errèrent à travers les grandes étendues cosmiques, jusqu'à s'endormir et former le firmament céleste. Avant cet éternel sommeil, Adrana le soleil, engendra l'œuf-monde nommé Dräan, source de toute vie terrestre. Logé au cœur de sa coquille dont il ne sortira qu'à la fin des temps, le titan assoupi est père de toutes les calamités, ses turbulents enfants, causant chaos et destruction sur leur passage. @@ -45,11 +43,15 @@ Le troisième stade d'évolution se situe entre 25 et 40 points d'essence invest Le quatrième stade d'évolution se situe entre 40 et 60 points d'essence investis, cette transformation peut être ralentie si le chasseur ne consomme jamais le sang de sa calamité génitrice. Cette évolution marque la fin de l'humanité du chasseur et son premier pas en tant que vrai scion des calamités. Visuellement, les premiers traits inhumains se figent en ce qui deviendra l'apparence finale du chasseur. Le caractère du chasseur lui aussi sera profondément affecté, embrassant son ascendant semi-divin. Bien souvent les chasseurs de ce niveau commenceront à développer (en plus de leur caractère particulièrement haut en couleur) une profonde arrogance et bien des fois partiront chasser en solitaire, insatisfait de toujours devoir se plier aux désirs et méthodes de leurs camarades. -#ravhelp("Bien que souvent (mais pas toujours) tendant vers la solitude, l'irascibilité et l'arrogance, il serait une erreur de considérer les chasseurs vétérans comme de mauvais vivants ou des élément néfastes à leur communauté. Soudés et liés par des codes d'honneur parfois incompréhensibles, les chasseurs considèrent toujours leurs camarades de jadis comme des alliés pour lesquels ils seraient prêts à tout pour leur venir en aide.") +#ravhelp( + "Bien que souvent (mais pas toujours) tendant vers la solitude, l'irascibilité et l'arrogance, il serait une erreur de considérer les chasseurs vétérans comme de mauvais vivants ou des élément néfastes à leur communauté. Soudés et liés par des codes d'honneur parfois incompréhensibles, les chasseurs considèrent toujours leurs camarades de jadis comme des alliés pour lesquels ils seraient prêts à tout pour leur venir en aide.", +) Le cinquième stade d'évolution de la marque se situe entre 60 et 90 points d'essence investis. Franchir ce seuil est la première vraie difficulté pour un chasseur, là où les autres seuils pouvaient simplement être accomplis avec beaucoup de sang et de chasse, le cinquième stade nécessite un premier rite pour être franchi, il s'agit en général d'une grande chasse d'une calamité mineure liée à sa calamité d'origine. Après cette chasse un complexe rituel devra prendre place durant lequel le chasseur assimilera en profondeur l'essence de sa proie pour avancer dans les tiers d'inhumanité supérieurs -#ravhelp([Ce rituel est hautement lié à l'origine, la culture et les croyances à la fois du chasseur et de la région dans laquelle il a vécu, ainsi, un rituel ayant lieu en plein Tréorst n'est en rien identique à celui fait dans les Baronnies. L'interprétation de @maitredejeu est primordiale, et incorporer des idées et désir du (ou des) participant peut créer des rituels bien plus intéressants. Ce rituel est la première vraie étape vers l'inhumanité du chasseur et devrait être ressenti en tant que tel.]) +#ravhelp( + [Ce rituel est hautement lié à l'origine, la culture et les croyances à la fois du chasseur et de la région dans laquelle il a vécu, ainsi, un rituel ayant lieu en plein Tréorst n'est en rien identique à celui fait dans les Baronnies. L'interprétation de @maitredejeu est primordiale, et incorporer des idées et désir du (ou des) participant peut créer des rituels bien plus intéressants. Ce rituel est la première vraie étape vers l'inhumanité du chasseur et devrait être ressenti en tant que tel.], +) Le sixième stade d'évolution de la marque se situe entre 90 et 150 points d'essence investis. Franchir ce seuil est un acte qui n'est narré que dans les contes les plus secrets des chasseurs, et ainsi très peu d'informations existent sur cette étape. Déjà à moitié fous et imbus d'eux-même, les chasseurs franchissant ce tiers ont désormais plus en commun avec les calamités que l'humanité. Modifiés en profondeur, beaucoup perdent leurs derniers traits humanoïdes et voient certains membres disparaître ou d'autres leur pousser pour mieux s'adapter à leurs chasses. Le rituel accompli pour atteindre ce stade n'est pas bien souvient transmit que par tradition orale au sein de monastères reculés où viennent se rencontrer les plus vieux chasseurs. diff --git a/chapters/schools/heavy_weapon_specialist.typ b/chapters/schools/heavy_weapon_specialist.typ index 7e31556..7c48a52 100644 --- a/chapters/schools/heavy_weapon_specialist.typ +++ b/chapters/schools/heavy_weapon_specialist.typ @@ -1,8 +1,16 @@ #import "../../setup/setup.typ": school_presentation -#school_presentation((title: "Spécialiste des Armes Lourdes", illustration: "../images/schools/specialiste_armes_lourdes.jpg", radar: "../images/icons/nodata.png", description: [ - Excelle à infliger de lourds dégâts et à incapaciter ses cibles. +#school_presentation(( + title: "Spécialiste des Armes Lourdes", + illustration: "../images/schools/specialiste_armes_lourdes.jpg", + radar: "../images/icons/nodata.png", + description: [ + Excelle à infliger de lourds dégâts et à incapaciter ses cibles. - Le Spécialiste des Armes Lourdes souffre d'importants problèmes de manœuvrabilité et de défense, qu'il compense par ses grandes capacités de contrôle. + Le Spécialiste des Armes Lourdes souffre d'importants problèmes de manœuvrabilité et de défense, qu'il compense par ses grandes capacités de contrôle. - Capable de manier les armes les plus imposantes comme les plus saugrenues, le Spécialiste des Armes Lourdes n'est jamais vraiment désarmé. -], mechanic: [Delicate Destruction], difficulty: 1, techniques: "../data/src/schools/heavy_weapon_specialist.tsv")) + Capable de manier les armes les plus imposantes comme les plus saugrenues, le Spécialiste des Armes Lourdes n'est jamais vraiment désarmé. + ], + mechanic: [Delicate Destruction], + difficulty: 1, + techniques: "../data/src/schools/heavy_weapon_specialist.tsv", +)) diff --git a/chapters/schools/schools.typ b/chapters/schools/schools.typ index 403b75b..cf23c3b 100644 --- a/chapters/schools/schools.typ +++ b/chapters/schools/schools.typ @@ -1,38 +1,30 @@ #import "../../setup/setup.typ": ravhelp - -= Écoles de combat - -#label("chap:ecoles de combat") - += Écoles 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. - == Écoles à travers le monde Les écoles telles que décrites ci-après représentent principalement les écoles de combat de Tréorst, bien d'autres écoles de combat sont présentes de part le monde. Bien que le terme école soit peu adapté à Tréorst (où l'apprentissage est très informel et très souvent effectué en observant d'autres s'entraîner ou auprès de divers maîtres de combat) et encore plus inadéquat encore dans d'autres régions du monde ; par souci de clarté, ces méthodes de combat seront toutes décrites comme “Écoles” même lorsqu'il ne s'agit en aucun cas d'un apprentissage scolastique. - == Dénomination des techniques Le format utilisé pour décrire les techniques est le suivant : #ravhelp(title: "Memo", [ - * Nom de la technique* --- Niveau de la technique + * Nom de la technique* --- Niveau de la technique - _Type de technique_ (Type de Sang de la Technique)\ - @blood:short Coût de la technique à l'achat (en points de sang)\ - @jauge:short Coût de la technique en @jauge:long\ - Effet de la technique + _Type de technique_ (Type de Sang de la Technique)\ + @blood:short Coût de la technique à l'achat (en points de sang)\ + @jauge:short Coût de la technique en @jauge:long\ + Effet de la technique ]) Le coût en sang correspond uniquement au premier achat de la technique, une fois acquise, ce dernier n'importera plus. Le coût en @jauge:short quant à lui correspond au prix à dépenser pour utiliser la technique, ce dernier sera payé à chaque utilisation de la technique. Utiliser une technique nécessite au moins un point de @jauge:long. -// #comment[ // Si vous ne possédez pas assez de @jauge:long dans votre réserve pour utiliser la technique, vous pouvez choisir de consommer le reste de votre @jauge:long et gagner l'altération #nogls("dernier_souffle") pour l'utiliser. -// ] == Les tiers de maîtrise @@ -94,41 +86,28 @@ Il est à noter que si une technique donne un effet sans préciser une limite de #pagebreak() // #include "Ecoles/Einerjar.typ" - // #pagebreak() // #include "Ecoles/FrancTireur.typ" - // #pagebreak() // #include "Ecoles/Protecteur.typ" - // #pagebreak() // #include "Ecoles/Lancier.typ" - // #pagebreak() // #include "Ecoles/MaitreLames.typ" - -// #comment[ -// #pagebreak() -// #include "Ecoles/MaitreDesBetes.typ" -// ] - // #pagebreak() // #include "Ecoles/Artilleur.typ" - // #pagebreak() // #include "Ecoles/MageBestial.typ" - // #pagebreak() // #include "Ecoles/GuerrierMage.typ" - // #pagebreak() // #include "Ecoles/Sangremage.typ" -#pagebreak() +// #pagebreak() diff --git a/chapters/title.typ b/chapters/title.typ index 644d41a..458efe9 100644 --- a/chapters/title.typ +++ b/chapters/title.typ @@ -1,29 +1,34 @@ +// ----- Load the active project theme ----- #import "../setup/setup.typ": theme +// ----- Render the document title page ----- #align(center + horizon)[ - #text( - size: 42pt, - weight: "bold", - fill: theme.blood, - )[ - RAVENOUS - ] + #text( + size: 42pt, + weight: "bold", + fill: theme.blood, + )[ + RAVENOUS + ] - #v(0.7em) + #v(0.7em) - #text( - size: 18pt, - tracking: 0.08em, - fill: theme.gold, - )[ - LIVRE DE RÈGLES - ] + #text( + size: 18pt, + tracking: 0.08em, + fill: theme.gold, + )[ + LIVRE DE RÈGLES + ] - #v(2em) + #v(2em) - #text(size: 11pt, style: "italic")[ - Par Le Dandaedre - ] + #text(size: 11pt, style: "italic")[ + Par Le Dandaedre + ] ] -#pagebreak() #outline(title: "Table des matières") #pagebreak() +// ----- Separate the title page from the table of contents ----- +#pagebreak() +#outline(title: "Table des matières") +#pagebreak() diff --git a/data/gen/build_info.typ b/data/gen/build_info.typ index 1e45f3e..167f23b 100644 --- a/data/gen/build_info.typ +++ b/data/gen/build_info.typ @@ -1,5 +1,7 @@ +// ----- Autogenerated build metadata ----- #let build_info = ( - build_commit : "e6db6dc49b7c50afd62ee21b7495959a0dccbca1", + build_commit : "bf2d02fc69b07241a01a01bd6aee1b858429a91c", + build_commit_short : "bf2d02f", build_version : "", - build_status : false, + build_status : true, ) diff --git a/main.typ b/main.typ index 49301d6..7c95603 100644 --- a/main.typ +++ b/main.typ @@ -1,15 +1,18 @@ +// ----- Load the main document configuration ----- #import "./setup/setup.typ": config_main, disable-warnings #show: config_main +// ----- Enable this to suppress project warnings ----- // #disable-warnings() +// ----- Front matter ----- #include "./chapters/title.typ" #include "./chapters/acknowledgements.typ" +// ----- Core rulebook chapters ----- #include "chapters/introduction/presentation.typ" #include "./chapters/geography.typ" #include "./chapters/hunters_and_calamities.typ" -// Somewhere down the line - +// ----- Additional chapters planned for later integration ----- #include "./chapters/schools/schools.typ" diff --git a/pseudo_toolchain.sh b/pseudo_toolchain.sh index f04b506..60c7fc4 100755 --- a/pseudo_toolchain.sh +++ b/pseudo_toolchain.sh @@ -1,33 +1,38 @@ #!/usr/bin/env bash set -euo pipefail -# Run this script from anywhere inside the Git repository. +# ----- Resolve and enter the repository root ----- REPO_ROOT="$(git rev-parse --show-toplevel)" cd "$REPO_ROOT" +# ----- Set the output file, with a default project path ----- OUTPUT_FILE="${1:-./data/gen/build_info.typ}" +# ----- Retrieve the current Git commit identifiers ----- build_commit="$(git rev-parse HEAD)" +build_commit_short="$(git rev-parse --short HEAD)" -# Latest tag reachable from the current branch/commit. +# ----- Retrieve the latest reachable Git tag ----- build_version="$(git describe --tags --abbrev=0 2>/dev/null || true)" build_version="${build_version:-}" -# typst query exits successfully when the query succeeds; use its -# result as the boolean value. +# ----- Check whether the main Typst document builds successfully ----- if typst query main.typ '' >/dev/null 2>&1; then build_status="true" else build_status="false" fi +# ----- Generate the Typst build metadata file ----- cat > "$OUTPUT_FILE" < { let result = (:) + // ----- Convert each YAML field to its Typst representation ----- for (key, value) in entry { result.insert( key, @@ -42,6 +45,8 @@ }, ) } + + // ----- Fill in missing optional fields ----- if "short" not in result { result.insert("short", none) } @@ -53,9 +58,11 @@ }) } +// ----- Load glossary entries from one or more YAML files ----- #let read-glossary(files) = { let entries = () + // ----- Normalize a single file into an array ----- if type(files) != array { files = (files,) } @@ -63,6 +70,7 @@ for file in files { let new = read-glossary-entries(file) + // ----- Reject duplicate glossary keys ----- for entry in new { let duplicate = entries.find(e => e.key == entry.key) @@ -79,6 +87,7 @@ entries } +// ----- Load all project glossaries ----- #let glossary = read-glossary(( "../data/src/glossaries/general.yml", "../data/src/glossaries/classes.yml", diff --git a/setup/model.typ b/setup/model.typ index 6b35ac8..aaa1e59 100644 --- a/setup/model.typ +++ b/setup/model.typ @@ -1,437 +1,448 @@ -// ----- IMPORTS ----- -#import "@preview/glossarium:0.5.10": gls, glspl, make-glossary, print-glossary, register-glossary, get-entry-back-references +// ----- Glossary engine and class presentation model ----- +#import "@preview/glossarium:0.5.10": ( + get-entry-back-references, gls, glspl, make-glossary, print-glossary, + register-glossary, +) -// Setup glossaries +// ----- Load project glossaries and presentation model ----- #import "glossary.typ": glossary #import "school_model.typ" as model -// Re-export models +// ----- Re-export commonly used model functions ----- #let gls = gls #let school_presentation = model.school_presentation +// ----- Configure the main document model ----- #let model( - variables, - document, - theme, - theme-var, + variables, + document, + theme, + theme-var, ) = { + // =========================================================================== + // ----- Page and typography ----- + // =========================================================================== - // --------------------------------------------------------------------------- - // Page & typography - // --------------------------------------------------------------------------- + set page( + paper: "a4", + margin: ( + top: 2.2cm, + bottom: 2.4cm, + left: 2.5cm, + right: 2.5cm, + ), + numbering: "1", + ) - set page( - paper: "a4", - margin: ( - top: 2.2cm, - bottom: 2.4cm, - left: 2.5cm, - right: 2.5cm, - ), - numbering: "1", - ) + set text( + font: "Libertinus Serif", + size: 11pt, + lang: "fr", + fill: theme.ink, + ) - set text( - font: "Libertinus Serif", - size: 11pt, - lang: "fr", - fill: theme.ink, - ) + set par( + justify: true, + leading: 0.7em, + first-line-indent: 1em, + spacing: 0.9em, + ) - set par( - justify: true, - leading: 0.7em, - first-line-indent: 1em, - spacing: 0.9em, - ) + // ----- Use the theme's heading numbering configuration ----- + set heading( + numbering: theme-var("heading-numbering"), + ) - // Theme controls heading numbering. - set heading( - numbering: theme-var("heading-numbering"), - ) - // --------------------------------------------------------------------------- - // Heading helpers - // --------------------------------------------------------------------------- + // =========================================================================== + // ----- Heading helpers ----- + // =========================================================================== - let heading-number(it) = { - if it.level == 1 or it.numbering == none { - none - } else { - counter(heading).display(it.numbering) - } - } + // ----- Return a heading's displayed number, except for level 1 ----- + let heading-number(it) = { + if it.level == 1 or it.numbering == none { + none + } else { + counter(heading).display(it.numbering) + } + } - let heading-number-content(it) = { - let number = heading-number(it) + // ----- Render a heading number using the theme's heading color ----- + let heading-number-content(it) = { + let number = heading-number(it) - if number == none { - [] - } else { - text( - weight: "bold", - fill: theme.heading, - )[ - #number #h(0.45em) - ] - } - } + if number == none { + [] + } else { + text( + weight: "bold", + fill: theme.heading, + )[ + #number #h(0.45em) + ] + } + } - // --------------------------------------------------------------------------- - // Headings - // --------------------------------------------------------------------------- + // =========================================================================== + // ----- Headings ----- + // =========================================================================== - // Level 1 — Major section - show heading.where(level: 1): set align(center) + // ----- Level 1: major section ----- + show heading.where(level: 1): set align(center) - show heading.where(level: 1): it => block( - above: 2em, - below: 1.2em, - )[ - #text( - font: "Libertinus Serif", - size: 22pt, - weight: "bold", - fill: theme.heading, - )[ - #it.body - ] + show heading.where(level: 1): it => block( + above: 2em, + below: 1.2em, + )[ + #text( + font: "Libertinus Serif", + size: 22pt, + weight: "bold", + fill: theme.heading, + )[ + #it.body + ] - #stack( - dir: ltr, - spacing: 0.4em, + #stack( + dir: ltr, + spacing: 0.4em, - [ - #box( - width: 1.5cm, - height: 0.5pt, - fill: theme.heading-accent, - ) - ], + // ----- Decorative rule ----- + [ + #box( + width: 1.5cm, + height: 0.5pt, + fill: theme.heading-accent, + ) + ], - [ - #text( - size: 7pt, - fill: theme.heading-accent, - )[ - #theme-var("section-symbol") - ] - ], + // ----- Theme section symbol ----- + [ + #text( + size: 7pt, + fill: theme.heading-accent, + )[ + #theme-var("section-symbol") + ] + ], - [ - #box( - width: 1.5cm, - height: 0.5pt, - fill: theme.heading-accent, - ) - ], - ) - ] + // ----- Decorative rule ----- + [ + #box( + width: 1.5cm, + height: 0.5pt, + fill: theme.heading-accent, + ) + ], + ) + ] - // Level 2 — Section - show heading.where(level: 2): it => block( - above: 1.5em, - below: 0.7em, - )[ - #text( - size: 16pt, - weight: "bold", - fill: theme.heading, - )[ - #heading-number-content(it) #it.body - ] - ] + // ----- Level 2: section ----- + show heading.where(level: 2): it => block( + above: 1.5em, + below: 0.7em, + )[ + #text( + size: 16pt, + weight: "bold", + fill: theme.heading, + )[ + #heading-number-content(it) #it.body + ] + ] - // Level 3 — Subsection - show heading.where(level: 3): it => block( - above: 1em, - below: 0.4em, - )[ - #text( - size: 12pt, - weight: "bold", - fill: theme.heading-accent, - )[ - #heading-number-content(it) #it.body - ] - ] + // ----- Level 3: subsection ----- + show heading.where(level: 3): it => block( + above: 1em, + below: 0.4em, + )[ + #text( + size: 12pt, + weight: "bold", + fill: theme.heading-accent, + )[ + #heading-number-content(it) #it.body + ] + ] - // Level 4 — Minor subsection - show heading.where(level: 4): it => block( - above: 0.8em, - below: 0.3em, - )[ - #text( - size: 11pt, - weight: "bold", - fill: theme.heading-subtle, - )[ - #heading-number-content(it) #it.body - ] - ] + // ----- Level 4: minor subsection ----- + show heading.where(level: 4): it => block( + above: 0.8em, + below: 0.3em, + )[ + #text( + size: 11pt, + weight: "bold", + fill: theme.heading-subtle, + )[ + #heading-number-content(it) #it.body + ] + ] - // Level 5 — Smallest heading - show heading.where(level: 5): it => block( - above: 0.6em, - below: 0.2em, - )[ - #text( - size: 10pt, - weight: "bold", - fill: theme.heading-subtle, - )[ - #heading-number-content(it) #it.body - ] - ] - // --------------------------------------------------------------------------- - // Inline formatting - // --------------------------------------------------------------------------- + // ----- Level 5: smallest heading ----- + show heading.where(level: 5): it => block( + above: 0.6em, + below: 0.2em, + )[ + #text( + size: 10pt, + weight: "bold", + fill: theme.heading-subtle, + )[ + #heading-number-content(it) #it.body + ] + ] - show strong: it => text( - weight: "bold", - fill: theme.emphasis, - )[ - #it - ] + // =========================================================================== + // ----- Inline formatting ----- + // =========================================================================== - show emph: it => text( - style: "italic", - )[ - #it - ] + // ----- Style strong emphasis using the theme ----- + show strong: it => text( + weight: "bold", + fill: theme.emphasis, + )[ + #it + ] - show link: set text( - fill: theme.link, - ) + // ----- Preserve italic emphasis ----- + show emph: it => text( + style: "italic", + )[ + #it + ] - // --------------------------------------------------------------------------- - // Tables - // --------------------------------------------------------------------------- + // ----- Apply the theme's link color ----- + show link: set text( + fill: theme.link, + ) - set table( - stroke: 0.5pt + theme.border, - ) + // =========================================================================== + // ----- Tables ----- + // =========================================================================== - // --------------------------------------------------------------------------- - // Glossary - // --------------------------------------------------------------------------- + // ----- Apply the theme's default table border ----- + set table( + stroke: 0.5pt + theme.border, + ) - // panic(glossary) - show: make-glossary - // show ref: it => { - // let head = heading - // let el = it.element - // if el != none and el.func() == heading { - // // Override heading references. - // text(fill: red)[#link(el.location())[#it: #el.body]] - // } else if el != none and el.func() == figure and el.kind == "glossarium_entry" { - // smallcaps(it) - // } else { - // // Other references as usual. - // it - // } - // } - register-glossary(glossary) + // =========================================================================== + // ----- Glossary setup ----- + // =========================================================================== - show ref: it => { - let el = it.element + // ----- Enable glossary rendering and register project entries ----- + show: make-glossary + register-glossary(glossary) - if el != none and el.func() == figure and el.kind == "glossarium_entry" { - text(fill: theme.blood, it) - } else { - it - } - } + // ----- Color references to glossary entries ----- + show ref: it => { + let el = it.element - let print-glossary-entry(entry, ..) = { - let capitalize(s) = { - if type(s) == str { - let clusters = s.clusters() - if clusters.len() < 2 { - s - } else { - upper(clusters.at(0)) + clusters.slice(1).join() - } - } else { - s - } - } + if el != none and el.func() == figure and el.kind == "glossarium_entry" { + text(fill: theme.blood, it) + } else { + it + } + } - let refs = get-entry-back-references( - entry, - deduplicate: true, - ) + // =========================================================================== + // ----- Glossary entry renderer ----- + // =========================================================================== - let has-icon = entry.custom != none and "icon" in entry.custom and entry.custom.icon == true - let has-alts = entry.custom != none and "alts" in entry.custom + // ----- Render an individual glossary entry as a themed card ----- + let print-glossary-entry(entry, ..) = { + // ----- Capitalize the first grapheme of a string ----- + let capitalize(s) = { + if type(s) == str { + let clusters = s.clusters() + if clusters.len() < 2 { + s + } else { + upper(clusters.at(0)) + clusters.slice(1).join() + } + } else { + s + } + } - // --------------------------------------------------------------------------- - // Glossary card - // --------------------------------------------------------------------------- + // ----- Retrieve unique back-references to the entry ----- + let refs = get-entry-back-references( + entry, + deduplicate: true, + ) - block( - width: 100%, - above: 0.7em, - below: 0.7em, - fill: theme.parchment.lighten(90%), - stroke: ( - left: 2.5pt + theme.blood, - top: 0.5pt + theme.parchment.darken(7%), - right: 0.5pt + theme.parchment.darken(7%), - bottom: 0.5pt + theme.parchment.darken(7%), - ), - radius: 0.45em, - inset: ( - left: 0.8em, - right: 0.8em, - top: 0.65em, - bottom: 0.7em, - ), - )[ - // ------------------------------------------------------------------------- - // Header - // ------------------------------------------------------------------------- + // ----- Detect optional custom entry features ----- + let has-icon = ( + entry.custom != none + and "icon" in entry.custom + and entry.custom.icon == true + ) + let has-alts = entry.custom != none and "alts" in entry.custom - #grid( - columns: ( - if has-icon { auto } else { 0pt }, - 1fr, - auto, - ), - gutter: 0.6em, - align: (center, horizon, center), - // Icon - if has-icon [ - #box( - width: 1.8em, - height: 1.8em, - fill: theme.blood.lighten(82%), - radius: 0.35em, - align(center + horizon)[ - #text(size: 1.05em)[#entry.short] - ], - ) - ] else [], // Name - [ - #text( - size: 1.08em, - weight: "semibold", - fill: theme.blood, - )[ - #capitalize(if entry.long != none { - entry.long - } else { - entry.short - }) - ] #if entry.long != none and entry.short != none and not has-icon [ - #h(0.35em) #text( - size: 0.76em, - fill: theme.muted, - style: "italic", - )[ - (#capitalize(entry.short)) - ] - ] - ], - // Back references - // if refs.len() > 0 and refs.len() < 5 [ - // #box( - // fill: theme.parchment.darken(3%), - // stroke: 0.5pt + theme.parchment.darken(10%), - // inset: ( - // x: 0.5em, - // y: 0.25em, - // ), - // radius: 0.35em, - // )[ - // #text( - // size: 0.66em, - // weight: "medium", - // fill: theme.muted, - // )[ - // #refs.join(" · ") - // ] - // ] - // ] else [], - ) // ------------------------------------------------------------------------- - // Description - // ------------------------------------------------------------------------- - #if entry.description != none [ - // #v(0.55em) - #block( - // padding: (2em), - inset: ( - left: 0.35em, - right: 0.6em, - top: 0.15em, - bottom: 0.05em, - ), - // stroke: ( - // left: 1.25pt + theme.blood.lighten(35%), - // ), - )[ - #text( - size: 0.92em, - fill: theme.ink, - )[ - #h(2em) #entry.description - ] - ] - ] + // ------------------------------------------------------------------------- + // ----- Glossary card ----- + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // Alternative names - // ------------------------------------------------------------------------- + block( + width: 100%, + above: 0.7em, + below: 0.7em, + fill: theme.parchment.lighten(90%), + stroke: ( + left: 2.5pt + theme.blood, + top: 0.5pt + theme.parchment.darken(7%), + right: 0.5pt + theme.parchment.darken(7%), + bottom: 0.5pt + theme.parchment.darken(7%), + ), + radius: 0.45em, + inset: ( + left: 0.8em, + right: 0.8em, + top: 0.65em, + bottom: 0.7em, + ), + )[ - #if has-alts [ - #v(0.55em) + // ----------------------------------------------------------------------- + // ----- Entry header ----- + // ----------------------------------------------------------------------- - #grid( - columns: auto, - gutter: 0.5em, - align: (top, horizon), - [ - #text( - size: 0.67em, - weight: "semibold", - fill: theme.muted, - tracking: 0.04em, - )[Aussi appelé] - ], - [ - #box( - fill: theme.blood.lighten(88%), - inset: ( - x: 0.45em, - y: 0.22em, - ), - radius: 0.3em, - )[ - #text( - size: 0.78em, - fill: theme.blood.darken(8%), - )[ - #entry.custom.alts.join(", ") - ] - ] - ], - ) - ] - ] - } + #grid( + columns: ( + if has-icon { auto } else { 0pt }, + 1fr, + auto, + ), + gutter: 0.6em, + align: (center, horizon, center), - // ----------------------------------------------------------------------------- - // Glossary - // ----------------------------------------------------------------------------- + // ----- Optional entry icon ----- + if has-icon [ + #box( + width: 1.8em, + height: 1.8em, + fill: theme.blood.lighten(82%), + radius: 0.35em, + align(center + horizon)[ + #text(size: 1.05em)[#entry.short] + ], + ) + ] else [], - document + // ----- Entry name and short form ----- + [ + #text( + size: 1.08em, + weight: "semibold", + fill: theme.blood, + )[ + #capitalize(if entry.long != none { + entry.long + } else { + entry.short + }) + ] - [= Glossaire] - print-glossary( - glossary, - entry-sortkey: x => x.sort, - shorthands: ("plural", "capitalize", "capitalize-plural", "short", "long"), - show-all: true, + #if entry.long != none and entry.short != none and not has-icon [ + #h(0.35em) + #text( + size: 0.76em, + fill: theme.muted, + style: "italic", + )[ + (#capitalize(entry.short)) + ] + ] + ], - user-print-gloss: print-glossary-entry, - ) + // ----- Reserved space for optional back-references ----- + // if refs.len() > 0 and refs.len() < 5 [ + // ... + // ] else [], + ) + + // ----------------------------------------------------------------------- + // ----- Entry description ----- + // ----------------------------------------------------------------------- + + #if entry.description != none [ + #block( + inset: ( + left: 0.35em, + right: 0.6em, + top: 0.15em, + bottom: 0.05em, + ), + )[ + #text( + size: 0.92em, + fill: theme.ink, + )[ + #h(2em) #entry.description + ] + ] + ] + + // ----------------------------------------------------------------------- + // ----- Alternative names ----- + // ----------------------------------------------------------------------- + + #if has-alts [ + #v(0.55em) + + #grid( + columns: auto, + gutter: 0.5em, + align: (top, horizon), + [ + #text( + size: 0.67em, + weight: "semibold", + fill: theme.muted, + tracking: 0.04em, + )[Aussi appelé] + ], + [ + #box( + fill: theme.blood.lighten(88%), + inset: ( + x: 0.45em, + y: 0.22em, + ), + radius: 0.3em, + )[ + #text( + size: 0.78em, + fill: theme.blood.darken(8%), + )[ + #entry.custom.alts.join(", ") + ] + ] + ], + ) + ] + ] + } + + // =========================================================================== + // ----- Document and glossary ----- + // =========================================================================== + + // ----- Render the main document content ----- + document + + // ----- Append the complete glossary ----- + [= Glossaire] + print-glossary( + glossary, + entry-sortkey: x => x.sort, + shorthands: ( + "plural", + "capitalize", + "capitalize-plural", + "short", + "long", + ), + show-all: true, + user-print-gloss: print-glossary-entry, + ) } diff --git a/setup/school_model.typ b/setup/school_model.typ index 869a6b9..1a97ec9 100644 --- a/setup/school_model.typ +++ b/setup/school_model.typ @@ -1,677 +1,656 @@ +// ----- Project theme ----- #import "variables.typ": theme -// ----------------------------------------------------------------------------- -// Class presentation — Fantasy Codex -// ----------------------------------------------------------------------------- +// ----- Style a small uppercase section label ----- #let fantasy-label(body) = { - text( - size: 7.5pt, - weight: "bold", - fill: theme.dark-gold, - tracking: 0.12em, - )[ #body ] + text( + size: 7.5pt, + weight: "bold", + fill: theme.dark-gold, + tracking: 0.12em, + )[ #body ] } +// ----- Draw a subtle thematic divider ----- #let fantasy-rule() = { - line( - length: 100%, - stroke: 0.65pt + theme.border, - ) + line( + length: 100%, + stroke: 0.65pt + theme.border, + ) } +// ----- Display a section label followed by its content ----- #let fantasy-section(title, body) = { - fantasy-label(title) - v(0.3em) - body + fantasy-label(title) + v(0.3em) + body } // ============================================================================= -// Technique TSV importer +// ----- Technique TSV importer ----- +// +// Imports technique data from a TSV file and renders it as tiered tables. // // Usage: // #techniques("techniques.tsv") // -// Expected TSV structure: +// Expected structure: // // Tier 1 -// Technique Niv Type Coût [gauge] Effet [unused columns...] +// Technique Niv Type Coût [gauge] Effet ... // ... // // Tier 2 -// Technique Niv Type Coût [gauge] Effet [unused columns...] +// Technique Niv Type Coût [gauge] Effet ... // ... // ============================================================================= -// ----------------------------------------------------------------------------- -// Configuration -// ----------------------------------------------------------------------------- - +// ----- Define the TSV column mapping ----- #let technique-columns = ( - technique: 0, - level: 1, - type: 2, - blood: 3, - gauge: 4, - effect: 5, + technique: 0, + level: 1, + type: 2, + blood: 3, + gauge: 4, + effect: 5, ) -// ----------------------------------------------------------------------------- -// Helpers -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- TSV parsing helpers ----- +// ============================================================================= +// ----- Safely retrieve a cell with a fallback value ----- #let cell(row, index, default: "") = { - if index < row.len() { - row.at(index) - } else { - default - } + if index < row.len() { + row.at(index) + } else { + default + } } +// ----- Check whether a row contains no data ----- #let is-empty-row(row) = { - row.all(value => value.trim() == "") + row.all(value => value.trim() == "") } +// ----- Check whether a row is a repeated TSV header ----- #let is-header-row(row) = { - row.len() > 0 and cell(row, 0).trim() == "Technique" + row.len() > 0 and cell(row, 0).trim() == "Technique" } +// ----- Extract the tier number from a tier marker row ----- #let tier-name(row) = { - if row.len() == 0 { - none - } else { - let value = cell(row, 0).trim() + if row.len() == 0 { + none + } else { + let value = cell(row, 0).trim() - if value.starts-with("Tier ") { - value.slice(5).trim() - } else { - none - } - } + if value.starts-with("Tier ") { + value.slice(5).trim() + } else { + none + } + } } -// ----------------------------------------------------------------------------- -// LaTeX-ish → Typst conversion -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- LaTeX-ish → Typst conversion ----- // -// The TSV is deliberately allowed to contain the notation used by the -// original LaTeX source. We translate the commands here rather than -// modifying the source data. -// -// This function returns Typst content, not a string. -// ----------------------------------------------------------------------------- +// Converts supported LaTeX notation found in the TSV into Typst markup. +// The source data is intentionally left unchanged. +// ============================================================================= #let format-effect(value) = { - let s = value + let s = value - // --------------------------------------------------------------------------- - // Simple commands - // --------------------------------------------------------------------------- + // ----- Convert project-specific commands ----- + s = s.replace("\\arbreakk", "@armor_break:short") + s = s.replace("\\damagek", "@damage:short") + s = s.replace("\\pierce", "pierce") + s = s.replace("\\WIP", "WIP") + s = s.replace("\\contondant{}", "contondant") - s = s.replace("\\arbreakk", "@armor_break:short") - s = s.replace("\\damagek", "@damage:short") - s = s.replace("\\pierce", "pierce") - s = s.replace("\\WIP", "WIP") - s = s.replace("\\contondant{}", "contondant") + // ----- Convert basic formatting commands ----- + s = s.replace("\\emph{", "#emph[") + s = s.replace("}", "]") - // --------------------------------------------------------------------------- - // Common formatting commands - // --------------------------------------------------------------------------- + // ----- Convert glossary references ----- + s = s.replace( + "\\gls{", + "#gls(", + ) - s = s.replace("\\emph{", "#emph[") - s = s.replace("}", "]") + // ----- Convert other project-specific constructs ----- + s = s.replace( + "\\ddlvl{", + "#ddlvl(", + ) - // --------------------------------------------------------------------------- - // Glossary commands - // - // These are deliberately explicit so that the conversion is predictable. - // Add more terms here as your TSV grows. - // --------------------------------------------------------------------------- + // ----- Normalize math fragments ----- + s = s.replace( + ")$", + ") $", + ) + s = s.replace( + "$(", + "$ (", + ) - s = s.replace( - "\\gls{", - "#gls(", - ) - - // --------------------------------------------------------------------------- - // Other LaTeX constructs appearing in the data - // --------------------------------------------------------------------------- - - s = s.replace( - "\\ddlvl{", - "#ddlvl(", - ) - - // --------------------------------------------------------------------------- - // Math fragments - // --------------------------------------------------------------------------- - - s = s.replace( - ")$", - ") $", - ) - s = s.replace( - "$(", - "$ (", - ) - - // --------------------------------------------------------------------------- - // Convert the resulting string into Typst markup. - // - // The TSV is treated as trusted source data. - // --------------------------------------------------------------------------- - - // eval(s, mode: "markup") - s + // ----- Return the resulting Typst markup ----- + // eval(s, mode: "markup") + s } -// ----------------------------------------------------------------------------- -// Cost formatting -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- Technique cost formatting ----- +// ============================================================================= +// ----- Convert blood and gauge costs into inline Typst markup ----- #let format-cost(blood, gauge) = { - let parts = () + let parts = () - if blood.trim() != "" { - let value = blood.trim() - value = value.replace("🩸", "@blood:short") - parts.push(eval(value, mode: "markup")) - } + if blood.trim() != "" { + let value = blood.trim() + value = value.replace("🩸", "@blood:short") + parts.push(eval(value, mode: "markup")) + } - if gauge.trim() != "" { - let value = gauge.trim() - value = value.replace("⚡", "@jauge:short") - parts.push(eval(value, mode: "markup")) - } + if gauge.trim() != "" { + let value = gauge.trim() + value = value.replace("⚡", "@jauge:short") + parts.push(eval(value, mode: "markup")) + } - if parts.len() == 0 { - [] - } else { - parts.join("") - } + if parts.len() == 0 { + [] + } else { + parts.join("") + } } -// ----------------------------------------------------------------------------- -// Convert a TSV data row to table cells -// ----------------------------------------------------------------------------- - +// ----- Convert a TSV row into the table's five displayed cells ----- #let technique-row(row) = { - let c = technique-columns + let c = technique-columns - ( - cell(row, c.technique), - cell(row, c.level), - cell(row, c.type), - format-cost( - cell(row, c.blood), - cell(row, c.gauge), - ), - format-effect( - cell(row, c.effect), - ), - ) + ( + cell(row, c.technique), + cell(row, c.level), + cell(row, c.type), + format-cost( + cell(row, c.blood), + cell(row, c.gauge), + ), + format-effect( + cell(row, c.effect), + ), + ) } -// ----------------------------------------------------------------------------- -// Single tier table -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- Render a single technique tier ----- +// ============================================================================= #let technique-tier-table(tier, rows) = { - table( - columns: ( - 3.1cm, - 0.48cm, - 2.15cm, - 0.72cm, - 1fr, - ), - // No column gutter: the background fills the entire table. - column-gutter: 0pt, - row-gutter: 0pt, - inset: 0pt, - stroke: none, - align: ( - left, - center, - left, - center, - left, - ), - // ------------------------------------------------------------------------- - // Tier title - // ------------------------------------------------------------------------- - table.cell( - colspan: 5, - fill: white, - stroke: ( - top: 0pt, - bottom: 0.6pt + theme.border, - ), - inset: ( - x: 5pt, - y: 2.5pt, - ), - [ - #grid( - columns: (auto, 1fr), - column-gutter: 0.45em, - align: horizon, - )[ - #text( - size: 7.5pt, - weight: "bold", - fill: theme.gold, - )[◆] - ][ - #text( - size: 8.5pt, - weight: "bold", - fill: theme.dark-gold, - tracking: 0.08em, - )[ - TIER #tier - ] - ] - ], - ), - // ------------------------------------------------------------------------- - // Header - // ------------------------------------------------------------------------- - table.header( - table.cell( - fill: theme.dark-gold, - inset: ( - x: 4pt, - y: 2pt, - ), - [ - #text( - size: 7.2pt, - weight: "bold", - fill: theme.parchment-light, - )[Technique] - ], - ), + table( + columns: ( + 3.1cm, + 0.48cm, + 2.15cm, + 0.72cm, + 1fr, + ), + // ----- Use continuous backgrounds without column gutters ----- + column-gutter: 0pt, + row-gutter: 0pt, + inset: 0pt, + stroke: none, + align: ( + left, + center, + left, + center, + left, + ), - table.cell( - fill: theme.dark-gold, - inset: ( - x: 2pt, - y: 2pt, - ), - [ - #text( - size: 7.2pt, - weight: "bold", - fill: theme.parchment-light, - )[Niv] - ], - ), + // ----- Tier title ----- + table.cell( + colspan: 5, + fill: white, + stroke: ( + top: 0pt, + bottom: 0.6pt + theme.border, + ), + inset: ( + x: 5pt, + y: 2.5pt, + ), + [ + #grid( + columns: (auto, 1fr), + column-gutter: 0.45em, + align: horizon, + )[ + #text( + size: 7.5pt, + weight: "bold", + fill: theme.gold, + )[◆] + ][ + #text( + size: 8.5pt, + weight: "bold", + fill: theme.dark-gold, + tracking: 0.08em, + )[ + TIER #tier + ] + ] + ], + ), - table.cell( - fill: theme.dark-gold, - inset: ( - x: 4pt, - y: 2pt, - ), - [ - #text( - size: 7.2pt, - weight: "bold", - fill: theme.parchment-light, - )[Type] - ], - ), + // ----- Table header ----- + table.header( + table.cell( + fill: theme.dark-gold, + inset: ( + x: 4pt, + y: 2pt, + ), + [ + #text( + size: 7.2pt, + weight: "bold", + fill: theme.parchment-light, + )[Technique] + ], + ), - table.cell( - fill: theme.dark-gold, - inset: ( - x: 2pt, - y: 2pt, - ), - [ - #text( - size: 7.2pt, - weight: "bold", - fill: theme.parchment-light, - )[Coût] - ], - ), + table.cell( + fill: theme.dark-gold, + inset: ( + x: 2pt, + y: 2pt, + ), + [ + #text( + size: 7.2pt, + weight: "bold", + fill: theme.parchment-light, + )[Niv] + ], + ), - table.cell( - fill: theme.dark-gold, - inset: ( - x: 4pt, - y: 2pt, - ), - [ - #text( - size: 7.2pt, - weight: "bold", - fill: theme.parchment-light, - )[Effet] - ], - ), - ), - // ------------------------------------------------------------------------- - // Rows - // ------------------------------------------------------------------------- - ..rows.enumerate().map(((index, row)) => { - let cells = technique-row(row) + table.cell( + fill: theme.dark-gold, + inset: ( + x: 4pt, + y: 2pt, + ), + [ + #text( + size: 7.2pt, + weight: "bold", + fill: theme.parchment-light, + )[Type] + ], + ), - let fill = if calc.even(index) { - theme.parchment-light - } else { - theme.parchment - } + table.cell( + fill: theme.dark-gold, + inset: ( + x: 2pt, + y: 2pt, + ), + [ + #text( + size: 7.2pt, + weight: "bold", + fill: theme.parchment-light, + )[Coût] + ], + ), - cells.enumerate().map(((column, content)) => { - table.cell( - fill: fill, + table.cell( + fill: theme.dark-gold, + inset: ( + x: 4pt, + y: 2pt, + ), + [ + #text( + size: 7.2pt, + weight: "bold", + fill: theme.parchment-light, + )[Effet] + ], + ), + ), - stroke: ( - bottom: 0.3pt + theme.border, - ), + // ----- Render alternating technique rows ----- + ..rows + .enumerate() + .map(((index, row)) => { + let cells = technique-row(row) - inset: ( - x: if column == 1 or column == 3 { - 2pt - } else { - 4pt - }, - y: 1.8pt, - ), + let fill = if calc.even(index) { + theme.parchment-light + } else { + theme.parchment + } - [ - // TODO: EXTRACT THIS MAGIC VALUE - #text( - size: 10pt, - fill: theme.ink, - )[ - #content - ] - ], - ) - }) - }).flatten(), - ) + cells + .enumerate() + .map(((column, content)) => { + table.cell( + fill: fill, + + stroke: ( + bottom: 0.3pt + theme.border, + ), + + inset: ( + x: if column == 1 or column == 3 { + 2pt + } else { + 4pt + }, + y: 1.8pt, + ), + + [ + // ----- Apply the standard technique text size ----- + #text( + size: 10pt, + fill: theme.ink, + )[ + #content + ] + ], + ) + }) + }) + .flatten(), + ) } -// ----------------------------------------------------------------------------- -// Parse all tiers -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- Parse all technique tiers ----- +// ============================================================================= +// ----- Group TSV rows by their tier markers ----- #let parse-techniques(data) = { - let tiers = () - let current-tier = none - let current-rows = () + let tiers = () + let current-tier = none + let current-rows = () - for row in data { - // Empty separator row - if is-empty-row(row) { - continue - } + for row in data { + // ----- Ignore empty separator rows ----- + if is-empty-row(row) { + continue + } - // ------------------------------------------------------------------------- - // New tier - // ------------------------------------------------------------------------- + // ----- Start a new tier when a tier marker is found ----- + let tier = tier-name(row) - let tier = tier-name(row) + if tier != none { + // Save the previous tier. + if current-tier != none { + tiers.push(( + current-tier, + current-rows, + )) + } - if tier != none { - // Save previous tier - if current-tier != none { - tiers.push(( - current-tier, - current-rows, - )) - } + current-tier = tier + current-rows = () - current-tier = tier - current-rows = () + continue + } - continue - } + // ----- Ignore repeated TSV headers ----- + if is-header-row(row) { + continue + } - // ------------------------------------------------------------------------- - // Repeated header - // ------------------------------------------------------------------------- + // ----- Add technique rows to the current tier ----- + // Rows before the first tier are ignored. + if current-tier != none { + current-rows.push(row) + } + } - if is-header-row(row) { - continue - } + // ----- Save the final tier ----- + if current-tier != none { + tiers.push(( + current-tier, + current-rows, + )) + } - // ------------------------------------------------------------------------- - // Actual technique - // ------------------------------------------------------------------------- - - // Ignore anything before the first tier. - if current-tier != none { - current-rows.push(row) - } - } - - // Save final tier - if current-tier != none { - tiers.push(( - current-tier, - current-rows, - )) - } - - tiers + tiers } -// ----------------------------------------------------------------------------- -// Public API -// ----------------------------------------------------------------------------- +// ============================================================================= +// ----- Public technique importer ----- +// ============================================================================= +// ----- Import a TSV file and render its technique tiers ----- #let techniques(path) = { - let data = csv( - path, - delimiter: "\t", - ) + let data = csv( + path, + delimiter: "\t", + ) - let tiers = parse-techniques(data) + let tiers = parse-techniques(data) - for (index, tier) in tiers.enumerate() { - // TODO: Remove this magic value - if (index >= 4){ break } - let name = tier.at(0) - let rows = tier.at(1) + for (index, tier) in tiers.enumerate() { + // ----- Limit the number of rendered tiers ----- + // TODO: Remove this magic value + if (index >= 4) { break } - technique-tier-table( - name, - rows, - ) + let name = tier.at(0) + let rows = tier.at(1) - // Space between tiers, but not after the final table. - if index < tiers.len() - 1 { - v(0.7em) - } - } + technique-tier-table( + name, + rows, + ) + + // ----- Add spacing between tiers, but not after the last ----- + if index < tiers.len() - 1 { + v(0.7em) + } + } } +// ============================================================================= +// ----- Class presentation template ----- +// ============================================================================= + +// ----- Render the complete presentation for a class ----- #let school_presentation(class_info) = { - set text( - font: "Libertinus Serif", - fill: theme.ink, - ) + set text( + font: "Libertinus Serif", + fill: theme.ink, + ) - // --------------------------------------------------------------------------- - // Header - // --------------------------------------------------------------------------- + // --------------------------------------------------------------------------- + // ----- Header ----- + // --------------------------------------------------------------------------- - align(center)[ - #text( - size: 20pt, - weight: "bold", - fill: theme.ink, - )[ + align(center)[ + #text( + size: 20pt, + weight: "bold", + fill: theme.ink, + )[ + == #class_info.title + ] + #v(0.35em) - == #class_info.title + // ----- Ornamental divider ----- + #grid( + columns: (1fr, auto, 1fr), + column-gutter: 0.55em, + align: horizon, + )[ + #line( + length: 100%, + stroke: 0.7pt + theme.border, + ) + ][ + #text( + size: 10pt, + fill: theme.gold, + )[◆] + ][ + #line( + length: 100%, + stroke: 0.7pt + theme.border, + ) + ] + ] - ] + v(1em) - #v(0.35em) + // --------------------------------------------------------------------------- + // ----- Illustration and introduction ----- + // --------------------------------------------------------------------------- - // Ornamental divider - #grid( - columns: (1fr, auto, 1fr), - column-gutter: 0.55em, - align: horizon, - )[ - #line( - length: 100%, - stroke: 0.7pt + theme.border, - ) - ][ - #text( - size: 10pt, - fill: theme.gold, - )[◆] - ][ - #line( - length: 100%, - stroke: 0.7pt + theme.border, - ) - ] - ] + grid( + columns: (1.05fr, 1.7fr), + column-gutter: 1.3em, + align: top, - v(1em) + // ----- Class illustration ----- + [ + #block( + fill: theme.parchment-dark, + stroke: 0.8pt + theme.border, + inset: 0.3em, + )[ + #block( + clip: true, + stroke: 0.5pt + theme.border, + )[ + #image( + class_info.illustration, + width: 100%, + ) + ] + ] + ], - // --------------------------------------------------------------------------- - // Illustration + introduction - // --------------------------------------------------------------------------- + // ----- Class introduction ----- + [ + #fantasy-section("PRÉSENTATION")[ + #text( + size: 10.2pt, + )[ + #class_info.description + ] + ] + ], + ) - grid( - columns: (1.05fr, 1.7fr), - column-gutter: 1.3em, - align: top, - // Illustration - [ - #block( - fill: theme.parchment-dark, - stroke: 0.8pt + theme.border, - inset: 0.3em, - )[ - #block( - clip: true, - stroke: 0.5pt + theme.border, - )[ - #image( - class_info.illustration, - width: 100%, - ) - ] - ] - ], // Description - [ - #fantasy-section("PRÉSENTATION")[ - #text( - size: 10.2pt, - // leading: 1.35em, - )[ - #class_info.description - ] - ] - ], - ) + v(1em) - v(1em) + // --------------------------------------------------------------------------- + // ----- Class profile and mechanics ----- + // --------------------------------------------------------------------------- - // --------------------------------------------------------------------------- - // Class profile - // --------------------------------------------------------------------------- + fantasy-rule() - fantasy-rule() + v(0.7em) - v(0.7em) + grid( + columns: (1fr, 1.35fr), + column-gutter: 1.2em, + align: top, - grid( - columns: (1fr, 1.35fr), - column-gutter: 1.2em, - align: top, - // ------------------------------------------------------------------------- - // Profile / radar - // ------------------------------------------------------------------------- - [ - #block( - fill: theme.parchment, - stroke: 0.7pt + theme.border, - inset: 0.65em, - )[ - #align(center)[ - #fantasy-section("PROFIL")[ - #image( - class_info.radar, - width: 82%, - ) - ] - ] - ] - ], // ------------------------------------------------------------------------- - // Mechanics - // ------------------------------------------------------------------------- - [ // Exclusive mechanic - #block( - fill: theme.parchment-dark, - stroke: 0.8pt + theme.gold, - inset: (x: 0.8em, y: 0.65em), - )[ - #grid( - columns: (auto, 1fr), - column-gutter: 0.5em, - align: horizon, - )[ - #text( - size: 10pt, - fill: theme.gold, - )[◆] - ][ - #fantasy-label("MÉCANIQUE EXCLUSIVE") - ] + // ----- Class profile / radar ----- + [ + #block( + fill: theme.parchment, + stroke: 0.7pt + theme.border, + inset: 0.65em, + )[ + #align(center)[ + #fantasy-section("PROFIL")[ + #image( + class_info.radar, + width: 82%, + ) + ] + ] + ] + ], - #v(0.4em) + // ----- Class mechanics ----- + [ + // ----- Exclusive mechanic ----- + #block( + fill: theme.parchment-dark, + stroke: 0.8pt + theme.gold, + inset: (x: 0.8em, y: 0.65em), + )[ + #grid( + columns: (auto, 1fr), + column-gutter: 0.5em, + align: horizon, + )[ + #text( + size: 10pt, + fill: theme.gold, + )[◆] + ][ + #fantasy-label("MÉCANIQUE EXCLUSIVE") + ] - #text( - size: 13pt, - weight: "bold", - fill: theme.ink, - )[ - #class_info.mechanic - ] - ] + #v(0.4em) - #v(0.7em) + #text( + size: 13pt, + weight: "bold", + fill: theme.ink, + )[ + #class_info.mechanic + ] + ] - #grid( - columns: (1fr, auto), - align: horizon, - )[ - #fantasy-label("DIFFICULTÉ") - ][ - #grid( - // columns: repeat(5, 0.7em), - column-gutter: 0.25em, - )[ - #for i in range(5) { - if class_info.difficulty >= i + 1 { - text(size: 9pt, fill: theme.dark-gold)[●] - } else if class_info.difficulty >= i + 0.5 { - text(size: 9pt, fill: theme.dark-gold)[◐] - } else { - text(size: 9pt, fill: theme.border)[○] - } - } - ] - ]] - ) + #v(0.7em) - v(1em) - pagebreak() + // ----- Display the class difficulty rating ----- + #grid( + columns: (1fr, auto), + align: horizon, + )[ + #fantasy-label("DIFFICULTÉ") + ][ + #grid( + // columns: repeat(5, 0.7em), + column-gutter: 0.25em, + )[ + #for i in range(5) { + if class_info.difficulty >= i + 1 { + text(size: 9pt, fill: theme.dark-gold)[●] + } else if class_info.difficulty >= i + 0.5 { + text(size: 9pt, fill: theme.dark-gold)[◐] + } else { + text(size: 9pt, fill: theme.border)[○] + } + } + ] + ] + ], + ) - [=== Techniques] + v(1em) + pagebreak() - techniques(class_info.techniques) + // ----- Techniques section ----- + [=== Techniques] + + techniques(class_info.techniques) } diff --git a/setup/setup.typ b/setup/setup.typ index fca0ae7..9d515e6 100644 --- a/setup/setup.typ +++ b/setup/setup.typ @@ -1,48 +1,51 @@ -// Project variables +// ----- Project variables ----- #import "variables.typ": ravenous, theme, theme-var #import "../data/gen/build_info.typ": build_info #import "model.typ" as model -// Re exposing internals +// ----- Re-expose shared project data ----- #let ravenous = ravenous #let theme = theme #let theme-var = theme-var #let build_info = build_info #let gls = model.gls -// Template for classes +// ----- Public template for class presentations ----- #let school_presentation = model.school_presentation -// Inner modules and functions +// ----- Create a styled reminder/information box ----- #let memo_box(title: "À retenir", content) = { - block( - fill: theme.parchment, - stroke: 0.8pt + theme.gold, - inset: 12pt, - radius: 3pt, - )[ - #strong[#title] - - #content - ] + block( + fill: theme.parchment, + stroke: 0.8pt + theme.gold, + inset: 12pt, + radius: 3pt, + )[ + #strong[#title] + #content + ] } -// TODO: Have all be either admonish or whatever +// ----- Alias for the project's help box ----- #let ravhelp = memo_box -// WIP warnings +// ----- 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 ----- #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 ----- #let disable-warnings = uwarn.disable-warnings.with(ns) #let enable-warnings = uwarn.enable-warnings.with(ns) -// Create a main document config for the ravenous project +// ----- Apply the Ravenous model to the main document ----- #let config_main(variables: ravenous, document) = { - show: model.model(ravenous, document, theme, theme-var) + show: model.model(ravenous, document, theme, theme-var) } diff --git a/setup/themes.typ b/setup/themes.typ index b8fd650..1af1f44 100644 --- a/setup/themes.typ +++ b/setup/themes.typ @@ -1,179 +1,185 @@ -// ----------------------------------------------------------------------------- -// Color themes -// ----------------------------------------------------------------------------- +// ----- Available color themes ----- #let themes = ( - warm: ( - // --------------------------------------------------------------------------- - // Colors - // --------------------------------------------------------------------------- + warm: ( + // ----- Base colors ----- + ink: rgb("#302c26"), + muted-ink: rgb("#716957"), + gold: rgb("#9b8050"), + dark-gold: rgb("#70582f"), + parchment: rgb("#F4EBD8"), + parchment-dark: rgb("#ece4d2"), + parchment-light: rgb("#fbf9f3"), + parchment-accent: rgb("#EDE1C8"), + border: rgb("#c9bda4"), + blood: rgb("#7A2424"), + muted: rgb("#756B5D"), - ink: rgb("#302c26"), - muted-ink: rgb("#716957"), - gold: rgb("#9b8050"), - dark-gold: rgb("#70582f"), - parchment: rgb("#F4EBD8"), - parchment-dark: rgb("#ece4d2"), - parchment-light: rgb("#fbf9f3"), - parchment-accent: rgb("#EDE1C8"), - border: rgb("#c9bda4"), - blood: rgb("#7A2424"), - muted: rgb("#756B5D"), + // ----- Semantic colors ----- + heading: rgb("#7A2424"), + heading-accent: rgb("#9b8050"), + heading-subtle: rgb("#716957"), + emphasis: rgb("#7A2424"), + link: rgb("#7A2424"), - heading: rgb("#7A2424"), - heading-accent: rgb("#9b8050"), - heading-subtle: rgb("#716957"), - emphasis: rgb("#7A2424"), - link: rgb("#7A2424"), + // ----- Heading and decorative symbols ----- + heading-numbering: "1.", + section-symbol: "❖", + chapter-symbol: "✧", + small-symbol: "•", + bullet-symbol: "–", + separator-symbol: "◆", + ), - heading-numbering: "1.", + steel: ( + // ----- Base colors ----- + ink: rgb("#292B32"), + muted-ink: rgb("#626873"), + gold: rgb("#7187A0"), + dark-gold: rgb("#465A72"), + parchment: rgb("#EEF1F3"), + parchment-dark: rgb("#DCE2E7"), + parchment-light: rgb("#F7F9FA"), + parchment-accent: rgb("#DCE3E8"), + border: rgb("#B8C2CC"), + blood: rgb("#526D85"), + muted: rgb("#69717C"), - // Major headings - section-symbol: "❖", - chapter-symbol: "✧", - small-symbol: "•", - bullet-symbol: "–", - separator-symbol: "◆", - ), - steel: ( - ink: rgb("#292B32"), - muted-ink: rgb("#626873"), - gold: rgb("#7187A0"), - dark-gold: rgb("#465A72"), - parchment: rgb("#EEF1F3"), - parchment-dark: rgb("#DCE2E7"), - parchment-light: rgb("#F7F9FA"), - parchment-accent: rgb("#DCE3E8"), - border: rgb("#B8C2CC"), - blood: rgb("#526D85"), - muted: rgb("#69717C"), + // ----- Semantic colors ----- + heading: rgb("#526D85"), + heading-accent: rgb("#7187A0"), + heading-subtle: rgb("#626873"), + emphasis: rgb("#526D85"), + link: rgb("#526D85"), - heading: rgb("#526D85"), - heading-accent: rgb("#7187A0"), - heading-subtle: rgb("#626873"), - emphasis: rgb("#526D85"), - link: rgb("#526D85"), + // ----- Heading and decorative symbols ----- + heading-numbering: "1.", + section-symbol: "◆", + chapter-symbol: "◇", + small-symbol: "·", + ), - heading-numbering: "1.", - section-symbol: "◆", - chapter-symbol: "◇", - small-symbol: "·", - ), + sage: ( + // ----- Base colors ----- + ink: rgb("#29302A"), + muted-ink: rgb("#687064"), + gold: rgb("#7F8F62"), + dark-gold: rgb("#53603D"), + parchment: rgb("#F1F2E8"), + parchment-dark: rgb("#E1E4D5"), + parchment-light: rgb("#FAFBF5"), + parchment-accent: rgb("#E3E5D4"), + border: rgb("#BDC3AE"), + blood: rgb("#536B45"), + muted: rgb("#6D7568"), - sage: ( - ink: rgb("#29302A"), - muted-ink: rgb("#687064"), - gold: rgb("#7F8F62"), - dark-gold: rgb("#53603D"), - parchment: rgb("#F1F2E8"), - parchment-dark: rgb("#E1E4D5"), - parchment-light: rgb("#FAFBF5"), - parchment-accent: rgb("#E3E5D4"), - border: rgb("#BDC3AE"), - blood: rgb("#536B45"), - muted: rgb("#6D7568"), + // ----- Semantic colors ----- + heading: rgb("#536B45"), + heading-accent: rgb("#7F8F62"), + heading-subtle: rgb("#687064"), + emphasis: rgb("#536B45"), + link: rgb("#536B45"), - heading: rgb("#536B45"), - heading-accent: rgb("#7F8F62"), - heading-subtle: rgb("#687064"), - emphasis: rgb("#536B45"), - link: rgb("#536B45"), + // ----- Heading and decorative symbols ----- + heading-numbering: "1.", + section-symbol: "❦", + chapter-symbol: "›", + small-symbol: "·", + ), - heading-numbering: "1.", - section-symbol: "❦", - chapter-symbol: "›", - small-symbol: "·", - ), - bw: ( - ink: rgb("#202020"), - muted-ink: rgb("#666666"), - gold: rgb("#777777"), - dark-gold: rgb("#484848"), - parchment: rgb("#eeeeee"), - parchment-dark: rgb("#dddddd"), - parchment-light: rgb("#fafafa"), - parchment-accent: rgb("#E2E2E2"), - border: rgb("#b5b5b5"), - blood: rgb("#444444"), - muted: rgb("#707070"), + bw: ( + // ----- Base colors ----- + ink: rgb("#202020"), + muted-ink: rgb("#666666"), + gold: rgb("#777777"), + dark-gold: rgb("#484848"), + parchment: rgb("#eeeeee"), + parchment-dark: rgb("#dddddd"), + parchment-light: rgb("#fafafa"), + parchment-accent: rgb("#E2E2E2"), + border: rgb("#b5b5b5"), + blood: rgb("#444444"), + muted: rgb("#707070"), - heading: rgb("#202020"), - heading-accent: rgb("#484848"), - heading-subtle: rgb("#666666"), - emphasis: rgb("#202020"), - link: rgb("#202020"), - ), - high-contrast: ( - // --------------------------------------------------------------------------- - // Core colors - // --------------------------------------------------------------------------- - ink: rgb("#111111"), - muted-ink: rgb("#333333"), - gold: rgb("#005A9C"), - dark-gold: rgb("#003B66"), - parchment: rgb("#FFFFFF"), - parchment-dark: rgb("#E6E6E6"), - parchment-light: rgb("#FFFFFF"), - parchment-accent: rgb("#FFF4CC"), - border: rgb("#555555"), - blood: rgb("#A40000"), - muted: rgb("#444444"), + // ----- Semantic colors ----- + heading: rgb("#202020"), + heading-accent: rgb("#484848"), + heading-subtle: rgb("#666666"), + emphasis: rgb("#202020"), + link: rgb("#202020"), + ), - // --------------------------------------------------------------------------- - // Semantic roles - // --------------------------------------------------------------------------- + high-contrast: ( + // ----- Core colors ----- + ink: rgb("#111111"), + muted-ink: rgb("#333333"), + gold: rgb("#005A9C"), + dark-gold: rgb("#003B66"), + parchment: rgb("#FFFFFF"), + parchment-dark: rgb("#E6E6E6"), + parchment-light: rgb("#FFFFFF"), + parchment-accent: rgb("#FFF4CC"), + border: rgb("#555555"), + blood: rgb("#A40000"), + muted: rgb("#444444"), - heading: rgb("#003B66"), - heading-accent: rgb("#005A9C"), - heading-subtle: rgb("#333333"), + // ----- Semantic colors ----- + heading: rgb("#003B66"), + heading-accent: rgb("#005A9C"), + heading-subtle: rgb("#333333"), + emphasis: rgb("#A40000"), + link: rgb("#003B66"), + ), - emphasis: rgb("#A40000"), - link: rgb("#003B66"), - ), - yon-sen: ( - ink: rgb("#292724"), - muted-ink: rgb("#625D54"), - vermilion: rgb("#9E3B2F"), - dark-vermilion: rgb("#743129"), - indigo: rgb("#304C5E"), - dark-indigo: rgb("#263D4B"), - moss: rgb("#68705A"), - dark-moss: rgb("#4D5644"), - gold: rgb("#A88A54"), - dark-gold: rgb("#78633D"), - parchment: rgb("#F3EBDD"), - parchment-dark: rgb("#E7DDC9"), - parchment-light: rgb("#FAF6EC"), - parchment-accent: rgb("#EEE4D1"), + yon-sen: ( + // ----- Base colors ----- + ink: rgb("#292724"), + muted-ink: rgb("#625D54"), + vermilion: rgb("#9E3B2F"), + dark-vermilion: rgb("#743129"), + indigo: rgb("#304C5E"), + dark-indigo: rgb("#263D4B"), + moss: rgb("#68705A"), + dark-moss: rgb("#4D5644"), + gold: rgb("#A88A54"), + dark-gold: rgb("#78633D"), + parchment: rgb("#F3EBDD"), + parchment-dark: rgb("#E7DDC9"), + parchment-light: rgb("#FAF6EC"), + parchment-accent: rgb("#EEE4D1"), + border: rgb("#C8BDA8"), + muted: rgb("#777064"), - border: rgb("#C8BDA8"), - muted: rgb("#777064"), + // ----- Semantic colors ----- + heading: rgb("#743129"), + heading-accent: rgb("#304C5E"), + heading-subtle: rgb("#625D54"), + emphasis: rgb("#743129"), + link: rgb("#304C5E"), + blood: rgb("#8C3029"), - heading: rgb("#743129"), - heading-accent: rgb("#304C5E"), - heading-subtle: rgb("#625D54"), - emphasis: rgb("#743129"), - link: rgb("#304C5E"), - blood: rgb("#8C3029"), - - heading-numbering: "一、", - section-symbol: "※", - separator-symbol: "—", - important-symbol: "※", - quote-symbol: "「", - ), + // ----- Heading and decorative symbols ----- + heading-numbering: "一、", + section-symbol: "※", + separator-symbol: "—", + important-symbol: "※", + quote-symbol: "「", + ), ) +// ----- Return the complete selected theme ----- #let make-theme(theme: "warm") = { - themes.at(theme) + themes.at(theme) } +// ----- Return a safe dynamic theme-variable accessor ----- #let make-theme-variable(theme: "warm") = { - let symfinder(name) = { - if theme in themes { - themes.at(theme).at(name) - } else { - themes.at("warm").at(name) - } - } - symfinder + let symfinder(name) = { + if theme in themes { + themes.at(theme).at(name) + } else { + themes.at("warm").at(name) + } + } + + symfinder } diff --git a/setup/variables.typ b/setup/variables.typ index d3fa554..72f1613 100644 --- a/setup/variables.typ +++ b/setup/variables.typ @@ -1,5 +1,17 @@ +// ----- Theme constructors ----- #import "themes.typ": make-theme, make-theme-variable -#let ravenous = (name: "Ravenous", title: "Ravenous", copyright: "Dandaedre", date: "2021") + +// ----- Project metadata ----- +#let ravenous = ( + name: "Ravenous", + title: "Ravenous", + copyright: "Dandaedre", + date: "2021", +) + +// ----- Select the active color scheme ----- #let color_scheme = "warm" + +// ----- Build the active theme and its variable form ----- #let theme = make-theme(theme: color_scheme) #let theme-var = make-theme-variable(theme: color_scheme) diff --git a/test.typ b/test.typ deleted file mode 100644 index c041bf5..0000000 --- a/test.typ +++ /dev/null @@ -1,49 +0,0 @@ -#import "@preview/glossy:0.9.2": * -#let myGlossary = ( - html: ( - short: "HTML", - long: "Hypertext Markup Language", - description: "A standard language for creating web pages", - group: "Web" - ), - css: ( - short: "CSS", - long: "Cascading Style Sheets", - description: "A stylesheet language used for describing the presentation of a document", - group: "Web" - ), - tps: ( - short: "TPS", - long: "test procedure specification", - description: "A formal document describing test steps and expected results", - // Optional: Override automatic pluralization - plural: "TPSes", - longplural: "test procedure specifications", - reference: ( - key: "doe2025", - supplement: "p. 42" // Supplement is optional - ) - ), - el_slash: ( - long: box( - height: 0.65em, - baseline: 0.5pt, - inset: 0pt, - image("/images/icons/slash.png"), - ), - short: "tranchant", - description: "Type de dégât physique décrivant les attaques portées avec des objets acérés visant à couper leur cible.", - group: "Dégâts physiques", - ), - WWW: "World Wide Web", // concise entry with only short: long -) - -#show: init-glossary.with(myGlossary) - -#glossary( - title: "Web Development Glossary", // Optional: defaults to Glossary theme: - sort: true, // Optional: whether or not to sort the glossary - ignore-case: false, // Optional: ignore case when sorting terms - groups: ("Web"), // Optional: Filter to specific groups - show-all: true, // Optional; Show all terms even if unreferenced -)