2.3 KiB
2.3 KiB
Feature: PDF Download Button in Files Dashboard
Overview
Add a "Download as PDF" button in the file preview panel of the files dashboard, next to the existing preview button.
Requirements
Functionality
- When user clicks "Download PDF" on any markdown file, convert it to PDF and trigger download
- Button visible in:
/echo/files.htmlpreview panel - Works for:
.mdfiles (markdown) - Optional: Support other formats (txt, html) if time permits
UX
- Button placement: Next to "Preview" button in preview panel
- Button label: "📥 Download PDF" or "⬇️ PDF"
- Action: Click → PDF downloads to user's default Downloads folder
- Filename: Use original filename with
.pdfextension
Technical Requirements
Questions to Answer First:
-
Where is files.html code?
- Location of dashboard files app source
- Frontend framework (React, Vue, vanilla JS?)
- How preview panel is structured
-
PDF Conversion Options:
- Install
pandoc+ markdown-to-pdf pipeline? - Use server-side converter (Python:
markdown2,weasyprint,reportlab)? - Use client-side JS library (
html2pdf.js,pdfkit)? - Recommendation: Pandoc (robust, handles markdown edge cases well)
- Install
-
Architecture:
- Backend endpoint needed? (
/api/convert-to-pdf) - Or handle conversion in Python tooling?
- Where do temporary PDFs live before download?
- Backend endpoint needed? (
Implementation Path:
- Locate files app source code
- Add button HTML/UI element
- Wire click handler
- Choose converter (recommend: Pandoc + Python backend)
- Test with group sprijin files
Priority
- 🟡 Medium (nice-to-have, improves UX but not blocking)
- Context: User wants to share + print group activity sheets in PDF format
Related Files
- Dashboard location:
https://moltbot.tailf7372d.ts.net/echo/files.html - Files repo:
/home/moltbot/clawd/memory/kb/projects/grup-sprijin/biblioteca/ - First test case:
fisa-2026-02-05-ancorare-oglinda.md
Acceptance Criteria
- User can click "Download PDF" on any .md file
- PDF downloads with correct filename
- PDF preserves markdown formatting (headers, lists, emphasis)
- Works in Firefox/Chrome
Notes
- User is comfortable with multi-session handoff (can track progress across sub-agents)