yggdrasil/Makefile
xfy 11261836c7 feat: add syntect code highlighting with catppuccin themes
- Add syntect dependency (server feature, fancy-regex backend)
- Create highlight module with LazyLock globals for SyntaxSet + themes
- Intercept CodeBlock events in markdown rendering for syntax highlighting
- Update ammonia whitelist to allow span/pre/code class/style attributes
- Add generate_highlight_css binary for CSS generation
- Add highlight-css Makefile target (runs before tailwindcss)
- Import generated highlight.css in input.css
- Remove hardcoded code block colors, let catppuccin CSS take over
2026-06-03 11:52:58 +08:00

35 lines
948 B
Makefile

.PHONY: dev build css css-watch clean build-editor highlight-css
build:
@$(MAKE) build-editor
@$(MAKE) highlight-css
@tailwindcss -i input.css -o public/style.css --minify
@dx build --release
highlight-css:
@cargo run --bin generate_highlight_css
build-editor:
@echo "Building Tiptap editor..."
@cd libs/tiptap-editor && npm install && npx vite build
@mv public/tiptap/editor.iife.js public/tiptap/editor.js 2>/dev/null || true
@mv public/tiptap/editor.iife.js.map public/tiptap/editor.js.map 2>/dev/null || true
@echo "Tiptap editor built."
dev:
@echo "Starting tailwindcss watch and dx serve..."
@tailwindcss -i input.css -o public/style.css --watch & \
TAILWIND_PID=$$!; \
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
dx serve --addr 0.0.0.0
css:
@tailwindcss -i input.css -o public/style.css
css-watch:
@tailwindcss -i input.css -o public/style.css --watch
clean:
@cargo clean
@rm -f public/style.css