From fe6a1ab79b2a7c1b3b3775a1e1a002609ba5a86a Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Sun, 15 Mar 2026 19:39:48 +0100 Subject: [PATCH 1/3] feat(docs): add Doxygen configuration and update .gitignore for documentation files --- .gitignore | 3 +++ Doxyfile | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 2 ++ tasks.py | 19 +++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 Doxyfile diff --git a/.gitignore b/.gitignore index 5bd8a41..9c096f7 100755 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,9 @@ venv*/ *.tmp *.bak +# Documentation +docs/doxygen/* + # Misc *.local diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..d6d5211 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,61 @@ +PROJECT_NAME = "DMX-Interface" +PROJECT_BRIEF = "ChaosDMX" +OUTPUT_DIRECTORY = docs/doxygen + +# Input settings + +INPUT = main \ + components \ + data \ + README.md +FILE_PATTERNS = *.c *.h *.cpp *.hpp *.md *.py *.js *.css *.html +RECURSIVE = YES +EXCLUDE_PATTERNS = */build/* \ + */managed_components/* +USE_MDFILE_AS_MAINPAGE = README.md + +# Documentation settings +GENERATE_LATEX = NO +GENERATE_HTML = YES + +# doxygen-awesome-css settings +HTML_EXTRA_STYLESHEET = docs/external/doxygen-awesome-css/doxygen-awesome.css \ + docs/external/doxygen-awesome-css/doxygen-awesome-sidebar-only.css + +HTML_EXTRA_FILES = docs/external/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js \ + docs/external/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js \ + docs/external/doxygen-awesome-css/doxygen-awesome-paragraph-link.js \ + docs/external/doxygen-awesome-css/doxygen-awesome-interactive-toc.js \ + docs/external/doxygen-awesome-css/doxygen-awesome-tabs.js + +# Custom header for JS integration + +# Better HTML output +HTML_COLORSTYLE = LIGHT +GENERATE_TREEVIEW = YES +DISABLE_INDEX = NO +FULL_SIDEBAR = NO + +# Extraction settings +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES + +# Graphviz / Dot settings +HAVE_DOT = YES +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = YES +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 + +# Graphs to generate +CALL_GRAPH = YES +CALLER_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES diff --git a/flake.nix b/flake.nix index 4b7ff81..5740a76 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,8 @@ pkgs.prettier pkgs.nixfmt + pkgs.doxygen + pkgs.graphviz ]; }; }; diff --git a/tasks.py b/tasks.py index 536824a..4a97f11 100644 --- a/tasks.py +++ b/tasks.py @@ -149,3 +149,22 @@ def format_check(c): sys.exit(1) print("\nāœ… All files are correctly formatted!") + + +@task(help={"o": "Open documentation in the default browser after generation."}) +def docs(c, o=False): + """Generate Doxygen documentation.""" + task_begin("docs", "Docs") + proc = subprocess.run("doxygen Doxyfile", shell=True) + if proc.returncode == 0: + task_end("docs", "done", "Docs generated") + path = "docs/doxygen/html/index.html" + console.print( + f"\n[bold green]āœ“ Documentation generated in {path}[/bold green]" + ) + if o: + import webbrowser + webbrowser.open(f"file://{os.path.abspath(path)}") + return + task_end("docs", "failed", "Doxygen failed") + raise Exit(code=1) From 7d2647b65615c513851fc1dad60d08ceb236d35d Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:02:14 +0100 Subject: [PATCH 2/3] fix(docs): fix tasks.py --- tasks.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tasks.py b/tasks.py index 4a97f11..e97fe48 100644 --- a/tasks.py +++ b/tasks.py @@ -1,7 +1,9 @@ from invoke import task import os import shutil +import subprocess import sys +import webbrowser @task @@ -154,17 +156,11 @@ def format_check(c): @task(help={"o": "Open documentation in the default browser after generation."}) def docs(c, o=False): """Generate Doxygen documentation.""" - task_begin("docs", "Docs") proc = subprocess.run("doxygen Doxyfile", shell=True) if proc.returncode == 0: - task_end("docs", "done", "Docs generated") path = "docs/doxygen/html/index.html" - console.print( - f"\n[bold green]āœ“ Documentation generated in {path}[/bold green]" - ) + print(f"\nāœ“ Documentation generated in {path}") if o: - import webbrowser webbrowser.open(f"file://{os.path.abspath(path)}") return - task_end("docs", "failed", "Doxygen failed") raise Exit(code=1) From daa5e2e2b3edcdf0b6629fee7d6ca68c8375cc3f Mon Sep 17 00:00:00 2001 From: HendrikRauh <114620133+HendrikRauh@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:13:25 +0100 Subject: [PATCH 3/3] fix(docs): add doxygen-awesome-css submodule for documentation styling --- .gitmodules | 3 +++ docs/external/doxygen-awesome-css | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 docs/external/doxygen-awesome-css diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3362621 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/external/doxygen-awesome-css"] + path = docs/external/doxygen-awesome-css + url = https://github.com/jothepro/doxygen-awesome-css diff --git a/docs/external/doxygen-awesome-css b/docs/external/doxygen-awesome-css new file mode 160000 index 0000000..1f36200 --- /dev/null +++ b/docs/external/doxygen-awesome-css @@ -0,0 +1 @@ +Subproject commit 1f3620084ff75734ed192101acf40e9dff01d848