When making GM session notes as epub, the party character sheets are also included.

This commit is contained in:
Mark Wolfman
2021-07-11 13:07:40 -05:00
parent f020eaccc6
commit e40d6b1a20
4 changed files with 17 additions and 5 deletions
+2 -1
View File
@@ -11,7 +11,8 @@
Dungeonsheets expects one file per character, with a ``.py``
extension. This file is a python module, most likely with a series of
variables set describing the character. They are roughly grouped into
variables set describing the character. Any attribute beginning with
an underscore ('_') will be ignored. They are roughly grouped into
sections, which are documented below. Additionally, some
:ref:`examples<examples>` may be useful.
+8 -1
View File
@@ -282,8 +282,15 @@ def make_gm_sheet(
except exceptions.LatexNotFoundError:
log.warning(f"``pdflatex`` not available. Skipping {basename}")
elif output_format == "epub":
chapters = {session_title: "".join(content)}
# Make sheets in the epub for each party member
for char in party:
char_html = make_character_content(char, "html",
fancy_decorations=fancy_decorations)
chapters[char.name] = "".join(char_html)
# Create the combined HTML file
epub.create_epub(
chapters={session_title: "".join(content)},
chapters=chapters,
basename=basename,
title=session_title,
use_dnd_decorations=fancy_decorations,
+4
View File
@@ -55,6 +55,10 @@ def read_sheet_file(filename: Union[str, Path]) -> dict:
# Remove imported dungeonsheets modules
char_props.pop("import_homebrew", None)
char_props.pop("mechanics", None)
# Remove private variables (start with a '_')
for attr in list(char_props.keys()):
if attr[0] == "_":
char_props.pop(attr)
return char_props
+2 -2
View File
@@ -9,7 +9,7 @@ sheet by running ``makesheets`` from the command line.
from dungeonsheets import mechanics, import_homebrew
# Load the module containing the homebrew content.
campaign = import_homebrew("homebrew_campaign.py")
_campaign = import_homebrew("homebrew_campaign.py")
dungeonsheets_version = "0.9.4"
@@ -96,7 +96,7 @@ class LegoShield(mechanics.Shield):
base_armor_class = 114
weapons = (DullSword, "rusty_shiv", campaign.BrightSword) # Example: ('shortsword', 'longsword')
weapons = (DullSword, "rusty_shiv", _campaign.BrightSword) # Example: ('shortsword', 'longsword')
magic_items = (RobeOfBreadSummoning, "staff_of_the_arbor_abode")
armor = PlasticArmor # Eg "leather armor"
shield = LegoShield # Eg "shield"