mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-07 21:23:31 +02:00
When making GM session notes as epub, the party character sheets are also included.
This commit is contained in:
@@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
Dungeonsheets expects one file per character, with a ``.py``
|
Dungeonsheets expects one file per character, with a ``.py``
|
||||||
extension. This file is a python module, most likely with a series of
|
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
|
sections, which are documented below. Additionally, some
|
||||||
:ref:`examples<examples>` may be useful.
|
:ref:`examples<examples>` may be useful.
|
||||||
|
|
||||||
|
|||||||
@@ -282,8 +282,15 @@ def make_gm_sheet(
|
|||||||
except exceptions.LatexNotFoundError:
|
except exceptions.LatexNotFoundError:
|
||||||
log.warning(f"``pdflatex`` not available. Skipping {basename}")
|
log.warning(f"``pdflatex`` not available. Skipping {basename}")
|
||||||
elif output_format == "epub":
|
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(
|
epub.create_epub(
|
||||||
chapters={session_title: "".join(content)},
|
chapters=chapters,
|
||||||
basename=basename,
|
basename=basename,
|
||||||
title=session_title,
|
title=session_title,
|
||||||
use_dnd_decorations=fancy_decorations,
|
use_dnd_decorations=fancy_decorations,
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ def read_sheet_file(filename: Union[str, Path]) -> dict:
|
|||||||
# Remove imported dungeonsheets modules
|
# Remove imported dungeonsheets modules
|
||||||
char_props.pop("import_homebrew", None)
|
char_props.pop("import_homebrew", None)
|
||||||
char_props.pop("mechanics", 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
|
return char_props
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sheet by running ``makesheets`` from the command line.
|
|||||||
from dungeonsheets import mechanics, import_homebrew
|
from dungeonsheets import mechanics, import_homebrew
|
||||||
|
|
||||||
# Load the module containing the homebrew content.
|
# Load the module containing the homebrew content.
|
||||||
campaign = import_homebrew("homebrew_campaign.py")
|
_campaign = import_homebrew("homebrew_campaign.py")
|
||||||
|
|
||||||
dungeonsheets_version = "0.9.4"
|
dungeonsheets_version = "0.9.4"
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ class LegoShield(mechanics.Shield):
|
|||||||
base_armor_class = 114
|
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")
|
magic_items = (RobeOfBreadSummoning, "staff_of_the_arbor_abode")
|
||||||
armor = PlasticArmor # Eg "leather armor"
|
armor = PlasticArmor # Eg "leather armor"
|
||||||
shield = LegoShield # Eg "shield"
|
shield = LegoShield # Eg "shield"
|
||||||
|
|||||||
Reference in New Issue
Block a user