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 11<div class =" configuration-block" >
2- <ul class =" configuration-tabs" >
2+ <ul class =" configuration-tabs configuration-tabs-length-{{ blocks | length }} " >
33 {% for block in blocks %}
44 <li data-language =" {{ block .language }}" {{ loop .first ? ' data-active="true"' }}>
55 <span >{{ block .language_label }}</span >
Original file line number Diff line number Diff line change @@ -24,10 +24,16 @@ public function getFunctions(): array
2424 public static function getOptions (array $ toc ): array
2525 {
2626 $ 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 ;
2831 $ numVisibleItems = 0 ;
2932 foreach ($ flattendToc as $ tocItem ) {
30- $ maxDepth = max ($ maxDepth , $ tocItem ['level ' ]);
33+ if ($ tocItem ['level ' ] > $ maxDepth ) {
34+ continue ;
35+ }
36+
3137 $ numVisibleItems ++;
3238 }
3339
Original file line number Diff line number Diff line change 11< div class ="configuration-block ">
2- < ul class ="configuration-tabs ">
2+ < ul class ="configuration-tabs configuration-tabs-length-2 ">
33 < li data-language ="yaml " data-active ="true "> < span > YAML</ span > </ li >
44 < li data-language ="php " > < span > PHP</ span > </ li >
55 </ 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
189189</ div >
190190< p > And configuration blocks:</ p >
191191< div class ="configuration-block ">
192- < ul class ="configuration-tabs ">
192+ < ul class ="configuration-tabs configuration-tabs-length-3 ">
193193 < li data-language ="yaml " data-active ="true "> < span > YAML</ span > </ li >
194194 < li data-language ="xml " > < span > XML</ span > </ li >
195195 < li data-language ="php " > < span > PHP</ span > </ li >
You can’t perform that action at this time.
0 commit comments