docs: correct stale config.yaml claims and CLI help default

config.yaml was restored as the CLI config base, but the ConfigLoader
docstring and a test docstring still claimed it no longer ships, and the
--if-add-doc-description help said 'on by default' while the config.yaml
base sets it to 'no'.
This commit is contained in:
Ray 2026-07-14 17:49:55 +08:00
parent 29971049ae
commit fec44e16e4
3 changed files with 5 additions and 4 deletions

View file

@ -942,8 +942,9 @@ def add_node_text_with_labels(node, pdf_pages):
class ConfigLoader: class ConfigLoader:
"""Legacy 0.2.x config helper. Defaults now come from IndexConfig — the """Legacy 0.2.x config helper. Defaults now come from IndexConfig; this
old ``config.yaml`` no longer ships. Prefer ``pageindex.IndexConfig``. class no longer reads the packaged ``config.yaml`` (the CLI still uses it
via ``IndexConfig.from_yaml``). Prefer ``pageindex.IndexConfig``.
""" """
def __init__(self, default_path=None): def __init__(self, default_path=None):

View file

@ -32,7 +32,7 @@ if __name__ == "__main__":
parser.add_argument('--if-add-node-summary', nargs='?', const=True, type=_cli_bool, default=None, parser.add_argument('--if-add-node-summary', nargs='?', const=True, type=_cli_bool, default=None,
help='Add node summaries (on by default). Bare flag or yes/no') help='Add node summaries (on by default). Bare flag or yes/no')
parser.add_argument('--if-add-doc-description', nargs='?', const=True, type=_cli_bool, default=None, parser.add_argument('--if-add-doc-description', nargs='?', const=True, type=_cli_bool, default=None,
help='Add a document description (on by default). Bare flag or yes/no') help='Add a document description (off by default). Bare flag or yes/no')
parser.add_argument('--if-add-node-text', nargs='?', const=True, type=_cli_bool, default=None, parser.add_argument('--if-add-node-text', nargs='?', const=True, type=_cli_bool, default=None,
help='Add raw text to nodes (off by default). Bare flag or yes/no') help='Add raw text to nodes (off by default). Bare flag or yes/no')

View file

@ -63,7 +63,7 @@ def test_get_leaf_nodes_has_331_fix():
def test_configloader_no_longer_needs_config_yaml(): def test_configloader_no_longer_needs_config_yaml():
"""config.yaml was removed; ConfigLoader must build defaults from IndexConfig.""" """ConfigLoader must build defaults from IndexConfig, not read config.yaml."""
from pageindex.index.utils import ConfigLoader from pageindex.index.utils import ConfigLoader
cfg = ConfigLoader().load({"model": "gpt-5.4"}) cfg = ConfigLoader().load({"model": "gpt-5.4"})
assert cfg.model == "gpt-5.4" assert cfg.model == "gpt-5.4"