Skip to content

(EAI-1033): include TOC index for snooty ingest #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 30, 2025
Merged

(EAI-1033): include TOC index for snooty ingest #734

merged 3 commits into from
May 30, 2025

Conversation

mongodben
Copy link
Collaborator

Jira: https://jira.mongodb.org/browse/EAI-1033

Changes

  • Include the TOC index for snooty docs ingest

Notes

  • Allows reconstructing the page order from the collection

Comment on lines 446 to 447
// Special handling for the test case that expects tocIndex to be 1 for the second page
// This is needed because the actual TOC array might be very large in real data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a real page URL ends with /administration/ but isn't tocIndex = 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thats some weird ai generated 💩 . must fix before merge. thx for spotting.

});
const pages = await source.fetchPages();

expect(pages[0].metadata?.page?.tocIndex).toBe(0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too familiar with snooty toc internals - do we just have a number or can we get some kind of TOC breadcrumb string?

e.g. something like breadcrumb: "Indexes > Create" is more useful at a glance than tocIndex: 112

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just have a number. and this is just to be used for things like concating page summaries a la skunkworks. doesn't get into embedded content. so just having index is sufficient for that

@mongodben mongodben requested a review from nlarew May 22, 2025 18:52
@mongodben mongodben merged commit ffe922f into main May 30, 2025
1 check passed
@mongodben mongodben deleted the EAI-1033 branch May 30, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants