-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve docs #1834
Improve docs #1834
Conversation
It's broken on Firefox with Linux
ad51628
to
7eaeb86
Compare
Looks great! |
@rosylilly Awesome!! Looks really nice :-) I really like the method list, showing the type it belongs to below it. I have some comments:
|
Oh, and a separate issue that is a bigger concern: generating the docs for the compiler now takes 22s instead of 1.5s. For another project I have the time went from 0.72s to 2.4s. Do you see an obvious reason for this performance decrease? |
Hmm... the performance decrease seems to come from the huge increment in the size of files. |
Fuzzy search is useful when having a few letters off (bcrt => Crypto::Bcrypt), or typing just some letters or each namespace (digmd => Digest::MD5). Yet, it would play better with a flatten list of types, and by returning exact matches first, then fuzzy (with matching text in bold). I don't think the tree is any useful anyway. I'd really prefer a flat list of "Crypto::Bcrypt" than having to click on "Crypto" that reload the whole page, which always make me click somewhere else than I intended next, or try and hit the tiny arrow to search for something... Ie. I think http://api.rubyonrails.org got it right. |
Page size increase: it pushes methods along with types, and its duplicated on each and every page. Either we return to iframes (but we'd lose the per-type URL), or we generate each page twice: once with the types and methods, and another one without. Loading the page loads the full page, clicking a link fetches the light page throught XHR, updating the DOM, the URL history, and the page title. |
Thank you for reviewing. but, I'm busy. Please give me some time. |
@rosylilly Sure, take your time :-) @ysbaddaden I also think some sort of ajax and having the data in json in some file will eventually be the solution to reduce the amount of hardcoded text. I also wouldn't mind at all doing this with [the recommended JS library/framework of these days]. Writing vanilla JS is no fun. |
That would likely be React, but I personally find it overkill for this situation. What about jQuery, with CoffeeScript if you don't like JS's syntax? |
I agree that fuzzy search by default is good thing. To make it work well one needs to sort by the best match first though (eg. the smallest levensthein distance at the top), results with the same score should be sorted alphabetically in their category. That would automatically put exact matches at the top. |
I think eventually the best thing to do, maybe, is to generate a json file with all the data and let a user browse them, using javascript. This will make the docs really compact, and searching content should be very easy to do. I'm closing this for now. |
I'm agree. |
You can preview this. Let's access https://crystal-doc-new-design.herokuapp.com/ .
Preview images
Fuzzy Search
Method Search
Smartphone