diff --git a/.github/workflows/build-sheets.yml b/.github/workflows/build-sheets.yml
new file mode 100644
index 0000000..2220f5d
--- /dev/null
+++ b/.github/workflows/build-sheets.yml
@@ -0,0 +1,43 @@
+name: Build Sheets
+
+on:
+ workflow_dispatch:
+ push:
+ paths:
+ - 'templates/**'
+ - 'components/**'
+ - 'scripts/build_sheets.py'
+ - '.github/workflows/build-sheets.yml'
+
+permissions:
+ contents: write
+
+jobs:
+ build-sheets:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.x'
+
+ - name: Build sheets from templates
+ run: python scripts/build_sheets.py
+
+ - name: Commit built sheets if changed
+ run: |
+ if git diff --quiet -- OutputSheets; then
+ echo "No OutputSheets changes detected"
+ exit 0
+ fi
+
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add OutputSheets
+ git commit -m "chore: rebuild OutputSheets from templates"
+ git push
diff --git a/OutputSheets/d20/fantasy/xmlhtml/csheet_known_spells.htm.ftl b/OutputSheets/d20/fantasy/xmlhtml/csheet_known_spells.htm.ftl
index 4c62cf8..dd28777 100644
--- a/OutputSheets/d20/fantasy/xmlhtml/csheet_known_spells.htm.ftl
+++ b/OutputSheets/d20/fantasy/xmlhtml/csheet_known_spells.htm.ftl
@@ -129,7 +129,6 @@
-
${pcstring('NAME')}
@@ -454,6 +453,7 @@
#if>
+
@@ -551,10 +551,22 @@
#if>
@loop>
<#assign charSize = pcstring('SIZE')?lower_case />
+<#assign sizeKey = charSize />
+<#if charSize?starts_with("tiny")><#assign sizeKey = "t" />
+<#elseif charSize?starts_with("small")><#assign sizeKey = "s" />
+<#elseif charSize?starts_with("medium")><#assign sizeKey = "m" />
+<#elseif charSize?starts_with("large")><#assign sizeKey = "l" />
+<#elseif charSize?starts_with("huge")><#assign sizeKey = "h" />
+<#elseif charSize?starts_with("gargantuan")><#assign sizeKey = "g" />
+<#elseif charSize?starts_with("colossal")><#assign sizeKey = "c" />
+#if>
<#assign unarmedDie = "1d3" />
-<#if charSize = "s"><#assign unarmedDie = "1d2" />
-<#elseif charSize = "m"><#assign unarmedDie = "1d3" />
-<#elseif charSize = "l"><#assign unarmedDie = "1d4" />
+<#if sizeKey == "t" || sizeKey == "s"><#assign unarmedDie = "1d2" />
+<#elseif sizeKey == "m"><#assign unarmedDie = "1d3" />
+<#elseif sizeKey == "l"><#assign unarmedDie = "1d4" />
+<#elseif sizeKey == "h"><#assign unarmedDie = "1d6" />
+<#elseif sizeKey == "g"><#assign unarmedDie = "1d8" />
+<#elseif sizeKey == "c"><#assign unarmedDie = "2d6" />
#if>
<#assign strMod = pcstring('STAT.0.MOD.SIGN') />
@@ -723,7 +735,7 @@
<#if (spelllevelcount > 0)>
- <#if (level = 0)>Cantrips (Level 0) — Unlimited Uses<#else>Level ${level} — Spells/Day: ${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
+ <#if (level == 0)>Cantrips (Level 0) — Unlimited Uses<#else>Level ${level} — Spells/Day: ${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
@@ -749,7 +761,7 @@
[${pcstring('SPELLMEM.${class}.0.${level}.${spell}.SOURCE')}]
|
- <#if (level = 0)>∞<#else>${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
+ <#if (level == 0)>∞<#else>${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
|
<#if !hasNoSave>${spSaveShort} DC ${spDC} #if>
@@ -786,7 +798,7 @@
<#if (spelllevelcount > 0)>
- <#if (level = 0)>Cantrips (Level 0) — Unlimited Uses<#else>Level ${level} — Prepared: ${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
+ <#if (level == 0)>Cantrips (Level 0) — Unlimited Uses<#else>Level ${level} — Prepared: ${pcstring('SPELLLISTCAST.${class}.${level}')}#if>
@@ -812,7 +824,7 @@
[${pcstring('SPELLMEM.${class}.${spellbook}.${level}.${spell}.SOURCE')}]
|
- <#if (level = 0)>∞<#else><@loop from=1 to=pcvar("SPELLMEM.${class}.${spellbook}.${level}.${spell}.TIMES")>☐@loop>#if>
+ <#if (level == 0)>∞<#else><@loop from=1 to=pcvar("SPELLMEM.${class}.${spellbook}.${level}.${spell}.TIMES")>☐@loop>#if>
|
<#if !hasNoSave>${spSaveShort} DC ${spDC} #if>
@@ -899,7 +911,6 @@
-
Equipment
@@ -1336,5 +1347,6 @@
Player: ${pcstring('PLAYERNAME')} — Character: ${pcstring('NAME')}
+
| |