From fc68f216edd944a83acfe7814a8d2b68b6caf1e1 Mon Sep 17 00:00:00 2001 From: Dustin Lagoy Date: Tue, 30 Jul 2024 10:15:44 -0700 Subject: [PATCH 1/4] add api-path to project configuration The output api path is now configurable as a part of the project. It also uses the "src-dirs" as a subpath instead of just the project name. --- mkdoxy/plugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkdoxy/plugin.py b/mkdoxy/plugin.py index a005b2d3..7df11fd9 100644 --- a/mkdoxy/plugin.py +++ b/mkdoxy/plugin.py @@ -5,6 +5,7 @@ """ import logging +import os from pathlib import Path, PurePath from mkdocs import exceptions @@ -47,6 +48,7 @@ class MkDoxy(BasePlugin): ("full-doc", config_options.Type(bool, default=True)), ("debug", config_options.Type(bool, default=False)), # ('ignore-errors', config_options.Type(bool, default=False)), + ("api-path", config_options.Type(str, default=".")), ("doxy-cfg", config_options.Type(dict, default={}, required=False)), ("doxy-cfg-file", config_options.Type(str, default="", required=False)), ("template-dir", config_options.Type(str, default="", required=False)), @@ -148,7 +150,9 @@ def tempDir(siteDir: str, tempDir: str, projectName: str) -> str: generatorBase=self.generatorBase[project_name], tempDoxyDir=tempDirApi, siteDir=config["site_dir"], - apiPath=project_name, + apiPath=os.path.join( + project_data.get("api-path", "."), project_data.get("src-dirs") + ), doxygen=self.doxygen[project_name], useDirectoryUrls=config["use_directory_urls"], ) From 2bf9e5bf3496c15e66a21e6eeb15449bdde75a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Andr=C3=BDsek?= Date: Fri, 22 Nov 2024 12:04:14 +0100 Subject: [PATCH 2/4] Use the third option --- mkdoxy/plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mkdoxy/plugin.py b/mkdoxy/plugin.py index 7df11fd9..043d815c 100644 --- a/mkdoxy/plugin.py +++ b/mkdoxy/plugin.py @@ -150,9 +150,7 @@ def tempDir(siteDir: str, tempDir: str, projectName: str) -> str: generatorBase=self.generatorBase[project_name], tempDoxyDir=tempDirApi, siteDir=config["site_dir"], - apiPath=os.path.join( - project_data.get("api-path", "."), project_data.get("src-dirs") - ), + apiPath = project_data.get("api-path", project_name), doxygen=self.doxygen[project_name], useDirectoryUrls=config["use_directory_urls"], ) From 84dcfab338cce793630e6decc941365f06b44356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Andr=C3=BDsek?= Date: Fri, 22 Nov 2024 12:04:53 +0100 Subject: [PATCH 3/4] Remove spaces --- mkdoxy/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdoxy/plugin.py b/mkdoxy/plugin.py index 043d815c..33864124 100644 --- a/mkdoxy/plugin.py +++ b/mkdoxy/plugin.py @@ -150,7 +150,7 @@ def tempDir(siteDir: str, tempDir: str, projectName: str) -> str: generatorBase=self.generatorBase[project_name], tempDoxyDir=tempDirApi, siteDir=config["site_dir"], - apiPath = project_data.get("api-path", project_name), + apiPath=project_data.get("api-path", project_name), doxygen=self.doxygen[project_name], useDirectoryUrls=config["use_directory_urls"], ) From 2762ccd6ebf9341662d88e119aabf99862cb64f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Andr=C3=BDsek?= Date: Fri, 22 Nov 2024 12:07:26 +0100 Subject: [PATCH 4/4] Remove os --- mkdoxy/plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdoxy/plugin.py b/mkdoxy/plugin.py index 33864124..20063227 100644 --- a/mkdoxy/plugin.py +++ b/mkdoxy/plugin.py @@ -5,7 +5,6 @@ """ import logging -import os from pathlib import Path, PurePath from mkdocs import exceptions