Skip to content

Commit dcd5145

Browse files
humitosagjohnson
andauthored
Search: use Lit WebComponents (#38)
I'm following the pattern from #37 by myself to test out the framework and start to feel more comfortable. --------- Co-authored-by: Anthony Johnson <[email protected]>
1 parent 5fa03a3 commit dcd5145

File tree

6 files changed

+569
-835
lines changed

6 files changed

+569
-835
lines changed

dist/readthedocs-client.js

+17-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/_/readthedocs-config.json

+16
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@
9595
"branch": "main",
9696
"filepath": "/examples/sphinx/docs/index.rst"
9797
}
98+
},
99+
"search": {
100+
"project": "example",
101+
"version": "latest",
102+
"api_endpoint": "/_/api/v3/search/",
103+
"filters": [
104+
[
105+
"Search only in this project",
106+
"project:example/latest"
107+
],
108+
[
109+
"Search subprojects",
110+
"subprojects:example/latest"
111+
]
112+
],
113+
"default_filter": "subprojects:example/latest"
98114
}
99115
}
100116
}

src/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getReadTheDocsConfig } from "./readthedocs-config";
22
import * as notification from "./notification";
33
import * as analytics from "./analytics";
4+
import * as search from "./search";
45
import { domReady, isReadTheDocsEmbedPresent } from "./utils";
56

67
export function setup() {
@@ -19,6 +20,7 @@ export function setup() {
1920
const addons = [
2021
notification.NotificationAddon,
2122
analytics.AnalyticsAddon,
23+
search.SearchAddon,
2224
];
2325

2426
for (const addon of addons) {

0 commit comments

Comments
 (0)