batch docs update

This commit is contained in:
Mariano Gabriel
2026-07-05 10:38:29 -03:00
parent ca8b3a784d
commit fa3a0e3d1a
5 changed files with 219 additions and 143 deletions

View File

@@ -33,12 +33,15 @@ EXT ?=
PYTHON ?=
export PYTHON
# doocus (document extraction) knobs. DOCS_OUT defaults to docs-output; the input
# tree is mirrored under it. DOC_EXTRA forwards one-off flags to process_doc.py
# (e.g. --render for pdf page thumbnails, --ocr for images/scanned pdfs).
# doocus (tree indexing) knobs. DOCS_OUT defaults to docs-output; the whole input
# tree is replicated into index.json under it. DOC_EXTRA forwards one-off flags to
# process_tree.py (e.g. --render for pdf page thumbnails, --ocr for scanned pdfs).
DOCS_OUT ?= docs-output
DOC_EXTRA ?=
# Python interpreter for doocus (override PYTHON, else python3 — use `uv run make`).
PY := $(if $(PYTHON),$(PYTHON),python3)
.PHONY: batch dry docs docs-dry help
batch:
@@ -48,16 +51,16 @@ batch:
dry:
@ctrl/batch.sh -i "$(IN)" -o "$(OUT)" $(if $(EXT),-e "$(EXT)") -n
# Document extraction (doocus), mirrors the input tree into DOCS_OUT.
# make docs IN="/mnt/win/drive" # extract all docs
# make docs IN="..." DOC_EXTRA="--render --ocr" # thumbnails + OCR
# make docs-dry IN="..." # list what would run
# Document indexing (doocus): replicate the whole IN tree into DOCS_OUT/index.json,
# extracting text sidecars only for docx/pdf/pptx/xlsx.
# uv run make docs IN="/mnt/win/drive" # index the tree
# uv run make docs IN="..." DOC_EXTRA="--ocr" # + OCR scanned pdfs
# make docs-dry IN="..." # counts only, no writes
docs:
@ctrl/batch_docs.sh -i "$(IN)" -o "$(DOCS_OUT)" $(if $(EXT),-e "$(EXT)") -- \
$(DOC_EXTRA)
@$(PY) process_tree.py "$(IN)" --output "$(DOCS_OUT)" $(DOC_EXTRA)
docs-dry:
@ctrl/batch_docs.sh -i "$(IN)" -o "$(DOCS_OUT)" $(if $(EXT),-e "$(EXT)") -n
@$(PY) process_tree.py "$(IN)" --output "$(DOCS_OUT)" --dry-run
help:
@sed -n '3,14p' Makefile