Skip to content

Commit 4cab02f

Browse files
humitosericholscheragjohnson
authored
Show version/language selectors below the title (#1601)
* Show version/language selectors below the title * Use CSS styles from old attempt #438 * Update CSS to apply to both selectors * Prepend the current version if it's hidden * Split it into two different configs * Use correct value for language * Make the selectors more prominent * Typo fix on comment * Update CSS * Update JavaScript * Always include the version javascript * Only include the languages if there is one * Change `display_version` default * HTML layout rework * Update docs * HTML layout fix * Docs typo * Update CSS * Updates from review * re-compile CSS * Update CSS * Apply suggestions from code review Co-authored-by: Eric Holscher <[email protected]> * Use the prettier to lint the file * Whitespaces * Update event listener * Update CSS * Update CSS * Remove language switch if there are not translations * Tune version and language selector styles (#1603) * Tuning on select width and icon placement * Use better cursor * Add a max width to selects so that they can't overflow * Only add after pseudo element if select exists * Lint * Debug: trigger Read the Docs Addons event to test/debug locally (#1606) * Debug: trigger Read the Docs Addons event to test/debug locally Closes #1605 * Push missing file --------- Co-authored-by: Eric Holscher <[email protected]> Co-authored-by: Anthony <[email protected]>
1 parent 9c75444 commit 4cab02f

File tree

10 files changed

+629
-122
lines changed

10 files changed

+629
-122
lines changed

Diff for: docs/_static/addons.mocked.json

+369
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,369 @@
1+
{
2+
"addons": {
3+
"analytics": {
4+
"code": null,
5+
"enabled": true
6+
},
7+
"ethicalads": {
8+
"ad_free": false,
9+
"campaign_types": [
10+
"community",
11+
"house",
12+
"paid"
13+
],
14+
"enabled": true,
15+
"keywords": [
16+
"only words"
17+
],
18+
"publisher": "readthedocs"
19+
},
20+
"external_version_warning": {
21+
"enabled": true
22+
},
23+
"flyout": {
24+
"enabled": true
25+
},
26+
"hotkeys": {
27+
"doc_diff": {
28+
"enabled": true,
29+
"trigger": "KeyD"
30+
},
31+
"enabled": true,
32+
"search": {
33+
"enabled": true,
34+
"trigger": "Slash"
35+
}
36+
},
37+
"non_latest_version_warning": {
38+
"enabled": true
39+
},
40+
"search": {
41+
"default_filter": "project:sphinx-rtd-theme/stable",
42+
"enabled": true,
43+
"filters": [
44+
[
45+
"Include subprojects",
46+
"subprojects:sphinx-rtd-theme/stable"
47+
]
48+
]
49+
}
50+
},
51+
"api_version": "1",
52+
"builds": {
53+
"current": {
54+
"commit": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
55+
"created": "2023-11-28T04:14:06.510677Z",
56+
"duration": 42,
57+
"error": "",
58+
"finished": "2023-11-28T04:14:48.510Z",
59+
"id": 22677856,
60+
"project": "sphinx-rtd-theme",
61+
"state": {
62+
"code": "finished",
63+
"name": "Finished"
64+
},
65+
"success": true,
66+
"urls": {
67+
"build": "https://readthedocs.org/projects/sphinx-rtd-theme/builds/22677856/",
68+
"project": "https://readthedocs.org/projects/sphinx-rtd-theme/",
69+
"version": "https://readthedocs.org/projects/sphinx-rtd-theme/version/stable/edit/"
70+
},
71+
"version": "stable"
72+
}
73+
},
74+
"domains": {
75+
"dashboard": "readthedocs.org"
76+
},
77+
"projects": {
78+
"current": {
79+
"created": "2017-12-21T04:04:42.561793Z",
80+
"default_branch": "master",
81+
"default_version": "stable",
82+
"external_builds_privacy_level": "public",
83+
"homepage": null,
84+
"id": 170010,
85+
"language": {
86+
"code": "en",
87+
"name": "English"
88+
},
89+
"modified": "2021-03-16T17:13:52.465051Z",
90+
"name": "sphinx_rtd_theme",
91+
"privacy_level": "public",
92+
"programming_language": {
93+
"code": "words",
94+
"name": "Only Words"
95+
},
96+
"repository": {
97+
"type": "git",
98+
"url": "https://github.com/readthedocs/sphinx_rtd_theme"
99+
},
100+
"single_version": false,
101+
"slug": "sphinx-rtd-theme",
102+
"subproject_of": null,
103+
"tags": [],
104+
"translation_of": null,
105+
"urls": {
106+
"builds": "https://readthedocs.org/projects/sphinx-rtd-theme/builds/",
107+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/stable/",
108+
"downloads": "https://readthedocs.org/projects/sphinx-rtd-theme/downloads/",
109+
"home": "https://readthedocs.org/projects/sphinx-rtd-theme/",
110+
"versions": "https://readthedocs.org/projects/sphinx-rtd-theme/versions/"
111+
},
112+
"users": [
113+
{
114+
"username": "eric"
115+
},
116+
{
117+
"username": "humitos"
118+
},
119+
{
120+
"username": "agj"
121+
}
122+
],
123+
"versioning_scheme": "multiple_versions_with_translations"
124+
},
125+
"translations": []
126+
},
127+
"readthedocs": {
128+
"analytics": {
129+
"code": null
130+
}
131+
},
132+
"versions": {
133+
"active": [
134+
{
135+
"active": true,
136+
"aliases": [],
137+
"built": true,
138+
"downloads": {},
139+
"hidden": false,
140+
"id": 6692534,
141+
"identifier": "b07560bf97dad3a4266f6145bd4b662ac708ab00",
142+
"privacy_level": "public",
143+
"ref": null,
144+
"slug": "0.5.2",
145+
"type": "tag",
146+
"urls": {
147+
"dashboard": {
148+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/0.5.2/edit/"
149+
},
150+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/0.5.2/",
151+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/0.5.2/"
152+
},
153+
"verbose_name": "0.5.2"
154+
},
155+
{
156+
"active": true,
157+
"aliases": [],
158+
"built": true,
159+
"downloads": {},
160+
"hidden": false,
161+
"id": 7273098,
162+
"identifier": "c9b1bde560d8ee31400e4e4f92f2e8d7a42265ce",
163+
"privacy_level": "public",
164+
"ref": null,
165+
"slug": "1.0.0",
166+
"type": "tag",
167+
"urls": {
168+
"dashboard": {
169+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/1.0.0/edit/"
170+
},
171+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/1.0.0/",
172+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/1.0.0/"
173+
},
174+
"verbose_name": "1.0.0"
175+
},
176+
{
177+
"active": true,
178+
"aliases": [],
179+
"built": true,
180+
"downloads": {},
181+
"hidden": false,
182+
"id": 10496721,
183+
"identifier": "f854c890e1445b99a43ac5f10463a5df83739a2e",
184+
"privacy_level": "public",
185+
"ref": null,
186+
"slug": "1.1.1",
187+
"type": "tag",
188+
"urls": {
189+
"dashboard": {
190+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/1.1.1/edit/"
191+
},
192+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/1.1.1/",
193+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/1.1.1/"
194+
},
195+
"verbose_name": "1.1.1"
196+
},
197+
{
198+
"active": true,
199+
"aliases": [],
200+
"built": true,
201+
"downloads": {},
202+
"hidden": false,
203+
"id": 16340532,
204+
"identifier": "9899ee4ee2f547f81e51297dc12317f018e62fdd",
205+
"privacy_level": "public",
206+
"ref": null,
207+
"slug": "1.2.2",
208+
"type": "tag",
209+
"urls": {
210+
"dashboard": {
211+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/1.2.2/edit/"
212+
},
213+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/1.2.2/",
214+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/1.2.2/"
215+
},
216+
"verbose_name": "1.2.2"
217+
},
218+
{
219+
"active": true,
220+
"aliases": [],
221+
"built": true,
222+
"downloads": {},
223+
"hidden": false,
224+
"id": 17681643,
225+
"identifier": "15ed4de08de55f7066ff4f2ac39883a397db30d3",
226+
"privacy_level": "public",
227+
"ref": null,
228+
"slug": "1.3.0",
229+
"type": "tag",
230+
"urls": {
231+
"dashboard": {
232+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/1.3.0/edit/"
233+
},
234+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/1.3.0/",
235+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/1.3.0/"
236+
},
237+
"verbose_name": "1.3.0"
238+
},
239+
{
240+
"active": true,
241+
"aliases": [],
242+
"built": true,
243+
"downloads": {},
244+
"hidden": false,
245+
"id": 18862205,
246+
"identifier": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
247+
"privacy_level": "public",
248+
"ref": null,
249+
"slug": "2.0.0",
250+
"type": "tag",
251+
"urls": {
252+
"dashboard": {
253+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/2.0.0/edit/"
254+
},
255+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/2.0.0/",
256+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/2.0.0/"
257+
},
258+
"verbose_name": "2.0.0"
259+
},
260+
{
261+
"active": true,
262+
"aliases": [
263+
{
264+
"active": true,
265+
"aliases": [],
266+
"built": true,
267+
"downloads": {},
268+
"hidden": false,
269+
"id": 18862205,
270+
"identifier": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
271+
"privacy_level": "public",
272+
"ref": null,
273+
"slug": "2.0.0",
274+
"type": "tag",
275+
"urls": {
276+
"dashboard": {
277+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/2.0.0/edit/"
278+
},
279+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/2.0.0/",
280+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/2.0.0/"
281+
},
282+
"verbose_name": "2.0.0"
283+
}
284+
],
285+
"built": true,
286+
"downloads": {},
287+
"hidden": false,
288+
"id": 3271725,
289+
"identifier": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
290+
"privacy_level": "public",
291+
"ref": "2.0.0",
292+
"slug": "stable",
293+
"type": "tag",
294+
"urls": {
295+
"dashboard": {
296+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/stable/edit/"
297+
},
298+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/stable/",
299+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/2.0.0/"
300+
},
301+
"verbose_name": "stable"
302+
},
303+
{
304+
"active": true,
305+
"aliases": [],
306+
"built": true,
307+
"downloads": {},
308+
"hidden": false,
309+
"id": 3271688,
310+
"identifier": "master",
311+
"privacy_level": "public",
312+
"ref": null,
313+
"slug": "latest",
314+
"type": "branch",
315+
"urls": {
316+
"dashboard": {
317+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/latest/edit/"
318+
},
319+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/latest/",
320+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/master/"
321+
},
322+
"verbose_name": "latest"
323+
}
324+
],
325+
"current": {
326+
"active": true,
327+
"aliases": [
328+
{
329+
"active": true,
330+
"aliases": [],
331+
"built": true,
332+
"downloads": {},
333+
"hidden": false,
334+
"id": 18862205,
335+
"identifier": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
336+
"privacy_level": "public",
337+
"ref": null,
338+
"slug": "2.0.0",
339+
"type": "tag",
340+
"urls": {
341+
"dashboard": {
342+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/2.0.0/edit/"
343+
},
344+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/2.0.0/",
345+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/2.0.0/"
346+
},
347+
"verbose_name": "2.0.0"
348+
}
349+
],
350+
"built": true,
351+
"downloads": {},
352+
"hidden": false,
353+
"id": 3271725,
354+
"identifier": "7c9b1b5d391f6d7fae72274393eb25d1df96e546",
355+
"privacy_level": "public",
356+
"ref": "2.0.0",
357+
"slug": "stable",
358+
"type": "tag",
359+
"urls": {
360+
"dashboard": {
361+
"edit": "https://readthedocs.org/projects/sphinx-rtd-theme/version/stable/edit/"
362+
},
363+
"documentation": "https://sphinx-rtd-theme.readthedocs.io/en/stable/",
364+
"vcs": "https://github.com/readthedocs/sphinx_rtd_theme/tree/2.0.0/"
365+
},
366+
"verbose_name": "stable"
367+
}
368+
}
369+
}

0 commit comments

Comments
 (0)