Tweaked the style sheets for fancy decorations in epub.

This commit is contained in:
Mark Wolfman
2021-07-13 22:37:13 -05:00
parent 3df1906156
commit 70cb8ae30f
5 changed files with 137 additions and 114 deletions
+5 -4
View File
@@ -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>
+28 -6
View File
@@ -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 {
+5 -5
View File
@@ -1,14 +1,15 @@
<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') %]
<div class="stat-block">
<h2 id="gm-monsters-[[ monster.name|to_heading_id ]]">[[ monster.name ]]</h2> <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>
@@ -25,7 +26,7 @@
</table> </table>
<!-- Attributes --> <!-- Attributes -->
<table> <table class="details">
<tr> <tr>
<th>STR</th> <th>STR</th>
<th>DEX</th> <th>DEX</th>
@@ -78,8 +79,7 @@
[[ monster.__doc__ | rst_to_html(top_heading_level=2) ]] [[ 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>
+2 -2
View File
@@ -1,7 +1,7 @@
[% macro spellblock(spell, id_base="spells", heading_level=2) -%] [% macro spellblock(spell, id_base="spells", heading_level=2) -%]
<div class="spell-block">
<h[[ heading_level ]] id="[[ id_base ]]-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</h[[ heading_level ]]> <h[[ heading_level ]] id="[[ id_base ]]-[[ spell.name | to_heading_id ]]">[[ spell.name ]]</h[[ heading_level ]]>
<p class="spell-school"> <p class="spell-school">
<!-- Spell school and level --> <!-- Spell school and level -->
[% if spell.level > 0 %] [% if spell.level > 0 %]
@@ -34,5 +34,5 @@
<div class="spell-description"> <div class="spell-description">
[[ spell.__doc__ | rst_to_html(top_heading_level=1) ]] [[ spell.__doc__ | rst_to_html(top_heading_level=1) ]]
</div> </div>
</div>
[%- endmacro %] [%- endmacro %]