diff --git a/Jenkinsfile b/Jenkinsfile index 308ff8b..3984a59 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,9 @@ pipeline { environment { UV_CACHE_DIR = "${WORKSPACE}/.uv-cache" BUILD_DIR = 'build' - DEPLOY_DIR = '/mnt/books/ravenous_sheet' + DEPLOY_ROOT = '/mnt/books/RPG' + SHEET_DIR = 'ravenous_sheet' + LEGACY_DEPLOY_DIR = '/mnt/books/ravenous_sheet' } stages { @@ -117,19 +119,23 @@ pipeline { def devBranches = ['origin/candlelight', 'candlelight'] def productionBranches = ['origin/main', 'main', 'origin/master', 'master'] def targetDir + def legacyDir if (reviewBranches.contains(env.BRANCH_NAME)) { - targetDir = "${DEPLOY_DIR}_lighthouse" + targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}_lighthouse" + legacyDir = "${LEGACY_DEPLOY_DIR}_lighthouse" } else if (devBranches.contains(env.BRANCH_NAME)) { - targetDir = "${DEPLOY_DIR}_candlelight" + targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}_candlelight" + legacyDir = "${LEGACY_DEPLOY_DIR}_candlelight" } else if (productionBranches.contains(env.BRANCH_NAME)) { - targetDir = DEPLOY_DIR + targetDir = "${DEPLOY_ROOT}/${SHEET_DIR}" + legacyDir = LEGACY_DEPLOY_DIR } else { echo "Branch '${env.BRANCH_NAME}' is not a publication branch — skipping deployment." return } - deployTo(targetDir) + deployTo(targetDir, legacyDir) } } } @@ -172,13 +178,27 @@ pipeline { } -/** Publish the generated sheet under the books web root. */ -def deployTo(String targetDir) { +/** Publish under the shared RPG root, then remove this branch's legacy location. */ +def deployTo(String targetDir, String legacyDir) { + def allowedLegacyDirs = [ + '/mnt/books/ravenous_sheet', + '/mnt/books/ravenous_sheet_candlelight', + '/mnt/books/ravenous_sheet_lighthouse' + ] + if (!allowedLegacyDirs.contains(legacyDir)) { + error("Refusing to remove unexpected legacy deployment path: ${legacyDir}") + } + sh """ set -e echo "Publishing Ravenous Roll20 sheet to ${targetDir}" mkdir -p "${targetDir}" rsync -a --delete "${env.BUILD_DIR}/" "${targetDir}/" + + if [ -d "${legacyDir}" ]; then + echo "Removing legacy Ravenous Roll20 sheet from ${legacyDir}" + rm -rf -- "${legacyDir}" + fi """ } diff --git a/README.md b/README.md index 3b13c5f..a158b48 100644 --- a/README.md +++ b/README.md @@ -38,23 +38,21 @@ Le script crée `.venv/` et produit dans `build/` : - `build-info.json`, qui indique le nombre d'écoles, techniques et compétences importées ainsi que l'empreinte du contenu. -### Choisir un thème à l'export +### Choisir un thème -Le thème par défaut est `document.color_scheme` dans -`ravenous_typst/data/config/build.yaml`. Pour voir les thèmes définis dans le -livre puis exporter un autre CSS sans remplacer le build par défaut : +Chaque personnage choisit son thème avec le sélecteur **Apparence** en haut de +la feuille. La sélection est conservée dans l'attribut Roll20 `theme` et +s'applique également aux cartes de chat du personnage. Toutes les palettes de +`ravenous_typst/setup/theme/themes.typ` sont intégrées automatiquement au build ; +le thème initial vient de `document.color_scheme` dans +`ravenous_typst/data/config/build.yaml`. + +Pour afficher les identifiants disponibles : ```sh ./scripts/build.sh --list-themes -./scripts/build.sh --theme steel --output-dir build-steel -./scripts/build.sh --theme steel --output-dir build-steel --check ``` -Chargez `build-steel/ravenous.css` avec le HTML et la traduction du même dossier -dans Roll20. La feuille et ses cartes de chat utilisent la palette choisie. -Les couleurs viennent de `ravenous_typst/setup/theme/themes.typ` ; `src/ravenous.css` -reste le modèle CSS commun. - La limite des tiers d'école vient directement de `ravenous_typst/data/config/build.yaml` : seuls les tiers strictement inférieurs à `build.max_tier_exclusive` sont proposés par la feuille. Les trigrammes affichés @@ -268,11 +266,14 @@ Sur l'agent FreeBSD, il vérifie aussi que le Python utilisé par `uv` dispose d convertisseur de monstres en ont besoin. Les branches `main` et `master` sont publiées dans -`/mnt/books/ravenous_sheet`, correspondant à -`https://books.dandaedre.com/ravenous_sheet/`. Les branches `candlelight` et +`/mnt/books/RPG/ravenous_sheet`, correspondant à +`https://books.dandaedre.com/RPG/ravenous_sheet/`. Le dossier `RPG` est partagé +avec les autres feuilles et n'est jamais synchronisé avec `--delete` ; seule la +sous-arborescence Ravenous l'est. Après une publication réussie, Jenkins retire +l'ancien dossier `/mnt/books/ravenous_sheet`. Les branches `candlelight` et `lighthouse` utilisent respectivement les dossiers suffixés `_candlelight` et -`_lighthouse`. Les autres branches sont construites et archivées sans être -déployées. +`_lighthouse`, et retirent de la même façon leur ancien dossier suffixé. Les +autres branches sont construites et archivées sans être déployées. ## Notes Roll20 diff --git a/TASKS.md b/TASKS.md index 481538c..f15b623 100644 --- a/TASKS.md +++ b/TASKS.md @@ -13,8 +13,8 @@ parser, browser, or chat. resistance and protection summaries, technique import, skill outcomes, attack follow-up calculations, and damage mitigation. - [x] Verify generated artifacts with `./scripts/build.sh --check`. -- [x] Add themed exports from the book palette data, with a separate output - directory for alternate CSS and deterministic checks. +- [x] Add a persistent in-sheet theme selector generated from every palette in + the book data, including matching chat-card themes. - [x] Add a minimal GM-only Roll20 Mod proof of concept that creates one character from a JSON `name`; test valid and invalid commands locally. - [x] Add origin powers from the pinned book data stage by stage in an editable @@ -64,8 +64,8 @@ parser, browser, or chat. sheet now works with Legacy Sanitization disabled. The supplied console log shows sheet worker startup and no worker syntax error; only VTT startup, a CSP frame notice, and a layout warning remain. -- [x] Load one alternate theme (for example `build-steel/`) and inspect the - sheet and chat cards for legibility and contrast in Roll20. **2026-09-17:** +- [x] Select an alternate theme and inspect the sheet and chat cards for + legibility and contrast in Roll20. **2026-09-17:** user reports that the themes work perfectly. - [ ] Create an attacker and defender, plus a token representing the defender. Open both sheets; switch every tab; add, edit, delete, and reorder a repeating diff --git a/src/ravenous.css b/src/ravenous.css index 22be381..270e3e4 100644 --- a/src/ravenous.css +++ b/src/ravenous.css @@ -1,7 +1,9 @@ @import url('https://fonts.googleapis.com/css?family=Cinzel:600,700|Libre+Baskerville:400,400i,700'); .ravenous-sheet,.sheet-rolltemplate-ravenous { {{THEME_VARS}} } -.ravenous-sheet { box-sizing:border-box; max-width:980px; min-width:650px; margin:auto; padding:18px; color:var(--ink); background-color:var(--paper); background-image:radial-gradient(circle at 15% 10%,rgba(var(--gold-rgb),.09),transparent 35%),linear-gradient(90deg,rgba(var(--blood-rgb),.025) 1px,transparent 1px); background-size:auto,28px 28px; font:13px/1.4 "Libre Baskerville",Georgia,serif; border:1px solid var(--border); } +.ravenous-sheet { box-sizing:border-box; max-width:980px; min-width:650px; margin:auto; font:13px/1.4 "Libre Baskerville",Georgia,serif; } +.sheet-content { padding:18px; color:var(--ink); background-color:var(--paper); background-image:radial-gradient(circle at 15% 10%,rgba(var(--gold-rgb),.09),transparent 35%),linear-gradient(90deg,rgba(var(--blood-rgb),.025) 1px,transparent 1px); background-size:auto,28px 28px; border:1px solid var(--border); } +{{THEME_CSS}} .ravenous-sheet * { box-sizing:border-box; } .ravenous-sheet input,.ravenous-sheet select,.ravenous-sheet textarea { width:100%; border:0; border-bottom:1px solid var(--border); border-radius:0; background:rgba(var(--light-rgb),.72); color:var(--ink); font:inherit; padding:4px 6px; box-shadow:none; } .ravenous-sheet input:focus,.ravenous-sheet select:focus,.ravenous-sheet textarea:focus { outline:2px solid rgba(var(--gold-rgb),.35); border-color:var(--dark-gold); } @@ -14,7 +16,7 @@ .sigil::first-letter { transform:rotate(-45deg); } .identity>label { color:var(--blood); font:700 12px "Cinzel",serif; letter-spacing:.06em; } .identity>label input { font-size:22px; } -.identity-grid { display:grid; grid-template-columns:2fr 2fr 1fr; gap:8px; margin-top:6px; } +.identity-grid { display:grid; grid-template-columns:2fr 2fr 1.5fr 1fr; gap:8px; margin-top:6px; } .identity-grid label,.ravenous-sheet label { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.05em; } .motto { color:var(--dark-gold); font-style:italic; text-align:center; } .secret-rolls { display:flex; justify-content:center; align-items:center; gap:6px; margin-top:7px; color:var(--blood)!important; font-style:normal; } @@ -79,8 +81,8 @@ .skill-category-panel { display:none; } .skill-category-panel .skill-row:nth-child(even) { background:rgba(var(--accent-rgb),.52); } {{SKILL_CATEGORY_CSS}} -.skill-roll,.attack-roll,.use-effect,.activate-technique,.combat-card button[type=roll] { display:grid; place-items:center; width:28px; min-width:28px; height:28px; margin:0; padding:0; border:1px solid var(--dark-gold); border-radius:50%; background:var(--blood); color:var(--light); font-size:0; line-height:1; box-shadow:none; appearance:none; } -.ravenous-sheet .skill-roll::before,.ravenous-sheet .attack-roll::before,.ravenous-sheet button[type=roll].use-effect::before,.ravenous-sheet button[type=roll].activate-technique::before,.ravenous-sheet .combat-card button[type=roll]::before { content:"◆" !important; color:var(--light); font:10px/1 Georgia,serif !important; margin:0; } +.skill-roll,.attack-roll,.use-effect,.activate-technique,.combat-card button[type=roll] { display:grid; place-items:center; width:24px; min-width:24px; height:24px; margin:0; padding:0; border:1px solid var(--dark-gold); border-radius:50%; background:var(--blood); color:var(--light); font-size:0; line-height:1; box-shadow:none; appearance:none; } +.ravenous-sheet .skill-roll::before,.ravenous-sheet .attack-roll::before,.ravenous-sheet button[type=roll].use-effect::before,.ravenous-sheet button[type=roll].activate-technique::before,.ravenous-sheet .combat-card button[type=roll]::before { content:"◆" !important; color:var(--light); font:9px/1 Georgia,serif !important; margin:0; } .skill-roll:hover,.skill-roll:focus,.attack-roll:hover,.attack-roll:focus,.use-effect:hover,.use-effect:focus,.activate-technique:hover,.activate-technique:focus { border-color:var(--blood); background:var(--dark-gold); outline:2px solid rgba(var(--gold-rgb),.3); } .skill-name { font-weight:bold; } .skill-depth-1 .skill-name { padding-left:20px; } @@ -120,7 +122,7 @@ .consumable-details label input { height:28px; min-height:28px; margin:0; } .consumable-card textarea { display:block; width:100%; } .active { display:flex; align-items:center; gap:5px; padding:5px; } -.use-effect { flex:0 0 28px; } +.use-effect { flex:0 0 24px; } .modifier-card { display:grid; grid-template-columns:28px 58px minmax(180px,1fr) minmax(120px,180px); gap:7px; align-items:center; margin:8px 0; padding:9px; border:1px solid var(--border); border-left:4px solid var(--gold); background:rgba(var(--light-rgb),.74); } .modifier-card>.grow { min-width:0; } .modifier-card>label { display:flex; align-items:center; gap:5px; margin:0 !important; } @@ -142,7 +144,7 @@ .technique-message { display:flex; align-items:center; align-self:end; min-width:150px; height:32px; margin:0; color:var(--dark-gold); font-style:italic; } .technique-card { display:block; } .tech-title,.tech-meta { display:flex; gap:7px; align-items:end; } -.activate-technique { flex:0 0 28px; } +.activate-technique { flex:0 0 24px; } .tech-title>input { flex:1; color:var(--blood); font-weight:bold; } .tech-title button[type=action],.power-heading button[type=action] { flex:0 0 auto; padding:6px 9px; color:var(--light); border:0; background:var(--blood); } .tech-title label { width:75px; } diff --git a/src/ravenous.html b/src/ravenous.html index f9242ee..3b0b434 100644 --- a/src/ravenous.html +++ b/src/ravenous.html @@ -1,4 +1,6 @@