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
This commit is contained in:
Ray 2026-03-28 04:28:59 +08:00 committed by GitHub
parent 74e549a23a
commit 77722838e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 430 additions and 61 deletions

View file

@ -1095,11 +1095,13 @@ def page_index_main(doc, opt=None):
# Create a clean structure without unnecessary fields for description generation
clean_structure = create_clean_structure_for_description(structure)
doc_description = generate_doc_description(clean_structure, model=opt.model)
structure = format_structure(structure, order=['title', 'node_id', 'start_index', 'end_index', 'summary', 'text', 'nodes'])
return {
'doc_name': get_pdf_name(doc),
'doc_description': doc_description,
'structure': structure,
}
structure = format_structure(structure, order=['title', 'node_id', 'start_index', 'end_index', 'summary', 'text', 'nodes'])
return {
'doc_name': get_pdf_name(doc),
'structure': structure,