mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-07 13:15:53 +02:00
Tweaked the style sheets for fancy decorations in epub.
This commit is contained in:
@@ -12,6 +12,7 @@ from dungeonsheets import (
|
|||||||
armor,
|
armor,
|
||||||
background,
|
background,
|
||||||
classes,
|
classes,
|
||||||
|
exceptions,
|
||||||
features,
|
features,
|
||||||
infusions,
|
infusions,
|
||||||
magic_items,
|
magic_items,
|
||||||
@@ -270,7 +271,7 @@ class Character(Entity):
|
|||||||
self._race = find_content(newrace, valid_classes=[race.Race])(
|
self._race = find_content(newrace, valid_classes=[race.Race])(
|
||||||
owner=self
|
owner=self
|
||||||
)
|
)
|
||||||
except AttributeError:
|
except exceptions.ContentNotFound:
|
||||||
msg = f'Race "{newrace}" not defined. Please add it to ``race.py``'
|
msg = f'Race "{newrace}" not defined. Please add it to ``race.py``'
|
||||||
self._race = race.Race(owner=self)
|
self._race = race.Race(owner=self)
|
||||||
warnings.warn(msg)
|
warnings.warn(msg)
|
||||||
@@ -293,7 +294,7 @@ class Character(Entity):
|
|||||||
self._background = find_content(
|
self._background = find_content(
|
||||||
bg, valid_classes=[background.Background]
|
bg, valid_classes=[background.Background]
|
||||||
)(owner=self)
|
)(owner=self)
|
||||||
except AttributeError:
|
except exceptions.ContentNotFound:
|
||||||
msg = (
|
msg = (
|
||||||
f'Background "{bg}" not defined. Please add it to ``background.py``'
|
f'Background "{bg}" not defined. Please add it to ``background.py``'
|
||||||
)
|
)
|
||||||
@@ -693,9 +694,9 @@ class Character(Entity):
|
|||||||
@proficiencies_text.setter
|
@proficiencies_text.setter
|
||||||
def proficiencies_text(self, val):
|
def proficiencies_text(self, val):
|
||||||
try:
|
try:
|
||||||
profs = profiencies_text.split(",")
|
profs = val.split(",")
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
profs = proficiencies_text
|
profs = val
|
||||||
self._proficiencies_text = profs
|
self._proficiencies_text = profs
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
[% for shape in character.all_wild_shapes|sort(attribute='challenge_rating') %]
|
[% for shape in character.all_wild_shapes|sort(attribute='challenge_rating') %]
|
||||||
|
|
||||||
<div class="[% if not character.can_assume_shape(shape) %]known-beast-disabled[% endif %]">
|
<div class="stat-block[% if not character.can_assume_shape(shape) %] known-beast-disabled[% endif %]">
|
||||||
|
|
||||||
<h2 id="known-beasts-[[ shape.name | to_heading_id ]]">[[ shape.name ]]</h2>
|
<h2 id="known-beasts-[[ shape.name | to_heading_id ]]">[[ shape.name ]]</h2>
|
||||||
[% if shape.description %]
|
[% if shape.description %]
|
||||||
<p>[[ shape.description ]]</p>
|
<p class="creature-description">[[ shape.description ]]</p>
|
||||||
[% endif %]
|
[% endif %]
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|||||||
@@ -5,18 +5,33 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
background: #ECDDB4;
|
background: #f4ecdb;
|
||||||
}
|
}
|
||||||
table {
|
table {
|
||||||
background: #ECEEE3;
|
/* background: #ECEEE3; */
|
||||||
|
border-spacing: 0px;
|
||||||
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
tr:nth-child(even) {
|
tr:nth-child(even) {
|
||||||
background: #CDD290;
|
background: #E0E5C1;
|
||||||
}
|
}
|
||||||
th {
|
.stat-block {
|
||||||
font-family: sans-serif
|
background: #FDF1DC;
|
||||||
|
border-color: #E69A28;
|
||||||
|
border-width: 8px 0px;
|
||||||
|
border-style: solid;
|
||||||
|
margin: 16px 0px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
.stat-block .details {
|
||||||
|
color: #58180d;
|
||||||
|
}
|
||||||
|
.stat-block h2 {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
.stat-block .creature-description {
|
||||||
|
margin-top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[% else %]
|
[% else %]
|
||||||
/* Without Fancy decorations */
|
/* Without Fancy decorations */
|
||||||
@@ -62,11 +77,18 @@ dl.monster-spell-list a {
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: inherit;
|
text-decoration: inherit;
|
||||||
}
|
}
|
||||||
|
.creature-description {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
/* Spell descriptions */
|
/* Spell descriptions */
|
||||||
.spell-school {
|
.spell-school {
|
||||||
|
margin-top: 0px;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
.spell-block h2 {
|
||||||
|
margin-block: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dictionary lists for showing stats, etc */
|
/* Dictionary lists for showing stats, etc */
|
||||||
dl.details dt {
|
dl.details dt {
|
||||||
|
|||||||
@@ -1,85 +1,85 @@
|
|||||||
<h1 id="gm-monsters">Monsters</h1>
|
<h1 id="gm-monsters">Monsters</h1>
|
||||||
|
|
||||||
[% for monster in monsters|sort(attribute='name') %]
|
[% for monster in monsters|sort(attribute='name') %]
|
||||||
<h2 id="gm-monsters-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2>
|
<div class="stat-block">
|
||||||
|
<h2 id="gm-monsters-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2>
|
||||||
|
|
||||||
[% if monster.description %]
|
[% if monster.description %]
|
||||||
<h3>[[ monster.description ]]</h3>
|
<p class="creature-description">[[ monster.description ]]</p>
|
||||||
[% endif %]
|
[% endif %]
|
||||||
|
|
||||||
<!-- Basic properties -->
|
<!-- Basic properties -->
|
||||||
<table>
|
<table class="details">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Armor Class</th>
|
<th>Armor Class</th>
|
||||||
<th>Hit Points</th>
|
<th>Hit Points</th>
|
||||||
<th>Speed</th>
|
<th>Speed</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>[[ monster.armor_class ]]</td>
|
<td>[[ monster.armor_class ]]</td>
|
||||||
<td>[[ monster.hp_max ]] ([[ monster.hit_dice ]])</td>
|
<td>[[ monster.hp_max ]] ([[ monster.hit_dice ]])</td>
|
||||||
<td>[[ monster.speed ]][% if monster.swim_speed %],
|
<td>[[ monster.speed ]][% if monster.swim_speed %],
|
||||||
[[ monster.swim_speed ]] swim[% endif %][% if monster.fly_speed %],
|
[[ monster.swim_speed ]] swim[% endif %][% if monster.fly_speed %],
|
||||||
[[ monster.fly_speed ]] fly[% endif %][% if monster.burrow_speed %],
|
[[ monster.fly_speed ]] fly[% endif %][% if monster.burrow_speed %],
|
||||||
[[ monster.burrow_speed ]] burrow[% endif %]</td>
|
[[ monster.burrow_speed ]] burrow[% endif %]</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<!-- Attributes -->
|
<!-- Attributes -->
|
||||||
<table>
|
<table class="details">
|
||||||
<tr>
|
<tr>
|
||||||
<th>STR</th>
|
<th>STR</th>
|
||||||
<th>DEX</th>
|
<th>DEX</th>
|
||||||
<th>CON</th>
|
<th>CON</th>
|
||||||
<th>INT</th>
|
<th>INT</th>
|
||||||
<th>WIS</th>
|
<th>WIS</th>
|
||||||
<th>CHA</th>
|
<th>CHA</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>[[ monster.strength.value ]]</td>
|
<td>[[ monster.strength.value ]]</td>
|
||||||
<td>[[ monster.dexterity.value ]]</td>
|
<td>[[ monster.dexterity.value ]]</td>
|
||||||
<td>[[ monster.constitution.value ]]</td>
|
<td>[[ monster.constitution.value ]]</td>
|
||||||
<td>[[ monster.intelligence.value ]]</td>
|
<td>[[ monster.intelligence.value ]]</td>
|
||||||
<td>[[ monster.wisdom.value ]]</td>
|
<td>[[ monster.wisdom.value ]]</td>
|
||||||
<td>[[ monster.charisma.value ]]</td>
|
<td>[[ monster.charisma.value ]]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>([[ monster.strength.modifier|mod_str ]])</td>
|
<td>([[ monster.strength.modifier|mod_str ]])</td>
|
||||||
<td>([[ monster.dexterity.modifier|mod_str ]])</td>
|
<td>([[ monster.dexterity.modifier|mod_str ]])</td>
|
||||||
<td>([[ monster.constitution.modifier|mod_str ]])</td>
|
<td>([[ monster.constitution.modifier|mod_str ]])</td>
|
||||||
<td>([[ monster.intelligence.modifier|mod_str ]])</td>
|
<td>([[ monster.intelligence.modifier|mod_str ]])</td>
|
||||||
<td>([[ monster.wisdom.modifier|mod_str ]])</td>
|
<td>([[ monster.wisdom.modifier|mod_str ]])</td>
|
||||||
<td>([[ monster.charisma.modifier|mod_str ]])</td>
|
<td>([[ monster.charisma.modifier|mod_str ]])</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<dl class="monster-details details">
|
<dl class="monster-details details">
|
||||||
[% if monster.skills != "" %]<dt>Skills</dt><dd>[[ monster.skills ]]</dd>[% endif %]
|
[% if monster.skills != "" %]<dt>Skills</dt><dd>[[ monster.skills ]]</dd>[% endif %]
|
||||||
<dt>Senses</dt><dd>[% if monster.senses != "" %][[ monster.senses ]][% else %]--[% endif %]</dd>
|
<dt>Senses</dt><dd>[% if monster.senses != "" %][[ monster.senses ]][% else %]--[% endif %]</dd>
|
||||||
<dt>Languages</dt><dd>[% if monster.languages != "" %][[ monster.languages ]][% else %]--[% endif %]</dd>
|
<dt>Languages</dt><dd>[% if monster.languages != "" %][[ monster.languages ]][% else %]--[% endif %]</dd>
|
||||||
[% if monster.damage_resistances != "" %]<dt>Damage Resistances</dt><dd>[[ monster.damage_resistances ]]</dd>[% endif %]
|
[% if monster.damage_resistances != "" %]<dt>Damage Resistances</dt><dd>[[ monster.damage_resistances ]]</dd>[% endif %]
|
||||||
[% if monster.damage_immunities != "" %]<dt>Damage Immunities</dt><dd>[[ monster.damage_immunities ]]</dd>[% endif %]
|
[% if monster.damage_immunities != "" %]<dt>Damage Immunities</dt><dd>[[ monster.damage_immunities ]]</dd>[% endif %]
|
||||||
[% if monster.damage_vulnerabilities != "" %]<dt>Damage Vulnerabilities</dt><dd>[[ monster.damage_vulnerabilities ]]</dd>[% endif %]
|
[% if monster.damage_vulnerabilities != "" %]<dt>Damage Vulnerabilities</dt><dd>[[ monster.damage_vulnerabilities ]]</dd>[% endif %]
|
||||||
[% if monster.condition_immunities != "" %]<dt>Condition Immunuties</dt><dd>[[ monster.condition_immunities ]]</dd>[% endif %]
|
[% if monster.condition_immunities != "" %]<dt>Condition Immunuties</dt><dd>[[ monster.condition_immunities ]]</dd>[% endif %]
|
||||||
[% if monster.saving_throws != "" %]<dt>Saving Throws</dt><dd>[[ monster.saving_throws ]]</dd>[% endif %]
|
[% if monster.saving_throws != "" %]<dt>Saving Throws</dt><dd>[[ monster.saving_throws ]]</dd>[% endif %]
|
||||||
<dt>Challenge<dd>[[ monster.challenge_rating ]] </dd>
|
<dt>Challenge<dd>[[ monster.challenge_rating ]] </dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
[% if monster.spells | length > 0 %]
|
|
||||||
<dl class="monster-spell-list">
|
|
||||||
[% for level, spells in monster.spells | groupby('level') %]
|
|
||||||
<dt>[% if level == 0 %]Cantrips[% else %]Level [[ level ]][% endif %]</dt>
|
|
||||||
<dd>
|
|
||||||
[% for spell in spells %][% if not loop.first %], [% endif %]
|
|
||||||
<a href="#monster-spells-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</a>[% endfor %]
|
|
||||||
</dd>
|
|
||||||
[% endfor %]
|
|
||||||
</dl>
|
|
||||||
[% endif %]
|
|
||||||
|
|
||||||
[[ monster.__doc__ | rst_to_html(top_heading_level=2) ]]
|
|
||||||
|
|
||||||
|
[% if monster.spells | length > 0 %]
|
||||||
|
<dl class="monster-spell-list">
|
||||||
|
[% for level, spells in monster.spells | groupby('level') %]
|
||||||
|
<dt>[% if level == 0 %]Cantrips[% else %]Level [[ level ]][% endif %]</dt>
|
||||||
|
<dd>
|
||||||
|
[% for spell in spells %][% if not loop.first %], [% endif %]
|
||||||
|
<a href="#monster-spells-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</a>[% endfor %]
|
||||||
|
</dd>
|
||||||
|
[% endfor %]
|
||||||
|
</dl>
|
||||||
|
[% endif %]
|
||||||
|
|
||||||
|
[[ monster.__doc__ | rst_to_html(top_heading_level=2) ]]
|
||||||
|
|
||||||
|
</div>
|
||||||
[% endfor %]
|
[% endfor %]
|
||||||
|
|
||||||
<h1 id="monster-spells">Monster Spells</h1>
|
<h1 id="monster-spells">Monster Spells</h1>
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
[% macro spellblock(spell, id_base="spells", heading_level=2) -%]
|
[% macro spellblock(spell, id_base="spells", heading_level=2) -%]
|
||||||
|
|
||||||
<h[[ heading_level ]] id="[[ id_base ]]-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</h[[ heading_level ]]>
|
<div class="spell-block">
|
||||||
|
<h[[ heading_level ]] id="[[ id_base ]]-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</h[[ heading_level ]]>
|
||||||
|
<p class="spell-school">
|
||||||
|
<!-- Spell school and level -->
|
||||||
|
[% if spell.level > 0 %]
|
||||||
|
[[ spell.magic_school ]] Level [[ spell.level ]]
|
||||||
|
[% else %]
|
||||||
|
[[ spell.magic_school ]] Cantrip
|
||||||
|
[% endif %]
|
||||||
|
|
||||||
<p class="spell-school">
|
<!-- Ritual and/or concentration -->
|
||||||
<!-- Spell school and level -->
|
[% if spell.ritual and spell.concentration %]
|
||||||
[% if spell.level > 0 %]
|
(ritual, concentration)
|
||||||
[[ spell.magic_school ]] Level [[ spell.level ]]
|
[% elif spell.ritual %]
|
||||||
[% else %]
|
(ritual)
|
||||||
[[ spell.magic_school ]] Cantrip
|
[% elif spell.concentration %]
|
||||||
[% endif %]
|
(concentration)
|
||||||
|
[% endif %]
|
||||||
|
</p>
|
||||||
|
|
||||||
<!-- Ritual and/or concentration -->
|
<dl class="spell-details details">
|
||||||
[% if spell.ritual and spell.concentration %]
|
<dt>Casting Time</dt>
|
||||||
(ritual, concentration)
|
<dd>[[ spell.casting_time ]]</dd>
|
||||||
[% elif spell.ritual %]
|
<dt>Duration</dt>
|
||||||
(ritual)
|
<dd>[[ spell.duration ]]</dd>
|
||||||
[% elif spell.concentration %]
|
<dt>Range</dt>
|
||||||
(concentration)
|
<dd>[[ spell.casting_range ]]</dd>
|
||||||
[% endif %]
|
<dt>Components</dt>
|
||||||
</p>
|
<dd>[[ spell.component_string ]]</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<dl class="spell-details details">
|
<div class="spell-description">
|
||||||
<dt>Casting Time</dt>
|
[[ spell.__doc__ | rst_to_html(top_heading_level=1) ]]
|
||||||
<dd>[[ spell.casting_time ]]</dd>
|
</div>
|
||||||
<dt>Duration</dt>
|
|
||||||
<dd>[[ spell.duration ]]</dd>
|
|
||||||
<dt>Range</dt>
|
|
||||||
<dd>[[ spell.casting_range ]]</dd>
|
|
||||||
<dt>Components</dt>
|
|
||||||
<dd>[[ spell.component_string ]]</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
<div class="spell-description">
|
|
||||||
[[ spell.__doc__ | rst_to_html(top_heading_level=1) ]]
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[%- endmacro %]
|
[%- endmacro %]
|
||||||
|
|||||||
Reference in New Issue
Block a user