This document describes the automated build system for the Sysmon Community Guide.
The new build system provides automated chapter assembly and PDF generation with the following improvements:
- Automated Chapter Assembly: No more manual maintenance of master markdown files
- Dependency Management: Docker containerization eliminates host dependency issues
- Validation: Comprehensive file and configuration validation
- CI/CD Integration: GitHub Actions workflow for automated builds
- Multiple Build Methods: Native, Docker, and Make-based builds
- Quality Preservation: Maintains exact same PDF output as original system
# Build master document
make build
# Generate PDF (requires pandoc, xelatex)
make pdf
# Build using Docker (no local dependencies)
make docker
# Clean build files
make clean# Build master document
./build.sh build
# Generate PDF
./build.sh pdf
# Validate files
./build.sh validate
# Build with Docker
./build.sh docker# Build master document
python3 build_guide.py
# Build with custom config
python3 build_guide.py custom-chapters.jsonRequires local installation of dependencies:
- Python 3.7+
- pandoc
- xelatex (TeX Live)
- DejaVu fonts
Ubuntu/Debian:
make install-depsmacOS:
make install-deps-macNo local dependencies required except Docker:
# Build master document
make docker
# Build PDF
make docker-pdf
# Interactive development
make devAutomatic builds on:
- Pushes to master/main branch
- Pull requests affecting chapters
- Manual workflow dispatch
Defines the structure and order of chapters:
{
"title": "Sysmon Community Guide",
"metadata": {
"title": "Sysmon Missing Manual",
"author": "Carlos Perez",
...
},
"chapters": [
{
"title": "What is Sysmon",
"file": "chapters/what-is-sysmon.md",
"level": 1
},
...
]
}- Input: Individual chapter files in
chapters/directory - Output: Master document in
Build/Sysmon.md - Media: Automatically copied from
chapters/media/toBuild/media/ - PDF: Generated in
Build/directory
SysmonCommunityGuide/
├── chapters.json # Chapter manifest and metadata
├── build_guide.py # Python build script
├── build.sh # Enhanced shell build script
├── Makefile # Simple make commands
├── Dockerfile # Container build environment
├── docker-compose.yml # Docker services
├── .github/workflows/ # CI/CD automation
├── chapters/ # Individual chapter files
│ ├── media/ # Images and assets
│ └── *.md # Chapter markdown files
├── Build/ # Build output directory
│ ├── Sysmon.md # Generated master document
│ ├── media/ # Copied media files
│ ├── *.tex # LaTeX configuration
│ └── *.pdf # Generated PDF
└── examples/ # Sample configurations
The build system includes comprehensive validation:
- JSON Configuration: Validates
chapters.jsonsyntax - File Existence: Ensures all referenced chapter files exist
- Image Links: Validates media file references
- Build Dependencies: Checks required tools are available
The PDF generation process:
- Chapter Assembly: Combines individual chapters per manifest
- Media Processing: Copies and adjusts image paths
- Metadata Injection: Adds YAML frontmatter with current date
- Pandoc Conversion: Converts markdown to LaTeX
- XeLaTeX Compilation: Generates final PDF with custom styling
- Custom LaTeX templates in
Build/directory - DejaVu Serif/Sans Mono fonts
- Chapter page breaks
- Syntax highlighting
- Custom bullet styles
- Proper margins and layout
Missing Dependencies:
make check-deps # Check what's missing
make docker # Use Docker insteadChapter Files Not Found:
make validate # Check file referencesPDF Generation Fails:
# Check pandoc/xelatex installation
pandoc --version
xelatex --version
# Use Docker build instead
make docker-pdfPermission Issues:
chmod +x build.sh
chmod +x build_guide.pyEnable verbose output:
./build.sh --verbose pdfView build logs:
# Check pandoc log
cat Build/pdfgen.log
# Check Docker logs
docker-compose logs- Create chapter file in
chapters/directory - Add entry to
chapters.jsonmanifest:{ "title": "New Chapter", "file": "chapters/new-chapter.md", "level": 2 } - Test the build:
make validate make build
- Modify Metadata: Edit
chapters.jsonmetadata section - Change Chapter Order: Reorder entries in
chapters.json - Add Build Steps: Extend
build_guide.pyorbuild.sh - Custom Styling: Modify LaTeX files in
Build/directory
The build system is designed to be maintainable and extensible:
- Modular Design: Separate concerns (assembly, validation, PDF generation)
- Error Handling: Comprehensive error checking and reporting
- Documentation: Inline code documentation and help text
- Testing: Validation and CI/CD integration
The new system is backward compatible:
- Existing
Build/Sysmon.md: Will be overwritten by automated build - LaTeX Templates: Preserved exactly as before
- PDF Output: Identical to original system
- Build Commands: Enhanced but compatible
To migrate:
- Use new build commands instead of manual editing
- Update chapter content in individual files
- Modify
chapters.jsonfor structural changes - Use Docker build for consistent environment