# Justfile for Marp presentations # Default command default: just help # Show help help: @echo "Commands:" @echo " build - Build HTML" @echo " watch - Watch and rebuild" @echo " pdf - Export to PDF" @echo " new - Create presentation" @echo " clean - Remove output files" @echo " cleanup - Clean everything including node_modules" @echo " demo - Build demo presentations" @echo "" @echo "Themes: acarp (16:9), acarp-beamer (4:3)" @echo "Layouts: title, layout-2col" # Install dependencies install: npm install # Check if dependencies are installed, install if needed deps: @if [ ! -d "node_modules" ] || [ ! -f "package-lock.json" ]; then \ echo "Installing dependencies..."; \ npm install; \ fi # Build HTML from markdown build file: deps npx marp --config .marprc.json --html {{file}} # Watch markdown file and rebuild on changes watch file: deps npx marp --config .marprc.json --watch {{file}} # Convert to PDF pdf file: deps npx marp --config .marprc.json --pdf --browser chrome {{file}} # Build and open HTML file build-open file: (build file) #!/usr/bin/env sh html_file="$(echo "{{file}}" | sed 's/\.md$/.html/')" echo "Opening $html_file..." if command -v xdg-open > /dev/null; then xdg-open "$html_file" elif command -v open > /dev/null; then open "$html_file" elif command -v start > /dev/null; then start "$html_file" else echo "Could not find a command to open files" fi # Create new presentation from template new name: @cp template.md "{{name}}.md" @echo "Created {{name}}.md" # Clean output files clean: @rm -f *.html *.pdf *.pptx # Clean everything including node_modules cleanup: clean @echo "Removing node_modules..." @rm -rf node_modules/ @echo "Removing package-lock.json..." @rm -f package-lock.json @echo "Cleanup complete. Run 'just install' to reinstall dependencies." # Build demo presentations demo: @echo "Building demo-standard.md..." npx marp --config .marprc.json --html demo-standard.md @echo "Building demo-beamer.md..." npx marp --config .marprc.json --html demo-beamer.md @echo "Demo files built successfully!" build-open-all: #!/usr/bin/env sh # Build all files first for file in *.md; do if [ -f "$file" ]; then echo "Building $file..." theme=$(if echo "$file" | grep -q "beamer"; then echo "acarp-beamer"; else echo "acarp"; fi) npx marp --theme "$theme" --theme-set acarp.css --theme-set acarp-beamer.css --allow-local-files --html "$file" fi done # Then open all HTML files echo "Opening all HTML files..." for file in *.html; do if [ -f "$file" ]; then if command -v xdg-open > /dev/null; then xdg-open "$file" & elif command -v open > /dev/null; then open "$file" fi fi done