-
Notifications
You must be signed in to change notification settings - Fork 48
Search
Oliver Beckstein edited this page Oct 7, 2021
·
20 revisions
The search functionality is provided by algolia and is known as algolia DocSearch
We are using the hosted search option where Algolia runs the docsearch-scraper.
-
Experience and advice for dealing with indexing of code in software documentation?: indexing
pre
andcode
tags? Advice: don't but you could add selectors for valuable occurences (but we cannot easily do it in sphinx-generated docs).
One can run the scraper by oneself and then serve that index. That's also recommended for debugging. If we do this, here are links to get started:
For details, look through the issue comments
To change the configuration, make a PR against https://github.com/algolia/docsearch-configs/blob/master/configs/mdanalysis.json
The syntax is explained at https://docsearch.algolia.com/docs/config-file/
In order for anything to be indexed it must match one of the selectors
- levels are mapped to heading tags
- text is mapped to p, li, and similar tags
- examine the produced documentation with the Firefox Web Developer Tool or similar to see which CSS elements apply to the content that should be indexed
Example selectors
selectors": {
"lvl0": "[itemprop='articleBody'] > .section h1, .page h1, .post h1, .body > .section h1",
"lvl1": "[itemprop='articleBody'] > .section h2, .page h2, .post h2, .body > .section h2",
"lvl2": "[itemprop='articleBody'] > .section h3, .page h3, .post h3, .body > .section h3",
"lvl3": "[itemprop='articleBody'] > .section h4, .page h4, .post h4, .body > .section h4",
"lvl4": "[itemprop='articleBody'] > .section h5, .page h5, .post h5, .body > .section h5",
"text": "[itemprop='articleBody'] > .section p, .page p, .post p, .body > .section p, [itemprop='articleBody'] > .section li, .page li, .post li, .body > .section li"
},
- sitemap.org protocol definition (defines sitemap)
- validators
Please:
- provide enough information so that others can review your pull request.
- double check the dedicated documentation available here
- try to implement the recommendations
- please feature a sitemap, it will be the most complete source of truth for our crawling.
- Allow edits from maintainer