2323from urllib import request
2424
2525from mkdocs .config .config_options import Type as MkType
26+ from mkdocs .config .config_options import Dir
2627from mkdocs .plugins import BasePlugin
2728from mkdocs .utils import write_file
2829from mkdocs_autorefs .plugin import AutorefsPlugin
@@ -78,7 +79,7 @@ class MkdocstringsPlugin(BasePlugin):
7879 config_scheme : tuple [tuple [str , MkType ]] = ( # type: ignore[assignment]
7980 ("handlers" , MkType (dict , default = {})),
8081 ("default_handler" , MkType (str , default = "python" )),
81- ("custom_templates" , MkType ( str , default = None )),
82+ ("custom_templates" , Dir ( exists = True , required = False , default = None )),
8283 ("enable_inventory" , MkType (bool , default = None )),
8384 ("enabled" , MkType (bool , default = True )),
8485 )
@@ -90,7 +91,8 @@ class MkdocstringsPlugin(BasePlugin):
9091 - **`handlers`**: Global configuration of handlers. You can set global configuration per handler, applied everywhere,
9192 but overridable in each "autodoc" instruction. Example:
9293 - **`default_handler`**: The default handler to use. The value is the name of the handler module. Default is "python".
93- - **`custom_templates`**: Custom templates to use when rendering API objects.
94+ - **`custom_templates`**: Location of custom templates to use when rendering API objects. Value should be the path of
95+ a directory relative to the mkdocs configuration file.
9496 - **`enable_inventory`**: Whether to enable object inventory creation.
9597 - **`enabled`**: Whether to enable the plugin. Default is true. If false, *mkdocstrings* will not collect or render anything.
9698
0 commit comments