freeCodeCamp / freeCodeCamp/devdocs
Filter documentation via a query parameter for better browser interoperability
- Dominant language
- Ruby
- Stars
- 39.5k
- Forks
- 2.6k
- Avg merge
- 4d 32m
- Merged PRs (30d)
- 13
Description
# Feature request
Filter documentation via an optional query parameter
## Summary
DevDocs makes it really easy to filter on a specific set of docs in the UI, which is great. I use this in conjunction with browser site search to pass queries directly to the DevDocs search endpoint to skip landing on the main page first. However, there is one disadvantage: I can't seem to filter the documentation from the search endpoint directly. If want to search for a ruby-specific method from site search, I need to land on the main DevDocs page and filter manually.
[Browsers are embracing custom site search functionality](https://resources.arc.net/en/articles/7183263-site-search-directly-search-any-website) to allow quick access to search endpoints that can be invoked via a shortcut and this has become an important part of my workflow. It would be great to have documentation filtering in the search API to improve the interoperability of DevDocs search.
## Examples
The query endpoint looks like this:
`https://devdocs.io/#q=%s` where `%s` is replaced with my query string
It would be great to be able to do something like this to search only within Ruby 3.1:
`https://devdocs.io/#q=%s&doc=ruby3-1`
Contributor guide
Research direction
Start at the DevDocs query endpoint shown in the issue, https://devdocs.io/#q=%s, and trace how the browser handles the q parameter and documentation filtering. Done means a URL can include doc=ruby3-1 so the search runs only against the requested documentation set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- search, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100