Repository navigation
doc: Expect nodejs doc site to have an api search feature. #36412
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Dec 6, 2020 As a workaround, you can view the single-page API doc (e.g., https://nodejs.org/dist/latest-v15.x/docs/api/all.html) and use your browser's page search functionality (Cntl-F on Linux/Windows or Command-F on macOS).
Reacted by Benjamin Gruenbaum, Alex Yang, Patrícia de Lima and Gary CryeReacted by cha! and Alex Yang- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Dec 6, 2020 @AliasT feel free to make a pull request!
Finally found https://devdocs.io/node/ by freecodecamp, seems like dash. Great experience.
Would be awesome if officially.I've noticed that React Native uses algolia for search, and the experience is very good. Could Node.js do the same for search?
algolia is a commercial company, and although the open source project is free to use, I'm still concerned about whether this conflicts with Node.js policies.
I'm hoping someone can help me with this, and if algolia can be used, I'm willing to send a Pull Request! @Trott @benjamingr
Reacted by cha! and Pooja D PI don't know about algolia, but if someone wanted to make a tool for this, I'd suggest make it fetch
all.jsonand search for matches there. I'd personally prefer not to rely on a non-open-source software for our docs, and it's certainly doable in a few dozen of lines of JS.Reacted by Benjamin Gruenbaum and Alex Yangalgolia is a commercial company, and although the open source project is free to use, I'm still concerned about whether this conflicts with Node.js policies.
I'm unaware of any policies this would violate, but there is often (understandable) resistance to anything that might ship user information (such as user IP addresses) off to a third party. I'd welcome a pull request, but be prepared for lots of questions. Somewhere, there's a pull request to add RunKit support to the docs and it will give you an idea of the number of questions these sorts of things can raise.
I think this is possible without external tools. We can pre-compute "raw text" to "link" object from all.json, and put the pre-computed object in javascript code.(docs/template.html)
And then we can have a search bar like this:

In each page, search box searches all pages, thus making navigation faster.
One drawback of this approach is that it makes html file bigger, so page loading times may increase.
In another approach we can just pre-compute the object, write it as json file next to all.json, and fetch that small file after page load.
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Apr 4, 2022 There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
