Searching the online documentation with search queries included in the website's URL

When looking up a particular symbol, I see that it’s possible to include the search query in the URL of the documentation section of the website. For example, opening General Symbols – Typst Documentation will show the results for circles. (Notice the ?query=circle at the end of the URL.)

Would it be possible to extend this behaviour to the rest of the Documentation section? So, for example, visiting https://typst.app/docs?query=heading could show the results of pages that match for the query ‘heading’.

My use case is that I use the browser extension called Vimium C, which allows me to look up search queries on websites like search engines, wikis, and programming documentation through shortcuts. For instance, once configured, typing rustdocs format in the extension’s own URL bar and pressing Enter opens the page std - Rust, showing results for ‘format’ in the Rust standard library. (Web browsers based on Firefox and Chromium may already have a feature like this built in, although I’m not familiar with how it works.)

This saves a little time compared to going to the website and then focussing the input field before being able to type the query, which adds up over time.

1 Like

How would you handle q=len?

image

This will only work for unique names.

Maybe I don’t use Vimium to its fullest, but it’s not that hard to gihea<esc>fk to open the heading page. It is, however, a big pain to know which one of many same-name entries to open without hovering the cursor over.

The idea here is that the website shows the search results (like what is seen in your screenshot)—regardless of how many matches there might be—instead of jumping right to the page with documentation (let’s say the length type in this example). This is how other websites I mentioned earlier do it, and I think this is totally acceptable.

I already know about gi (I use it all the time). It’s fine, but… I’m not sure how to describe the difference between the two workflows. The closest I can think of is the context you’re focussing on at the moment.

I realise that for many people, what we have is already good enough. I was just adding a suggestion about a feature that would fit more into my workflow. I also know that my ideal workflow may or may not be the same as yours. So, at the end of the day, even if I’m the only one who finds this idea useful, I’m already grateful for Typst and its online documentation.

I’d like to add that this is not as niche as Vimium, since it would also be beneficial if the typst docs search could be used from a Firefox search keyword. As @maxigaz, I’d expect the result of this to be a list of search results if there’s no unique match.

3 Likes

I would also appreciate the feature. The first use that came to my mind was with DuckDuckGo’s bangs.

1 Like