@@ -72,31 +72,33 @@ def generate_docs_configuration(
7272 source_dir = os .path .curdir
7373
7474 configuration_args = {}
75- for f in (
76- # autodoc/autodoc-pydantic
77- "autodoc_pydantic_model_show_config_summary" ,
78- "autodoc_pydantic_model_show_validator_summary" ,
79- "autodoc_pydantic_model_show_validator_members" ,
80- "autodoc_pydantic_field_list_validators" ,
81- "autodoc_pydantic_field_show_constraints" ,
82- "autodoc_pydantic_model_member_order" ,
83- "autodoc_pydantic_model_show_json" ,
84- "autodoc_pydantic_settings_show_json" ,
85- "autodoc_pydantic_model_show_field_summary" ,
75+ for config_option , default in {
76+ # sphinx generic
77+ "html_theme_options" : {},
78+ "html_static_path" : [],
79+ "html_css_files" : [],
80+ "html_js_files" : [],
81+ "source_suffix" : [],
82+ "exclude_patterns" : [],
83+ "language" : "en" ,
84+ "pygments_style" : "sphinx" ,
8685 # myst/myst-nb
87- "nb_execution_mode" ,
88- "nb_execution_excludepatterns" ,
89- ):
90- default_value = {
91- # autodoc/autodoc-pydantic
92- "autodoc_pydantic_model_member_order" : '"bysource"' ,
93- "autodoc_pydantic_model_show_json" : True ,
94- # myst/myst-nb
95- "nb_execution_excludepatterns" : [],
96- "nb_execution_mode" : "off" ,
97- }.get (f , False )
98- config_value = get_config (section = f"{ f } " )
99- configuration_args [f ] = default_value if config_value is None else config_value
86+ "myst_enable_extensions" : ["colon_fence" ],
87+ "myst_fence_as_directive" : ["mermaid" ],
88+ "nb_execution_mode" : "off" ,
89+ "nb_execution_excludepatterns" : [],
90+ # autodoc/autodoc-pydantic
91+ "autodoc_pydantic_model_show_config_summary" : None ,
92+ "autodoc_pydantic_model_show_validator_summary" : None ,
93+ "autodoc_pydantic_model_show_validator_members" : None ,
94+ "autodoc_pydantic_field_list_validators" : None ,
95+ "autodoc_pydantic_field_show_constraints" : None ,
96+ "autodoc_pydantic_model_member_order" : "bysource" ,
97+ "autodoc_pydantic_model_show_json" : True ,
98+ "autodoc_pydantic_settings_show_json" : None ,
99+ "autodoc_pydantic_model_show_field_summary" : None ,
100+ }.items ():
101+ configuration_args [config_option ] = get_config (section = config_option ) or default
100102 # create a temporary directory to store the conf.py file in
101103 with TemporaryDirectory () as td :
102104 templateEnv = Environment (loader = FileSystemLoader (searchpath = str (Path (__file__ ).parent .resolve ())))
0 commit comments