- remove references to deleted _frontmatter.md, _intro.md, _outro.md - add termin 0 to build targets - remove broken assemble target (files are now self-contained) - update build/pdf/html targets to work directly from slides/ - add copy-assets target to copy assets and materials to build/ - fix deploy path to /hdm/223015b/
103 lines
3.2 KiB
Makefile
103 lines
3.2 KiB
Makefile
# Makefile for Marp Slides Project
|
|
|
|
.PHONY: help build dev watch pdf html clean install deploy copy-assets
|
|
|
|
# Directories
|
|
SLIDES_DIR = slides
|
|
BUILD_DIR = build
|
|
|
|
# Termin files (date-topic naming convention) - each is self-contained
|
|
TERMIN_0 = 2025-12-19-termin-0-intro
|
|
TERMIN_1 = 2025-12-19-termin-1-grundlagen-text-audio
|
|
TERMIN_2 = 2026-01-09-termin-2-bild-audio-video
|
|
TERMIN_3 = 2026-01-23-termin-3-speichermedien-schnittstellen
|
|
TERMIN_4 = 2026-01-30-termin-4-distribution-apis-zukunft
|
|
TERMIN_5 = 2026-xx-xx-termin-5-vertiefung-offene-fragen
|
|
TERMINS = $(TERMIN_0) $(TERMIN_1) $(TERMIN_2) $(TERMIN_3) $(TERMIN_4) $(TERMIN_5)
|
|
|
|
# Default target
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo ""
|
|
@echo " Development:"
|
|
@echo " make dev - Start dev server (browse all files at localhost:1312)"
|
|
@echo ""
|
|
@echo " Build:"
|
|
@echo " make build - Build all slides (HTML + PDF)"
|
|
@echo " make pdf - Export all slides to PDF"
|
|
@echo " make html - Export all slides to HTML"
|
|
@echo ""
|
|
@echo " Other:"
|
|
@echo " make clean - Remove generated files"
|
|
@echo " make install - Install dependencies"
|
|
@echo " make deploy - Deploy slides to server"
|
|
|
|
# Ensure build directory exists
|
|
$(BUILD_DIR)/.exists:
|
|
@mkdir -p $(BUILD_DIR)
|
|
@touch $@
|
|
|
|
# Development server - serves slides/ directly with HMR
|
|
dev:
|
|
@echo "Starting dev server with HMR..."
|
|
@echo "Open: http://localhost:1312"
|
|
PORT=1312 npx @marp-team/marp-cli --server $(SLIDES_DIR)/
|
|
|
|
# Watch for changes
|
|
watch:
|
|
npx @marp-team/marp-cli --watch $(SLIDES_DIR)/
|
|
|
|
# Copy assets and materials to build directory
|
|
copy-assets: $(BUILD_DIR)/.exists
|
|
@echo "Copying assets..."
|
|
@cp -r $(SLIDES_DIR)/assets $(BUILD_DIR)/
|
|
@cp -r $(SLIDES_DIR)/materials $(BUILD_DIR)/ 2>/dev/null || true
|
|
|
|
# Build all slides (HTML + PDF)
|
|
build: copy-assets
|
|
@echo "Building all slides..."
|
|
@for f in $(TERMINS); do \
|
|
echo "Building $$f..."; \
|
|
npx @marp-team/marp-cli $(SLIDES_DIR)/$$f.md -o $(BUILD_DIR)/$$f.html; \
|
|
npx @marp-team/marp-cli $(SLIDES_DIR)/$$f.md --pdf --allow-local-files -o $(BUILD_DIR)/$$f.pdf; \
|
|
done
|
|
@echo "Done! Output in $(BUILD_DIR)/"
|
|
|
|
# Export all slides to PDF
|
|
pdf: $(BUILD_DIR)/.exists
|
|
@echo "Exporting to PDF..."
|
|
@for f in $(TERMINS); do \
|
|
echo " $$f.pdf"; \
|
|
npx @marp-team/marp-cli $(SLIDES_DIR)/$$f.md --pdf --allow-local-files -o $(BUILD_DIR)/$$f.pdf; \
|
|
done
|
|
@echo "Done! PDFs in $(BUILD_DIR)/"
|
|
|
|
# Export all slides to HTML
|
|
html: copy-assets
|
|
@echo "Exporting to HTML..."
|
|
@for f in $(TERMINS); do \
|
|
echo " $$f.html"; \
|
|
npx @marp-team/marp-cli $(SLIDES_DIR)/$$f.md -o $(BUILD_DIR)/$$f.html; \
|
|
done
|
|
@echo "Done! HTML files in $(BUILD_DIR)/"
|
|
|
|
# Clean generated files
|
|
clean:
|
|
@echo "Cleaning generated files..."
|
|
rm -rf $(BUILD_DIR)/ *.pdf *.html
|
|
|
|
# Install dependencies
|
|
install:
|
|
@echo "Installing dependencies..."
|
|
npm install
|
|
|
|
# Deploy slides
|
|
deploy: build
|
|
@echo "Deploying slides..."
|
|
@echo "Copying HTML files..."
|
|
scp $(BUILD_DIR)/*.html tengo@tuttle.uberspace.de:/home/tengo/html/hdm/223015b/
|
|
@echo "Copying assets..."
|
|
scp -r $(BUILD_DIR)/assets/ tengo@tuttle.uberspace.de:/home/tengo/html/hdm/223015b/
|
|
@echo "Copying materials..."
|
|
scp -r $(BUILD_DIR)/materials/ tengo@tuttle.uberspace.de:/home/tengo/html/hdm/223015b/ 2>/dev/null || true
|