mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-13 16:13:32 +02:00
Quick fix to module loading when using fancy D&D sheets.
This commit is contained in:
+4
-5
@@ -99,10 +99,9 @@ used, sub-folders will also be parsed.
|
||||
dungeon-sheets contains definitions for standard weapons and spells,
|
||||
so attack bonuses and damage can be calculated automatically.
|
||||
|
||||
If you have the excellent *dndbook* LaTeX template, consider using the
|
||||
``-F`` option to include this template for rendering spellbooks, druid
|
||||
wild forms and features pages:
|
||||
https://github.com/rpgtex/DND-5e-LaTeX-Template
|
||||
Consider using the ``-F`` option to include the excellent D&D 5e
|
||||
template for rendering spellbooks, druid wild forms and features
|
||||
pages (https://github.com/rpgtex/DND-5e-LaTeX-Template).
|
||||
|
||||
If you'd like a **step-by-step walkthrough** for creating a new
|
||||
character, just run ``create-character`` from a command line and a
|
||||
@@ -115,7 +114,7 @@ Content Descriptions
|
||||
The descriptions of content elements (e.g. classes, spells, etc.) are
|
||||
included in docstrings. The descriptions should ideally conform to
|
||||
reStructured text. This allows certain formatting elements to be
|
||||
properly parsed and rendered into LaTeX::
|
||||
properly parsed and rendered into LaTeX or HTML::
|
||||
|
||||
class Scrying(Spell):
|
||||
"""You can see and hear a particular creature you choose that is on
|
||||
|
||||
@@ -61,18 +61,22 @@ def create_latex_pdf(
|
||||
tex_command_line = [
|
||||
"pdflatex",
|
||||
"--output-directory",
|
||||
output_dir,
|
||||
str(output_dir),
|
||||
"-halt-on-error",
|
||||
"-interaction=nonstopmode",
|
||||
tex_file,
|
||||
str(tex_file),
|
||||
]
|
||||
|
||||
environment = os.environ
|
||||
tex_env = environment.get('TEXINPUTS', '')
|
||||
module_directory = str(Path(__file__).parent)
|
||||
environment['TEXINPUTS'] = f".:{module_directory}/modules//:" + tex_env
|
||||
|
||||
module_root = Path(__file__).parent / "modules/"
|
||||
module_dirs = [module_root / mdir for mdir in ["DND-5e-LaTeX-Template"]]
|
||||
log.debug(f"Loading additional modules from {module_dirs}.")
|
||||
environment['TEXINPUTS'] = f".:{':'.join(str(d) for d in module_dirs)}:" + tex_env
|
||||
passes = 2 if use_dnd_decorations else 1
|
||||
log.debug(tex_command_line)
|
||||
log.debug("LaTeX command: %s" % " ".join(tex_command_line))
|
||||
log.debug("LaTeX environ: %s" % environment)
|
||||
try:
|
||||
for i in range(passes):
|
||||
result = subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user