leanprover/doc-gen4

Show full results for search

jeremysalwen opened this issue · 10 comments

If you enter something into the search box, the autocompletions will only show up to a limited number of results. If you hit enter it goes to google site search which is an entirely different set of results. Would it be possible to just see the full set of autocomplete results for a given query?

Right now you can scroll in the search box to see up to 30 results. Do you want those results on a seperate page? (someone else would have to do that I don't know enough webdev for this) Or do you want to be able to see more than 30 results in the scroll? (that I can do)

A separate page would be nice, but just being able to see all of the results in the scroll box is all I need practically. I also know a bit of web dev so I could try to add another page if that's something that would be valuable.

Sure go for it!

How do you set up a dev environment for doc-gen4? I'd like to build the docs for mathlib using my modified version of doc-gen4 in a neighboring directory.

You change the version of the doc-gen4 in mathlib4 to point to your local directory as demonstrated here: https://github.com/leanprover/lake#syntax-of-require. Then you lake -Kdoc=on update and from there on build docs with lake -Kdoc=on build Mathilb:docs. Note that this does take quite a while so you might not necessarily want to build the docs for all of mathlib every time :P

Ok thanks, I was able to build the docs, but when I open index.html in Firefox, it seems like the Same Origin policy is breaking the search functionality:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///C:/Users/Jeremy/Documents/mathlib4/build/doc/search.js. (Reason: CORS request not http). I think I will need to set up a server to properly test it.

I'm really having trouble with caching issues. I turned off network request caching in my browser. I am able to make changes to the lean files and see them show up when I rebuild the docs for my test package. However, I can't seem to figure out any way to get the style.css changes to show up, even when deleting the entire build directory. Could you give details about what you are doing so that your changes show up in the generated docs?

style.css is included via meta programming, sadly we cannot yet (this is on the list) declare a dependency to lake via meta programming. What that means is that if you change style.css you also need to change the file that includes it or delete its build product (or the entire build of doc-gen4 if you want to be quick and dirty...and wait a little). This does tend to get a little annoying so sometimes when doing rapid development I just edit the style.css in the build output directory directly and later copy it back into the repository instead since its content does not influence anything else.

Is it just style.css, or also the other js files that have this property?

All of the files included the same way as style.css have this property.