Commit graph

15 commits

Author SHA1 Message Date
mountain
6c948a332b refactor(index): dedupe the copied indexing pipeline behind deprecation shims
The new SDK copied the legacy indexing pipeline into pageindex/index/
instead of moving it, leaving two divergent copies of page_index.py /
page_index_md.py / utils.py. They had already drifted (the legacy copy
still compared IndexConfig booleans against 'yes' — a separate fix),
and every pipeline change had to be applied twice.

Make pageindex/index/ the single source of truth (same pattern as the
LegacyCloudAPI shim for the 0.2.x cloud SDK):

- pageindex/index/utils.py absorbs the 27 legacy-only helpers/classes
  (get_page_tokens, convert_page_to_int, ConfigLoader, PDF text helpers,
  ...) so it's the sole utils module. Reconciled the diverged funcs:
  kept the modern versions, backported the #331 get_leaf_nodes .get()
  fix, and restored remove_fields' max_len parameter (superset).
- index/page_index*.py now import `from .utils import *`;
  index/legacy_utils.py (a re-export of the old top-level utils) deleted.
- Top-level page_index.py / page_index_md.py / utils.py become thin
  re-export shims that emit PendingDeprecationWarning. The md_to_tree
  shim coerces legacy 'yes'/'no' string flags to bool (the canonical
  version is boolean-typed).
- ConfigLoader no longer reads the deleted config.yaml; it builds
  defaults from IndexConfig (was an unconditional FileNotFoundError).
- __init__.py and retrieve.py import from pageindex.index.* directly so
  `import pageindex` does not trip the shims.

Adds tests/test_legacy_shims.py pinning the contract: clean top-level
import doesn't warn, legacy submodule imports warn, symbols still
resolve, shim and canonical share one implementation, the #331 fix and
ConfigLoader-without-yaml both hold, and the md_to_tree coercion works.

Claude-Session: https://claude.ai/code/session_01Kx5DgKbhK1N8autqXH8SmS
2026-07-07 10:42:23 +08:00
Ray
77722838e1
Restructure examples directory and improve document storage (#189)
* Consolidate tests/ into examples/documents/

* Add line_count and reorder structure keys

* Lazy-load documents with _meta.json index

* Update demo script and add pre-shipped workspace

* Extract shared helpers for JSON reading and meta entry building
2026-03-28 04:28:59 +08:00
zmtomorrow
d4c910ad5a firx print_toc 2025-08-31 11:51:50 +01:00
Ray
987f91c3bf fix params 2025-08-28 13:22:43 +08:00
Ray
6d1b505541 fix params 2025-08-28 12:45:39 +08:00
zmtomorrow
277bcb9512 filter code 2025-08-27 15:22:44 +01:00
zmtomorrow
fdcbed54f1 Merge branch 'feat/markdown-tree' of github.com:VectifyAI/PageIndex into feat/markdown-tree 2025-08-27 15:12:55 +01:00
zmtomorrow
edd1be353c filter code 2025-08-27 15:12:45 +01:00
Ray
ad6a926fce add markdown runner 2025-08-26 21:27:40 +08:00
zmtomorrow
82ad5e2651 add markdown_to_tree 2025-08-26 12:18:06 +01:00
zmtomorrow
78cce56b33 add markdown_to_tree 2025-08-26 12:17:05 +01:00
Ray
c22778f85d fix node summary 2025-08-26 16:30:12 +08:00
Ray
34ed3fbc60 fix structure 2025-08-26 16:14:29 +08:00
Ray
802f149dd1 add summary 2025-08-26 15:49:03 +08:00
zmtomorrow
04bbdae647 add markdown_to_tree 2025-08-25 20:57:44 +01:00