[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
|
|
|
docsearch({
|
|
|
|
apiKey: '6c42f30d9669d8e42f6fc92f44028596',
|
|
|
|
indexName: 'docs-ray',
|
|
|
|
appId: 'LBHF0PABBL',
|
|
|
|
inputSelector: '#search-input',
|
|
|
|
debug: false,
|
2022-05-12 19:00:35 +02:00
|
|
|
algoliaOptions: {
|
|
|
|
hitsPerPage: 10,
|
|
|
|
},
|
|
|
|
handleSelected: function (input, event, suggestion, datasetNumber, context) {
|
|
|
|
if (context.selectionMethod === 'click') {
|
|
|
|
input.setVal('');
|
|
|
|
const windowReference = window.open(suggestion.url, "_self");
|
|
|
|
windowReference.focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const searchInput = document.getElementById("search-input");
|
|
|
|
searchInput.addEventListener("keydown", function (e) {
|
|
|
|
if (e.code === "Enter") {
|
|
|
|
var searchForm = document.getElementsByClassName("bd-search")[0];
|
|
|
|
|
|
|
|
const text = searchInput.value;
|
2022-05-17 14:22:53 +02:00
|
|
|
searchForm.action = "https://docs.ray.io/en/latest/search.html?q=" + text;
|
2022-05-12 19:00:35 +02:00
|
|
|
|
|
|
|
searchForm.submit();
|
|
|
|
}
|
|
|
|
});
|