diff --git a/pageindex/page_index_md.py b/pageindex/page_index_md.py index b154ab7..70e8de0 100644 --- a/pageindex/page_index_md.py +++ b/pageindex/page_index_md.py @@ -302,9 +302,8 @@ if __name__ == "__main__": import json # MD_NAME = 'Detect-Order-Construct' - MD_NAME = 'mcp' - # MD_NAME = 'Welcome' - MD_PATH = os.path.join(os.path.dirname(__file__), '..', 'docs', f'{MD_NAME}.md') + MD_NAME = 'cognitive-load' + MD_PATH = os.path.join(os.path.dirname(__file__), '..', 'tests/markdowns/', f'{MD_NAME}.md') MODEL="gpt-4.1" @@ -329,7 +328,7 @@ if __name__ == "__main__": print('\n' + '='*60) print('TABLE OF CONTENTS') print('='*60) - print_toc(tree_structure) + print_toc(tree_structure['structure']) output_path = os.path.join(os.path.dirname(__file__), '..', 'results', f'{MD_NAME}_structure.json') os.makedirs(os.path.dirname(output_path), exist_ok=True) diff --git a/pageindex/utils.py b/pageindex/utils.py index dc7acd8..04510b8 100644 --- a/pageindex/utils.py +++ b/pageindex/utils.py @@ -499,6 +499,7 @@ def remove_fields(data, fields=['text']): return data def print_toc(tree, indent=0): + print(tree) for node in tree: print(' ' * indent + node['title']) if node.get('nodes'):