File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
docs/autoapi/templates/python Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 24
24
import sys
25
25
import urllib .parse
26
26
import time
27
+ from collections import defaultdict
27
28
28
29
from sphinx .transforms import SphinxTransform
29
30
from docutils import nodes
47
48
48
49
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
49
50
modules_support_matrix = shared_bindings_matrix .support_matrix_by_board ()
51
+ modules_support_matrix_reverse = defaultdict (list )
52
+ for board , modules in modules_support_matrix .items ():
53
+ for module in modules :
54
+ modules_support_matrix_reverse [module ].append (board )
55
+ modules_support_matrix_reverse = dict ((module , sorted (boards )) for module , boards in modules_support_matrix_reverse .items ())
50
56
51
57
html_context = {
52
- 'support_matrix' : modules_support_matrix
58
+ 'support_matrix' : modules_support_matrix ,
59
+ 'support_matrix_reverse' : modules_support_matrix_reverse
53
60
}
54
61
55
62
# -- General configuration ------------------------------------------------
94
101
autoapi_python_class_content = "both"
95
102
autoapi_python_use_implicit_namespaces = True
96
103
autoapi_root = "shared-bindings"
104
+ def autoapi_prepare_jinja_env (jinja_env ):
105
+ jinja_env .globals ['support_matrix_reverse' ] = modules_support_matrix_reverse
97
106
98
107
redirects_file = 'docs/redirects.txt'
99
108
Original file line number Diff line number Diff line change 14
14
15
15
{% endif %}
16
16
17
+ {% if support_matrix_reverse[obj.name] is defined %}
18
+ .. raw :: html
19
+
20
+ <p >
21
+ <details >
22
+ <summary >Available on these boards</summary >
23
+ <ul >
24
+ {% for board in support_matrix_reverse[obj.name] %}
25
+ <li > {{ board }}
26
+ {% endfor %}
27
+ </ul >
28
+ </details >
29
+ </p >
30
+
31
+ {% endif %}
32
+
17
33
{% block subpackages %}
18
34
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
19
35
{% if visible_subpackages %}
You can’t perform that action at this time.
0 commit comments