Merge pull request #5054 from jepler/rmatrix
docs: Add list of supported board to each module's page
This commit is contained in:
commit
84ddb17c78
11
conf.py
11
conf.py
@ -24,6 +24,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import time
|
import time
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
from sphinx.transforms import SphinxTransform
|
from sphinx.transforms import SphinxTransform
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
@ -47,9 +48,15 @@ subprocess.check_output(["make", "stubs"])
|
|||||||
|
|
||||||
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
|
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
|
||||||
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
|
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
|
||||||
|
modules_support_matrix_reverse = defaultdict(list)
|
||||||
|
for board, modules in modules_support_matrix.items():
|
||||||
|
for module in modules:
|
||||||
|
modules_support_matrix_reverse[module].append(board)
|
||||||
|
modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items())
|
||||||
|
|
||||||
html_context = {
|
html_context = {
|
||||||
'support_matrix': modules_support_matrix
|
'support_matrix': modules_support_matrix,
|
||||||
|
'support_matrix_reverse': modules_support_matrix_reverse
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
@ -94,6 +101,8 @@ autoapi_template_dir = 'docs/autoapi/templates'
|
|||||||
autoapi_python_class_content = "both"
|
autoapi_python_class_content = "both"
|
||||||
autoapi_python_use_implicit_namespaces = True
|
autoapi_python_use_implicit_namespaces = True
|
||||||
autoapi_root = "shared-bindings"
|
autoapi_root = "shared-bindings"
|
||||||
|
def autoapi_prepare_jinja_env(jinja_env):
|
||||||
|
jinja_env.globals['support_matrix_reverse'] = modules_support_matrix_reverse
|
||||||
|
|
||||||
redirects_file = 'docs/redirects.txt'
|
redirects_file = 'docs/redirects.txt'
|
||||||
|
|
||||||
|
@ -14,6 +14,22 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if support_matrix_reverse[obj.name] is defined %}
|
||||||
|
.. raw:: html
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<details>
|
||||||
|
<summary>Available on these boards</summary>
|
||||||
|
<ul>
|
||||||
|
{% for board in support_matrix_reverse[obj.name] %}
|
||||||
|
<li> {{ board }}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block subpackages %}
|
{% block subpackages %}
|
||||||
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
|
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
|
||||||
{% if visible_subpackages %}
|
{% if visible_subpackages %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user