Skip to content
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

Prioritize refpages/function documentation in search results #52

Open
r-potter opened this issue Oct 16, 2023 · 3 comments
Open

Prioritize refpages/function documentation in search results #52

r-potter opened this issue Oct 16, 2023 · 3 comments
Assignees
Labels
antora Fix or extension to antora behavior needed component Fix or change to an antora component repository needed documentation Improvements or additions to documentation enhancement New feature or request feature request New behavior or content search improve search

Comments

@r-potter
Copy link

When searching for Vulkan commands, is there any way to prioritize the actual function definition in the main spec? For example, searching for vkCreateInstance currently returns me 14 results, none of which are the actual definition of the entrypoint and it's corresponding documentation.

@r-potter r-potter added the enhancement New feature or request label Oct 16, 2023
@oddhack
Copy link
Collaborator

oddhack commented Oct 16, 2023

The function definition seems to be in the search index, so something about the way it's written must be giving it low priority. There doesn't seem to be much control over this in lunr or the Antora Lunr extension - there are a few lunr parameters but it isn't obvious how they would help here. We might have to synthesize some sort of (normally invisible) text the indexer can grab for refpage blocks.

I have considered integrating the separate refpages into the Antora site as a separate component. It would not be difficult but I'm not sure all that content duplication is helpful. Web search engines typically (or at least often) point people towards the refpages today.

@oddhack
Copy link
Collaborator

oddhack commented Oct 19, 2023

@oddhack oddhack self-assigned this Oct 19, 2023
@oddhack
Copy link
Collaborator

oddhack commented Oct 27, 2023

I'm starting to get a handle on this. Lunr doesn't process the HTML itself, it relies on something to marshall the data into a JSON file. For asciidoctor, we have a script config/chunkindex/generate-index.html which runs on the HTML chapter files and adds the API name anchors specifically as tagged constructs to be indexed. For Antora, the advice I've been getting is to turn every API name into its own separate section title/anchor, which is hideously impractical - some of our documents would end up with many hundreds of sections, and it would be massively intrusive on the spec markup.

But I'm pretty sure we can tweak the Antora Lunr Extension, which I assume is what's doing the JSON marshalling, to do the same thing that our indexer does. For comparison see e.g. https://registry.khronos.org/vulkan/specs/1.3-extensions/html/index.html and put vkCreateInstance in the searchbox - it comes up at the top, as desired.

@oddhack oddhack added documentation Improvements or additions to documentation feature request New behavior or content search improve search antora Fix or extension to antora behavior needed component Fix or change to an antora component repository needed labels Jan 29, 2024
@oddhack oddhack added this to the Needs Action/MR milestone Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
antora Fix or extension to antora behavior needed component Fix or change to an antora component repository needed documentation Improvements or additions to documentation enhancement New feature or request feature request New behavior or content search improve search
Projects
None yet
Development

No branches or pull requests

2 participants