Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
823cc47
Update Docker image reference in README.rst
stiffneckjim Nov 8, 2025
992a8f5
ci: update branch references from master to main
stiffneckjim Nov 8, 2025
e3a4204
ci: update workflows to run on main branch and PRs
stiffneckjim Nov 8, 2025
4574578
Merge pull request #1 from stiffneckjim/ci/update-container-workflow
stiffneckjim Nov 8, 2025
59f0009
ci: remove Travis CI configuration
stiffneckjim Nov 8, 2025
f0936e2
Merge pull request #2 from stiffneckjim/ci/remove-travis
stiffneckjim Nov 10, 2025
f7b6a2e
Cleanup (#4)
stiffneckjim Nov 10, 2025
d334e3d
docs: add Copilot instructions with CI/CD documentation (#3)
stiffneckjim Nov 10, 2025
8ffa14b
Fix Docker workflow permission errors for PRs (#5)
stiffneckjim Nov 10, 2025
c679c30
Fix all invalid escape sequence warnings (#6)
stiffneckjim Nov 10, 2025
379c5d6
perf: Optimize Docker build - reduce size from 7GB to 1GB (#8)
stiffneckjim Nov 10, 2025
472455f
docs: Add comprehensive guide for fancy decorations feature (#9)
stiffneckjim Nov 10, 2025
fcf8632
Fix test failures: correct PDF output filename expectations (#7)
stiffneckjim Nov 10, 2025
25b8976
docs: add GitHub Flow workflow guidelines to copilot instructions (#10)
stiffneckjim Nov 11, 2025
86065d7
perf: Optimize LaTeX installation with minimal font packages (#11)
stiffneckjim Nov 11, 2025
cb21dae
feat: Re-enable fancy decorations with Royal font and minimal LaTeX p…
stiffneckjim Nov 11, 2025
402d8a2
Auto-initialize git submodules in dev container setup (#13)
stiffneckjim Nov 12, 2025
c25688c
Add paper size support (letter/A4) for character sheets (#14)
stiffneckjim Nov 15, 2025
724465b
Fix devcontainer configuration (#16)
stiffneckjim Nov 16, 2025
c281026
Fix/devcontainer config (#17)
stiffneckjim Nov 22, 2025
d393f4c
docs: Add Windows usage instructions and troubleshooting tips to READ…
stiffneckjim Nov 22, 2025
7d552eb
Fix TeX Live download failing (#20)
stiffneckjim Nov 30, 2025
c5762cb
Feature/added-arcane-weapon-and-potion-of-invisibility (#21)
stiffneckjim Dec 2, 2025
ed49381
Added Farmer background from PHB 2024
stiffneckjim Dec 1, 2025
150954d
22-artificer-is-missing-the-armorer-specialization (#23)
stiffneckjim Dec 23, 2025
993db39
Update git submodule DND-55e-LaTeX-Template
stiffneckjim Dec 26, 2025
0909038
Chore/use one dockerfile (#24)
stiffneckjim Jan 4, 2026
6263c4a
Add Gauntlets of Ogre Power magic item
stiffneckjim Mar 9, 2026
1d2e607
chore: migrate dependency management to uv (#26)
stiffneckjim Mar 9, 2026
d21c006
Add Docker test target and document Docker test workflow (#33)
stiffneckjim Mar 9, 2026
0334860
Follow-up Docker and README fixes after PR #33 (#38)
stiffneckjim Mar 12, 2026
90dd9f9
fix(ci): align TeX Live installer with Dockerfile, use tex.org.uk sou…
stiffneckjim Mar 12, 2026
6decc80
Merge branch 'main' into feature/188-gauntlets-ogre-power
stiffneckjim Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .devcontainer/.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
autoload -Uz compinit
compinit -i

# Settings from zsh-utils are here
bindkey -e

# Convenient path navigation, e.g., `cd vp`
setopt CDABLE_VARS

# Use Starship CLI
eval "$(starship init zsh)"
60 changes: 60 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Dev Container Configuration

This directory contains the VS Code Dev Container configuration for the dungeon-sheets project.

## Features

- **Python 3.12**: Base development environment
- **TeX Live**: Minimal installation with required packages for PDF generation
- **pdftk-java**: For PDF form filling
- **Docker-in-Docker**: Build and test Docker images within the dev container
- **Git**: Version control tools

## TeX Live Packages

The setup installs a minimal TeX Live distribution with packages defined in `install-texlive-packages.sh`:

- `collection-latexrecommended`: Core LaTeX packages
- Fonts: `bookman`, `gillius`, `kpfonts`, `lettrine`, `contour`, `avantgar`
- Layout: `xcolor`, `fontaxes`, `booktabs`, `enumitem`, `needspace`, `geometry`, `fancyhdr`, `caption`
- Core utilities: `supertabular`, `etoolbox`, `hyperref`, `graphics-def`, `epstopdf-pkg`

This shared package list ensures consistency between the Dockerfile and dev container setup.

To add or remove packages, edit `.devcontainer/install-texlive-packages.sh`.

This keeps the installation small (~300MB) while providing all necessary functionality.

## Manual Installation

If you need to install TeX Live manually in the current container:

```bash
bash .devcontainer/setup.sh
source /etc/profile.d/texlive.sh
```

## Testing

After setup, verify installation:

```bash
# Check pdflatex is available
which pdflatex
pdflatex --version

# Run tests
pytest tests/

# Generate a character sheet
makesheets examples/wizard1.py
```

## Rebuilding the Container

To apply changes to the dev container configuration:

1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
2. Select "Dev Containers: Rebuild Container"

This will recreate the container and run the setup script.
49 changes: 49 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "dungeon-sheets",
"build": {
"dockerfile": "../Dockerfile",
"context": "..",
"target": "dungeon-sheets-dev"
},

"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
}
},

"postCreateCommand": "bash ${containerWorkspaceFolder}/.devcontainer/post-create.sh",

"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
"ms-python.black-formatter",
"ms-azuretools.vscode-containers",
"ms-python.vscode-python-envs",
"ms-vscode-remote.remote-containers"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}
},
"codespaces": {
"repositories": {
"rpgtex/DND-5e-LaTeX-Template": {
"permissions": "write-all"
}
}
}
},

"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],

"remoteUser": "vscode"
}
50 changes: 50 additions & 0 deletions .devcontainer/install-texlive-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
# Shared TeX Live package installation list
# Used by both Dockerfile and devcontainer setup.sh

TEXLIVE_PACKAGES=(
collection-latexrecommended
xcolor
fontaxes
booktabs
enumitem
lettrine
kpfonts
bookman
courier
gillius
contour
avantgar
needspace
supertabular
etoolbox
hyperref
geometry
fancyhdr
caption
graphics-def
epstopdf-pkg
# Packages required for fancy D&D decorations
cfr-initials # Royal font
gensymb
was
hang
numprint
tcolorbox
environ
trimspaces
pdfcol
tikzfill
tocloft
titlesec
initials
keycommand
lipsum
luacolor
minifp
multitoc
xstring
)

# Join array with spaces
echo "${TEXLIVE_PACKAGES[*]}"
16 changes: 16 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -ex

echo "Initializing development environment..."

# Initialize git submodules
# If submodule init fails due to missing commits, try remote update
if ! git submodule update --init --recursive; then
echo "Standard submodule update failed, trying remote update..."
git submodule update --init --recursive --remote
fi

# Install dungeon-sheets in editable mode with dev dependencies
pip install -e ".[dev]"

echo "Development environment ready!"
38 changes: 38 additions & 0 deletions .devcontainer/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status

echo "======================================"
echo "Running Flake8 linting..."
echo "======================================"
uv run flake8 dungeonsheets/ --exit-zero

echo ""
echo "======================================"
echo "Testing makesheets (standard)..."
echo "======================================"
cd examples/
uv run makesheets --debug

echo ""
echo "======================================"
echo "Testing makesheets (fancy)..."
echo "======================================"
uv run makesheets --debug --fancy

echo ""
echo "======================================"
echo "Testing makesheets (epub)..."
echo "======================================"
uv run makesheets --debug --output-format=epub

echo ""
echo "======================================"
echo "Running pytest with coverage..."
echo "======================================"
cd ../
uv run pytest --cov=dungeonsheets tests/

echo ""
echo "======================================"
echo "All tests passed successfully!"
echo "======================================"
65 changes: 65 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
set -e

echo "Installing dungeon-sheets development dependencies..."

# Initialize git submodules
echo "Initializing git submodules..."
git submodule update --init --recursive

# Install system dependencies
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pdftk-java \
wget \
perl \
fontconfig

# Install Python package in editable mode with dev dependencies
pip install -e ".[dev]"

# Install minimal TeX Live
echo "Installing minimal TeX Live..."
cd /tmp
wget -q https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
tar -xzf install-tl-unx.tar.gz
cd install-tl-*/

# Create minimal profile
cat > texlive.profile << 'EOF'
selected_scheme scheme-basic
TEXDIR /usr/local/texlive
TEXMFLOCAL /usr/local/texlive/texmf-local
TEXMFSYSVAR /usr/local/texlive/texmf-var
TEXMFSYSCONFIG /usr/local/texlive/texmf-config
TEXMFVAR ~/.texlive/texmf-var
TEXMFCONFIG ~/.texlive/texmf-config
TEXMFHOME ~/texmf
option_doc 0
option_src 0
instopt_adjustpath 1
EOF

# Install TeX Live
sudo perl ./install-tl --profile=texlive.profile --no-interaction

# Add to PATH
export PATH="/usr/local/texlive/bin/x86_64-linux:$PATH"
echo 'export PATH="/usr/local/texlive/bin/x86_64-linux:$PATH"' | sudo tee -a /etc/profile.d/texlive.sh

# Install required LaTeX packages
echo "Installing LaTeX packages..."
# Get the script directory - works both when run directly and via postCreateCommand
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PACKAGES=$(bash "$SCRIPT_DIR/install-texlive-packages.sh")
sudo /usr/local/texlive/bin/x86_64-linux/tlmgr install $PACKAGES

# Update font cache
sudo fc-cache -fv

# Clean up
cd /
sudo rm -rf /tmp/install-tl-*

echo "Setup complete! TeX Live and dependencies installed."
echo "Run 'source /etc/profile.d/texlive.sh' to update PATH in current shell."
5 changes: 1 addition & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,5 @@ ENV/

add_spell.sh

# Not needed for building sheets
# Not needed for building sheets (but needed for testing)
characters/
examples/
tests/
docs/
Loading