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

Different search backends #615

Closed
haampie opened this issue Dec 28, 2017 · 9 comments
Closed

Different search backends #615

haampie opened this issue Dec 28, 2017 · 9 comments

Comments

@haampie
Copy link

haampie commented Dec 28, 2017

Since search performance is questionable I tried indexing the official Julia docs in Algolia, which works pretty well. See http://julia-search-docs.surge.sh/ for an example. This was created by scraping the web page, not by generating the index with Documenter.jl.

Algolia offers this service for open source projects: https://community.algolia.com/docsearch/

I was thinking it is useful to allow differ search backends when generating docs. Thoughts?

@haampie haampie changed the title Using a service for search Different search backends Dec 28, 2017
@haampie
Copy link
Author

haampie commented Dec 28, 2017

My experience with Algolia so far is pretty good. You can search on macros like @time and @., on symbols like :LR, it has typo tolerance, responds in just 20ms etc.

@haampie
Copy link
Author

haampie commented Dec 29, 2017

Also possible is pagination and facetting:

https://haampie.github.io/julia-docs-search-ui/

For this example I've generated the index via Documenter.jl. I'm still looking for a way to get sensible excerpts from the content; right now the markup is removed.

@mortenpi
Copy link
Member

mortenpi commented Jan 7, 2018

Improvements to the search are certainly welcome. I wasn't aware of Algolia, but it looks pretty awesome. I am surprised how well it is able to scrape and make sense of the HTML already.

We could default to the current lunr.js-based for packages and offline docs, but allow integration with Algolia through an option (we need to pass the API keys anyway). As far as I can tell, it shouldn't be too difficult to integrate this into the current search page.

Would you be willing to take a stab at putting a PR together for this? The examples you have seem like pretty solid proofs of concept. I'd be more than happy to review and help with the Documenter side.

@haampie
Copy link
Author

haampie commented Jan 7, 2018

Would definitely like to contribute!

As was remarked on discourse there are two parts to this: an improved search functionality and an improved user interface as well.

I'm using Bootstrap for the latter, which makes life really easy. Maybe that would be useful for the docs as a whole as well? It would also allow theming in other packages.

@mortenpi
Copy link
Member

mortenpi commented Jan 8, 2018

I'm using Bootstrap for the latter, which makes life really easy. Maybe that would be useful for the docs as a whole as well? It would also allow theming in other packages.

Bootstrap basically provides a bunch of UI components, right? I would prefer if the docs wouldn't depend on JavaScript (the basic functionality should fall back nicely).

The search, of course, needs JS anyway. But for the style to be consistent with the rest of the docs I am wondering whether it would just be easier to do the the search UI the same way?

The philosophy with the HTML/CSS/JS design has been to keep it as simple and standard as reasonably possible. This includes keeping the HTML structure of the page simple, e.g. by avoiding superfluous <div>s etc.

@haampie
Copy link
Author

haampie commented Jan 9, 2018

Totally agree with keeping the docs minimalistic.

Bootstrap does not require Javascript, and via SASS you can generate only those parts of the CSS you want to use, customizable with variables. When the HTML is 'idiomatic' Bootstrap, then #579 is easy. In particular when the assets and tooling (sass -> css, minifier etc) for it are moved to a separate repository. Probably issues like #618 will not show up neither.

My motivation to have Bootstrap (the HTML en CSS that is) all over the place is that it's easier to add a new feature like search (without any knowledge of design / CSS)

@mortenpi
Copy link
Member

I took a closer look at Bootstrap and I am intrigued now. It would indeed be great to offload as much of the design work to a library like that. Basically we'd just have to annotate a bunch of the HTML tags we have with the various Bootstrap classes.. and translate the current theme to Bootstrap, right?

For SASS, are you proposing building the theme in a separate library and distributing the compiled CSS with Documenter's package? FWIW, since SASS is just a Ruby gem, it might be fine for Documenter to depend on it as well. Installing it on Travis shouldn't be a problem.

@haampie
Copy link
Author

haampie commented Jan 14, 2018

Basically we'd just have to annotate a bunch of the HTML tags we have with the various Bootstrap classes.. and translate the current theme to Bootstrap, right?

Exactly

Maybe it's best to move this discussion to a new issue

@odow
Copy link
Collaborator

odow commented Nov 1, 2023

Closing as stale. We have a new search backend now.

@odow odow closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants