Turn a workbook into a reportPassed
Send the numbers in temperature.xlsx to a client as a PDF with a proper table, temperature.pdf, and give me a Word copy, temperature.docx, that I can edit.
deft sheet to-md temperature.xlsx -o table.md deft md to-pdf table.md -o temperature.pdf deft md to-docx table.md -o temperature.docx
Input
Output
table.md 74 B
| label | value | | --- | --- | | celsius | 22.2222 | | fahrenheit | 72 |
temperature.docx 3.2 KB

Rendered by macOS Quick Look, first page
Text inside
label value celsius 22.2222 fahrenheit 72
temperature.pdf 8.1 KB · 1 page

Automatic checks (1)
- python: code = "import subprocess, zipfile\npdf = subprocess.run(['gs', '-q', '-dNOPAUSE', '-dBATCH', '-sDEVICE=txtwrite', '-sOutputFile=-', 'temperature.pdf'], capture_output=True, text=True, errors='replace').stdout\nassert '22.2222' in pdf and '72' in pdf, pdf\ndoc = zipfile.ZipFile('temperature.docx').read('word/document.xml').decode()\nassert '<w:tbl>' in doc and '22.2222' in doc and '72' in doc\n"
