-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix #5021: add docSearch to coffeescript doc #5035
Conversation
Looks like some unrelated changes to the docs snuck into the commit as well? |
Only the update of The |
I'm wondering about the "this list may be incomplete", and "when compiling folders or globs" bits, as seen in the diff... |
Happy to explain every changes. |
ah ok I see your points. It only a new line introduced. I can change it if needed |
@jashkenas The text changes were introduced by an earlier PR, that modified the source But some of those changes need to change, because of further discussions about Node’s modules support. In particular I don’t want to mention |
A few things:
We can’t merge this in until the next release, as the docs now mention the exponentiation operator and merged-in object spread, which haven’t been released yet (and merging this in will update the docs immediately). But we can get this PR to be merge-ready, and I’ll merge it in along with cutting that release. |
Thank you for the commits
This is solved thanks to 2647023
You can override the colours. Would you like to change the blue into your theme's colour? Feel free to ping me and explaining what you would like to achieve.
It could be possible but it is not possible to scrap code since it introduce a lot of noise. Furthermore the meanings of words isn't always the same as plain text.
We can integrate it to the current version if you want. Just point me the right commit. Happy to help |
Happy to help in order to merge it :) |
I’m not sure what you mean by this. I don’t mean that code blocks should be indexed; just that inline code, like The words “import” and “export” should be rendered in monospace with a light solid background, similar to how GitHub renders inline code blocks between backticks: It’s just the HTML |
👋 I meant that we do not scrap and extract the cotent of Let us know if you still want us to find a way to have this kind of rendering. |
…bile vs desktop layouts; use our colors
Okay, I’ve styled this, including making it look good (I hope) on both desktop and mobile: @s-pace, one thing that doesn’t look so good is that we have a lot of repetition in search categories/headings/titles: I figured out the CSS to remove the left column (the muted text) but then it looks even weirder, as each category matches each heading most of the time. Is there a good way to deal with this? Also I see that in https://github.com/algolia/docsearch-configs/blob/master/configs/coffeescript.json, the base URL is |
Thank you fo the details Regarding the duplicates, it is mainly coming from your structure. Feel free to PR your config, we can index both versions and use cheers |
@s-pace I’m not sure I follow. We only want the current docs indexed, but I want the canonical URLs presented to users (so no When you say the duplicates are coming from our structure, how is that? In the example above, “Functions” is under “Language Reference”. See the tree in the sidebar. We use |
My bad, I got it. Check the changes, it is live. LMK WDYT |
The changelog part wasn't consistent but I have fixed it 👇 LMK WDYT |
That looks better, thanks: Though wouldn’t it be better if I just changed the HTML structure so that the special casing for the changelog is unnecessary? Since I can’t trigger a reindex it’s hard to know what it should be. I guess I should remove the left column, since we only have two levels of headings and not three, so there’s duplication in the two columns of suggestions. I can do that via CSS unless there’s a better way. |
Since there isn't enough depth in the level we can't change it so if you want you can use the CSS. As for the changes you have made. I am not such they are live because I have the same outcome with the older version. Let's continue with the lates one. Let me know if you need anything else. |
@GeoffreyBooth — feel free to make the final decision here, but I think I should go on the record again expressing my mild-to-moderate opposition to this search upgrade. With this change, every keystroke someone types into CoffeeScript's search box is sent to Algolia's search servers ... an entirely unnecessary invasion of privacy, given that all of the content is present on the page itself. If we were just using a local, JS, opensource library, or even Algolia's offline version, I'd feel a lot better about this. |
I didn’t know there was an offline version. I would be fine with that. What I like about a search box in general (over Cmd/Ctrl-F) is some level of relevancy intelligence, so that a search for “class” will show suggestions weighted by things like a heading of “Classes” rather than just always jumping to the first appearance of the word “class” on the page. If there’s a fully client-side solution that can achieve that, that would be worth exploring. I don’t think anyone who types into a search input expects their input to not be sent to a server. If they wanted that level of privacy, they would use Cmd/Ctrl-F. |
Hi @jashkenas Thank you for sharing your concern. Privacy is something we also take very seriously at Algolia. While searches are gonna be proceeded by our servers, we of course don't track end users with any cookie and/or retargeting strategy. You can read more about our privacy policy. Security is key for a SAAS company like us and we heavily invest in it. You can check our achievements in these regards. |
I'm a bit sensitive to this issue because of current events. The privacy policy:
That's all well and good, normally. But in this case, because there's no technical reason why we need to be sharing searches with remote servers — all of the content is present on the page (intentionally!) — it makes me uncomfortable. |
@jashkenas See https://medium.com/dev-channel/how-to-add-full-text-search-to-your-website-4e9c80ce2bf4 It looks like lunr.js or elasticlunr.js can do full text search entirely client-side. We would generate the search index ahead of time when we generate the docs. |
@zdenko is there one you’ve used that you recommend? |
@GeoffreyBooth I've used Fuse once or twice before. And, "search-index" looks like a good candidate too. |
@zdenko I’ve already placed and styled the search input on this branch, so you probably want to start from this branch. The search input is separate from Algolia/docSearch, so it would be easy to preserve while removing docSearch. |
P.S. I like the idea of having the search index generated ahead of time during |
Yes, search index should be definitely generated during |
Thanks for explaining all your concerns and we do understand them. We can close this PR as coffeescript documentation move forward with a pure frontend solution. Thanks again for considering the PR! Happy to help if needed |
Adding the DocSearch experience. We do provide analytics on the search, feel free to ping.