Skip to content

Commit 11df85b

Browse files
authored
Hide versions and show languages by default. (#212)
Signed-off-by: Tao He <[email protected]>
1 parent 4853cc3 commit 11df85b

File tree

3 files changed

+206
-2
lines changed

3 files changed

+206
-2
lines changed

docs/_templates/css/custom.css

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
@media print {
2+
.rst-languages,
3+
footer,
4+
.wy-nav-side {
5+
display: none
6+
}
7+
.wy-nav-content-wrap {
8+
margin-left: 0
9+
}
10+
}
11+
12+
.rst-versions {
13+
bottom: 128px !important;
14+
}
15+
16+
.rst-languages {
17+
height: 128px !important;
18+
}
19+
20+
.rst-languages {
21+
position: fixed;
22+
bottom: 0;
23+
left: 0;
24+
width: 300px;
25+
color: #fcfcfc;
26+
background: #1f1d1d;
27+
font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
28+
z-index: 400
29+
}
30+
31+
.rst-languages a {
32+
color: #2980B9;
33+
text-decoration: none
34+
}
35+
36+
.rst-languages .rst-badge-small {
37+
display: none
38+
}
39+
40+
.rst-languages .rst-current-language {
41+
padding: 12px;
42+
background-color: #272525;
43+
display: block;
44+
text-align: right;
45+
font-size: 90%;
46+
cursor: pointer;
47+
color: #27AE60;
48+
*zoom: 1
49+
}
50+
51+
.rst-languages .rst-current-language:before,
52+
.rst-languages .rst-current-language:after {
53+
display: table;
54+
content: ""
55+
}
56+
57+
.rst-languages .rst-current-language:after {
58+
clear: both
59+
}
60+
61+
.rst-languages .rst-current-language .fa,
62+
.rst-languages .rst-current-language .wy-menu-vertical li span.toctree-expand,
63+
.wy-menu-vertical li .rst-languages .rst-current-language span.toctree-expand,
64+
.rst-languages .rst-current-language .rst-content .admonition-title,
65+
.rst-content .rst-languages .rst-current-language .admonition-title,
66+
.rst-languages .rst-current-language .rst-content h1 .headerlink,
67+
.rst-content h1 .rst-languages .rst-current-language .headerlink,
68+
.rst-languages .rst-current-language .rst-content h2 .headerlink,
69+
.rst-content h2 .rst-languages .rst-current-language .headerlink,
70+
.rst-languages .rst-current-language .rst-content h3 .headerlink,
71+
.rst-content h3 .rst-languages .rst-current-language .headerlink,
72+
.rst-languages .rst-current-language .rst-content h4 .headerlink,
73+
.rst-content h4 .rst-languages .rst-current-language .headerlink,
74+
.rst-languages .rst-current-language .rst-content h5 .headerlink,
75+
.rst-content h5 .rst-languages .rst-current-language .headerlink,
76+
.rst-languages .rst-current-language .rst-content h6 .headerlink,
77+
.rst-content h6 .rst-languages .rst-current-language .headerlink,
78+
.rst-languages .rst-current-language .rst-content dl dt .headerlink,
79+
.rst-content dl dt .rst-languages .rst-current-language .headerlink,
80+
.rst-languages .rst-current-language .rst-content p.caption .headerlink,
81+
.rst-content p.caption .rst-languages .rst-current-language .headerlink,
82+
.rst-languages .rst-current-language .rst-content table>caption .headerlink,
83+
.rst-content table>caption .rst-languages .rst-current-language .headerlink,
84+
.rst-languages .rst-current-language .rst-content tt.download span:first-child,
85+
.rst-content tt.download .rst-languages .rst-current-language span:first-child,
86+
.rst-languages .rst-current-language .rst-content code.download span:first-child,
87+
.rst-content code.download .rst-languages .rst-current-language span:first-child,
88+
.rst-languages .rst-current-language .icon {
89+
color: #fcfcfc
90+
}
91+
92+
.rst-languages .rst-current-language .fa-book,
93+
.rst-languages .rst-current-language .icon-book {
94+
float: left
95+
}
96+
97+
.rst-languages .rst-current-language .icon-book {
98+
float: left
99+
}
100+
101+
.rst-languages .rst-current-language.rst-out-of-date {
102+
background-color: #E74C3C;
103+
color: #fff
104+
}
105+
106+
.rst-languages .rst-current-language.rst-active-old-language {
107+
background-color: #F1C40F;
108+
color: #000
109+
}
110+
111+
.rst-languages.shift-up {
112+
height: auto;
113+
max-height: 100%
114+
}
115+
116+
.rst-languages.shift-up .rst-other-languages {
117+
display: block
118+
}
119+
120+
.rst-languages .rst-other-languages {
121+
font-size: 90%;
122+
padding: 12px;
123+
color: gray;
124+
display: none
125+
}
126+
127+
.rst-languages .rst-other-languages hr {
128+
display: block;
129+
height: 1px;
130+
border: 0;
131+
margin: 20px 0;
132+
padding: 0;
133+
border-top: solid 1px #413d3d
134+
}
135+
136+
.rst-languages .rst-other-languages dd {
137+
display: inline-block;
138+
margin: 0
139+
}
140+
141+
.rst-languages .rst-other-languages dd a {
142+
display: inline-block;
143+
padding: 6px;
144+
color: #fcfcfc
145+
}
146+
147+
.rst-languages.rst-badge {
148+
width: auto;
149+
bottom: 20px;
150+
right: 20px;
151+
left: auto;
152+
border: none;
153+
max-width: 300px
154+
}
155+
156+
.rst-languages.rst-badge .icon-book {
157+
float: none
158+
}
159+
160+
.rst-languages.rst-badge .fa-book,
161+
.rst-languages.rst-badge .icon-book {
162+
float: none
163+
}
164+
165+
.rst-languages.rst-badge.shift-up .rst-current-language {
166+
text-align: right
167+
}
168+
169+
.rst-languages.rst-badge.shift-up .rst-current-language .fa-book,
170+
.rst-languages.rst-badge.shift-up .rst-current-language .icon-book {
171+
float: left
172+
}
173+
174+
.rst-languages.rst-badge.shift-up .rst-current-language .icon-book {
175+
float: left
176+
}
177+
178+
.rst-languages.rst-badge .rst-current-language {
179+
width: auto;
180+
height: 30px;
181+
line-height: 30px;
182+
padding: 0 6px;
183+
display: block;
184+
text-align: center
185+
}
186+
187+
@media screen and (max-width: 768px) {
188+
.rst-languages {
189+
width: 85%;
190+
display: none
191+
}
192+
.rst-languages.shift {
193+
display: block
194+
}
195+
}

docs/_templates/layout.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{% block footer %}
4242
{{ footer }}
4343

44-
<div class="rst-versions shift-up" data-toggle="rst-versions" role="note" aria-label="versions">
44+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
4545
<span class="rst-current-version" data-toggle="rst-current-version">
4646
<span class="fa fa-book"> Read the Docs</span>
4747
v: {{ version }}
@@ -86,7 +86,11 @@
8686
{% endif %}
8787
{% endfor %}
8888
</dl>
89+
</div>
90+
</div>
8991

92+
<div class="rst-languages shift-up" role="note" aria-label="languages">
93+
<div class="rst-other-languages">
9094
<dl>
9195
<dt>{{ _('Languages') }}</dt>
9296
<dd><a href="{{ pathto('index.html', 1) }}">en</a></dd>

docs/conf.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@
6868
# Add any paths that contain custom static files (such as style sheets) here,
6969
# relative to this directory. They are copied after the builtin static files,
7070
# so a file named "default.css" will overwrite the builtin "default.css".
71-
# html_static_path = ['_static']
71+
72+
# These folders are copied to the documentation's HTML output
73+
html_static_path = ['_templates']
74+
html_css_files = [
75+
'css/custom.css',
76+
]
7277

7378
# generate autosummary pages
7479
autosummary_generate = True

0 commit comments

Comments
 (0)