-
Notifications
You must be signed in to change notification settings - Fork 0
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
display search result with a tree #1
base: main
Are you sure you want to change the base?
Conversation
1432007
to
f9aa2ea
Compare
7559523
to
dbd7f32
Compare
dbd7f32
to
7a6df87
Compare
return r.item.h2 === undefined; | ||
}); | ||
if (topSection === undefined) { | ||
const fakeH1 = structuredClone(value[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've no idea what we're trying to do there with those fakeH1 = ...
(fakeH1 is an object?), it may need comments
} | ||
|
||
for (const value of Object.values(h1Sections)) { | ||
const topSection = value.find((r) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments of that function says that a top section
is h1 but here apparently it's h2, I'm lost
@@ -439,6 +439,7 @@ function initializeSearchEngine() { | |||
anchorH3: elt.anchorH3, | |||
}); | |||
pageIndex.push({ | |||
file: res[i].file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already present in searchIndexLinks
no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but If I don't add it there, there is no way to distinguish if 2 items come from the same page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me the id
property is supposed to make the link between the two or I miss something?
} | ||
// Create the h1 key | ||
if (!grouping[item.file][item.h1]) { | ||
grouping[item.file][item.h1] = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So from here we consider that h1
cannot be undefined?
@@ -478,6 +479,8 @@ function initializeSearchEngine() { | |||
return searchState.promise; | |||
} | |||
|
|||
const __DEFAULT_SYMBOL__ = Symbol("__DEFAULT__"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice symbol usage, I like the idea.
We could add a comment
The idea of this proposal is to display results with a tree when searching on the doc.
There is an issue if the search result include a subsection but not the parent section, in this case the subsection is orphan, I'm not sure how to handle that.