feat(viewer): preview word documents (.docx/.doc/.odt/.rtf) as PDF
Nightly Build / build (push) Canceled after 10m54s
Nightly Build / build (push) Canceled after 10m54s
The file viewer converts word-processor documents to PDF server-side via LibreOffice (skald_core::docx::DocxConverter), mirroring the LaTeX pipeline but content-hash cached: the format is self-contained, so there is no dependency graph and the file watcher needs no expansion. Container-only documents are shuttled out and converted on the host. With no LibreOffice installed the viewer says so and falls back to download-only. Downloads still save the original document, not the preview PDF.
This commit is contained in:
@@ -464,6 +464,7 @@ function attachmentIcon(att) {
|
||||
const n = (att.name || '').toLowerCase();
|
||||
if (m.startsWith('image/')) return 'bi-file-earmark-image';
|
||||
if (m === 'application/pdf' || n.endsWith('.pdf')) return 'bi-file-earmark-pdf';
|
||||
if (/\.(docx?|odt|rtf)$/.test(n)) return 'bi-file-earmark-word';
|
||||
if (m.startsWith('audio/')) return 'bi-file-earmark-music';
|
||||
if (m.startsWith('video/')) return 'bi-file-earmark-play';
|
||||
if (m.startsWith('text/') || /\.(md|txt|csv|json|ya?ml|rs|js|ts|py)$/.test(n)) return 'bi-file-earmark-text';
|
||||
|
||||
Reference in New Issue
Block a user