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

Simplified search index #1284

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Conversation

jonludlam
Copy link
Member

This is for search on ocaml.org.

@jonludlam jonludlam force-pushed the simplified-search-index branch from 8ae410f to 900ace0 Compare January 22, 2025 13:57
Format.fprintf output
";\n\
const options = { keys: ['name', 'comment'] };\n\
var idx_fuse = new Fuse(documents, options);\n";
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are making that the use of Fuse part of odoc (and not part of odoc_driver) than I think we should add it to html_support_files. Personally, I would prefer to have Fuse use part of odoc_driver (although I'm fine with both solutions).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is a temporary grotty hack that I'd like to go away as soon as we've got proper sherlodoc support in ocaml.org. I'll see about hiding the options in the CLI.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it is something we are not going to keep, why not making it generated by the driver, from the output json file? This way, no need to hide it, and we have a guarantee no-one relies on it, if it happens to stay a bit longer before being removed.

Copy link
Collaborator

@panglesd panglesd Jan 22, 2025

Choose a reason for hiding this comment

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

(This could be done after the beta release, but before the actual release!)

src/odoc/indexing.ml Outdated Show resolved Hide resolved
| Some file, `JSON
when not
(Fpath.has_ext "json" (Fpath.v file)
|| Fpath.has_ext "js" (Fpath.v file)) ->
Error
(`Msg
"When generating a json index, the output must have a .json file \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or .js in this PR

@jonludlam jonludlam added the no changelog This pull request does not need a changelog entry label Jan 22, 2025
@jonludlam jonludlam merged commit e9ede95 into ocaml:master Jan 22, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog This pull request does not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants