File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
Templates/default/html/directives Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
<div class =" configuration-block" >
2
- <ul class =" configuration-tabs" >
2
+ <ul class =" configuration-tabs configuration-tabs-length-{{ blocks | length }} " >
3
3
{% for block in blocks %}
4
4
<li data-language =" {{ block .language }}" {{ loop .first ? ' data-active="true"' }}>
5
5
<span >{{ block .language_label }}</span >
Original file line number Diff line number Diff line change @@ -24,10 +24,16 @@ public function getFunctions(): array
24
24
public static function getOptions (array $ toc ): array
25
25
{
26
26
$ flattendToc = self ::flattenToc ($ toc );
27
- $ maxDepth = 0 ;
27
+ // FIXME: this hardcoded '2' value should instead be obtained
28
+ // automatically using the 'maxdepth' option of 'toctree' directive.
29
+ // See https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html
30
+ $ maxDepth = 2 ;
28
31
$ numVisibleItems = 0 ;
29
32
foreach ($ flattendToc as $ tocItem ) {
30
- $ maxDepth = max ($ maxDepth , $ tocItem ['level ' ]);
33
+ if ($ tocItem ['level ' ] > $ maxDepth ) {
34
+ continue ;
35
+ }
36
+
31
37
$ numVisibleItems ++;
32
38
}
33
39
Original file line number Diff line number Diff line change 1
1
< div class ="configuration-block ">
2
- < ul class ="configuration-tabs ">
2
+ < ul class ="configuration-tabs configuration-tabs-length-2 ">
3
3
< li data-language ="yaml " data-active ="true "> < span > YAML</ span > </ li >
4
4
< li data-language ="php " > < span > PHP</ span > </ li >
5
5
</ ul >
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ <h3 id="error-bubbling"><a class="headerlink" href="#error-bubbling" title="Perm
189
189
</ div >
190
190
< p > And configuration blocks:</ p >
191
191
< div class ="configuration-block ">
192
- < ul class ="configuration-tabs ">
192
+ < ul class ="configuration-tabs configuration-tabs-length-3 ">
193
193
< li data-language ="yaml " data-active ="true "> < span > YAML</ span > </ li >
194
194
< li data-language ="xml " > < span > XML</ span > </ li >
195
195
< li data-language ="php " > < span > PHP</ span > </ li >
You can’t perform that action at this time.
0 commit comments