From 3285efa55df8c0c50356fb6e99fb92710c18b129 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 21 May 2025 09:11:18 +0200 Subject: [PATCH] docs: exclude options that are not modules from clan.core submodule index --- docs/nix/render_options/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/nix/render_options/__init__.py b/docs/nix/render_options/__init__.py index ad04b1575..d72322e2a 100644 --- a/docs/nix/render_options/__init__.py +++ b/docs/nix/render_options/__init__.py @@ -307,7 +307,13 @@ def produce_clan_core_docs() -> None: core_outputs[indexfile] = module_header(module_name) + clan_core_descr core_outputs[indexfile] += """!!! info "Submodules"\n""" - for submodule_name, _ in split.items(): + + for submodule_name, split_options in split.items(): + root = options_to_tree(split_options, debug=True) + module = root.suboptions[0] + module_type = module.info.get("type") + if module_type is not None and "submodule" not in module_type: + continue core_outputs[indexfile] += ( f" - [{submodule_name}](./{submodule_name}.md)\n" ) @@ -328,7 +334,6 @@ def produce_clan_core_docs() -> None: print("type", module.info.get("type")) module_type = module.info.get("type") - if module_type is not None and "submodule" not in module_type: outfile = indexfile init_level = 2