File tree Expand file tree Collapse file tree 3 files changed +59
-34
lines changed Expand file tree Collapse file tree 3 files changed +59
-34
lines changed Original file line number Diff line number Diff line change @@ -111,19 +111,6 @@ h3.plumbing {
111
111
& #reference-languages-trigger {
112
112
float : right ;
113
113
}
114
-
115
- // Ensure the TOC trigger floats right like topics/languages
116
- & #reference-toc-trigger {
117
- float : right ;
118
- }
119
- }
120
-
121
- // Place the "last updated" span inline next to the left-floating versions trigger
122
- > span .light {
123
- display : inline-block ;
124
- clear : none ;
125
- margin-left : 6px ;
126
- vertical-align : middle ;
127
114
}
128
115
}
129
116
@@ -226,25 +213,65 @@ h3.plumbing {
226
213
}
227
214
}
228
215
229
- // Position the Table of Contents dropdown under the right-floated TOC trigger
230
- #toc-dropdown {
231
- width : 300px ;
232
- right : 12px ;
233
- padding : 12px ;
234
- font-weight : normal ;
235
- line-height : 1 ;
216
+ // New inline TOC box styles
217
+ .toc-box {
218
+ float : right ;
219
+ width : 200px ;
220
+ margin : 0 0 15px 20px ;
221
+ padding : 10px 12px ;
222
+ font-size : 13px ;
223
+ background-color : var (--callout-color );
224
+ border : 1px solid var (--base-border-color );
225
+ @include border-radius (3px );
236
226
237
- ul {
227
+ .toc-box-header {
228
+ font-weight : bold ;
229
+ margin-bottom : 8px ;
230
+ }
231
+
232
+ .toc-list {
238
233
margin : 0 ;
234
+ padding-left : 18px ;
235
+ list-style : disc ;
239
236
}
240
237
241
- li {
238
+ .toc-list li {
239
+ margin : 2px 0 ;
242
240
line-height : $base-line-height * 0.8 ;
243
241
}
244
242
245
- a {
243
+ .toc-list a {
246
244
font-weight : normal ;
247
- padding : 0 ;
245
+ }
246
+ }
247
+
248
+ // Ensure content can flow around the TOC naturally
249
+ #documentation #main {
250
+ .sectionbody {
251
+ overflow : visible ;
252
+ }
253
+
254
+ .verseblock {
255
+ overflow : visible ;
256
+
257
+ .content {
258
+ overflow : visible ;
259
+
260
+ pre {
261
+ overflow : visible ;
262
+ white-space : pre-wrap ;
263
+ }
264
+ }
265
+ }
266
+ }
267
+
268
+ // Stack TOC box full-width on small screens
269
+ @media (max-width : $mobile-m ) {
270
+ .toc-box {
271
+ float : none ;
272
+ width : 80% ;
273
+ max-width : none ;
274
+ margin-right : 0 ;
248
275
}
249
276
}
250
277
Original file line number Diff line number Diff line change @@ -123,7 +123,6 @@ <h1>{{ .Params.book.section.cs_number }} {{ .Params.book.chapter.title }} - {{ .
123
123
< div id ='reference-version '>
124
124
{{ partial "ref/languages.html" . }}
125
125
{{ partial "ref/topics.html" . }}
126
- {{ partial "ref/toc.html" . }}
127
126
{{ partial "ref/versions.html" . }}
128
127
</ div >
129
128
@@ -136,6 +135,7 @@ <h2>This information is specific to the Git project</h2>
136
135
< p > Please note that this information is only relevant to you if you plan on < a href ="{{ relURL "community#contributing " }}"> contributing to the Git project itself</ a > . It is in no shape or form required reading for regular Git users.</ p >
137
136
</ div >
138
137
{{ end }}
138
+ {{ partial "ref/toc.html" . }}
139
139
{{ .Content }}
140
140
{{ $match := findRESubmatch "(?s)> NAME</ h2 > .*?< p [^ > ]*> (git-)?([^ ]+)" .Content 1 }}
141
141
{{ if (eq ($match | len) 1) }}
Original file line number Diff line number Diff line change 1
1
{{ $headings := .Params.headings }}
2
2
{{ if $headings }}
3
- < a class ="dropdown-trigger " id ="reference-toc-trigger " data-panel-id ="toc-dropdown " href ="# "> Table of Contents ▾</ a >
4
- < div class ='dropdown-panel right ' id ='toc-dropdown '>
5
- < div >
6
- < ul class ="toc ">
7
- {{ range $i, $item := $headings }}
8
- < li > < a href ="#{{ .id }} "> {{ .text }}</ a > </ li >
9
- {{ end }}
10
- </ ul >
11
- </ div >
3
+ < div id ='toc-box ' class ='toc-box '>
4
+ < div class ='toc-box-header '> Table of Contents</ div >
5
+ < ul class ="toc-list ">
6
+ {{ range $i, $item := $headings }}
7
+ < li > < a href ="#{{ .id }} "> {{ .text }}</ a > </ li >
8
+ {{ end }}
9
+ </ ul >
12
10
</ div >
13
11
{{ end }}
You can’t perform that action at this time.
0 commit comments