- Add PDF generation using go-pdf/fpdf (Pure Go library) - Walk markdown AST and render directly to PDF - Update Dockerfile to include themes directory and config - Fix ENTRYPOINT format for serve mode Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
Implementation Plan
Project Constraints
- Pure Go binary (no external system dependencies for PDF).
- Config via
config.yamlonly (no CLI flags). - Hardcoded paths:
./content(input),./output(build artifacts). - Modes:
gocv(CLI),gocv serve(Daemon). - Commit at every loop iteration. Do not push. Do not tag.
Current Status
- Project backbone exists (HTTP server, graceful shutdown, config reading).
- Markdown parsing logic implemented (using goldmark).
- HTML Template engine integrated (Hugo-like theme selection).
- PDF Generation implemented (using go-pdf/fpdf - Pure Go library).
- CLI Mode (
gocv) generates static files to./outputand exits. - Serve Mode (
gocv serve) hosts HTML and serves PDF on demand. - File Watcher implemented for live reload in Serve Mode (using fsnotify).
- Dockerfile created for multi-stage build.
Active Task
- Analyze existing backbone code and integrate Markdown parsing.
- Integrate HTML template engine with theme selection.
- Implement Serve Mode with file watching for live reload.
- Create Dockerfile for multi-stage build.
Known Issues / Blockers
- Identify best Pure Go PDF library that supports HTML/CSS (or define CSS subset).
- Selected go-pdf/fpdf - generates PDFs programmatically from markdown AST.
- Note: Not HTML-to-PDF conversion; walks goldmark AST and renders directly.
- Current output is raw HTML fragments without full HTML document structure.
Completed Log
- Initial project structure defined.
- Basic HTTP server and signal handling implemented.
- CLI mode vs Serve mode distinction implemented (checks os.Args[1] for "serve").
- Content reading from
./contentdirectory implemented. - Markdown to HTML conversion using goldmark library.
- Theme system with templates/themes/{theme}/base.html structure.
- Config.yaml theme setting (defaults to "default").
- Output now generates complete HTML documents with styling.