Skip to content

Commit 6a24992

Browse files
committed
render the board support list within the docs of os.getenv
1 parent 9593ec4 commit 6a24992

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

shared-bindings/os/__init__.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
//| """functions that an OS normally provides
4242
//|
4343
//| |see_cpython_module| :mod:`cpython:os`.
44+
//|
45+
//| .. jinja
4446
//| """
4547
//|
4648
//| import typing
@@ -88,7 +90,24 @@ MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd);
8890
//| def getenv(key: str, default: Optional[str] = None) -> Optional[str]:
8991
//| """Get the environment variable value for the given key or return ``default``.
9092
//|
91-
//| This may load values from disk so cache the result instead of calling this often."""
93+
//| This may load values from disk so cache the result instead of calling this often.
94+
//|
95+
//| On boards that do not support ``settings.toml`` reading in the core, this function will raise NotImplementedError.
96+
//|
97+
//| .. raw:: html
98+
//|
99+
//| <p>
100+
//| <details>
101+
//| <summary>Available on these boards</summary>
102+
//| <ul>
103+
//| {% for board in support_matrix_reverse["os.getenv"] %}
104+
//| <li> {{ board }}
105+
//| {% endfor %}
106+
//| </ul>
107+
//| </details>
108+
//| </p>
109+
//|
110+
//| """
92111
//| ...
93112
//|
94113
STATIC mp_obj_t os_getenv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {

0 commit comments

Comments
 (0)