feat(indexer): extract Office documents to Markdown with downmark - #225
Open
giraffesyo wants to merge 2 commits into
Open
feat(indexer): extract Office documents to Markdown with downmark#225giraffesyo wants to merge 2 commits into
giraffesyo wants to merge 2 commits into
Conversation
Word, PowerPoint, Excel and legacy .doc files now convert through @giraffesyo/downmark (pure-Go converter shipped as wasm in the server's npm deps) into the extract cache before enrich.py runs. enrich.py reuses those entries unchanged and keeps python-docx/pptx/openpyxl and the stdlib OOXML pass as the fallback for whatever downmark cannot read. PDFs stay with pdftotext and OCR. The conversion runs as a forked child (server/src/preextract.ts), never on the event loop, and as a CLI from reindex.sh. Cache entries refresh once per downmark version via extract/.downmark-version. The viewer renders the extracted Office text as Markdown, and .doc is now an extracted format.
downmark covers .docx/.pptx/.xlsx/.doc, so python-docx, python-pptx and openpyxl no longer earn their pip installs: remove them from enrich.py (the standard-library OOXML pass stays as the last resort), from the container recipe, from the per-host venv step in the workflow (gone entirely; reindex.sh and the server already find a Python 3.10+ on their own), from requirements.txt, and from the extractor report.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Office documents (
.docx,.pptx,.xlsx, and now.doc) extract to Markdown through@giraffesyo/downmark(pure-Go converter compiled to wasm, bundled as a server npm dependency). The Python Office readers are gone. PDFs are unchanged (pdftotext→ OCR).server/src/preextract.ts— walks the scope, converts stale/missing entries into$INDEX_BASE/extract/<rel>.txt, runs as a forked child (runPreExtract) fromindexing.tsbefore eachenrich.pypass, and as a CLI fromreindex.sh. Entries refresh once per downmark version (extract/.downmark-version).enrich.pyreuses the cache as before. python-docx / python-pptx / openpyxl are removed; the standard-library OOXML pass remains as the last resort for a document downmark rejects..docadded to the extracted suffixes.app.def(proof step now checks pdftotext, tesseract, soffice and the downmark wasm); the per-host venv step and itsPYTHON_BINexports leaveworkflow.yaml(reindex.shand the server already locate a Python 3.10+);requirements.txtkeeps only the optionalpypdf.Why
Verified
pnpm build(server + web) clean;workflow.yamlstill parses.touch+--subdirreconverts 1;enrich.pyover a fake GUFI tree indexes the Markdown (tables/headings present inwords), PDF still via pdftotext.runPreExtractfork works under tsx (dev) and fromdist/(prod, incl.pnpm deploy --legacylayout with the wasm).random.binas.docx) is logged, counted as failed, exit 0; with no cache entry and no python-docx installed,enrich.py's stdlib reader still indexes the document.Notes
reindex.shneeds the built server (server/dist/preextract.js) andnodeon PATH (NODE_BINoverrides); otherwise it says so and the stdlib reader applies.