Skip to content

Commit 5a6b4fc

Browse files
committed
update cppdocs to support newer doxygen versions (resolves #7439)
1 parent 3ac2560 commit 5a6b4fc

File tree

7 files changed

+1168
-335
lines changed

7 files changed

+1168
-335
lines changed

api-docs/cppdocs/build_min_docs.py

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
# make docset
1313
# =-=--
1414

15-
__DOXYGEN_REQUIRED_VERSION__ = "1.12.0"
16-
1715
import argparse
1816
import os
1917
import sys
2018
import json
19+
import re
2120
from collections import namedtuple
2221
import subprocess
2322
import shutil
@@ -81,6 +80,45 @@ def load_items_in_file(filename):
8180
return items
8281

8382

83+
def replace_getScript_function(js_content, replacement_func):
84+
"""
85+
Robustly find and replace the getScript function definition.
86+
Uses brace counting to handle nested functions across different Doxygen versions.
87+
"""
88+
# Find the start of the function
89+
pattern = r'const getScript\s*=\s*function\s*\([^)]*\)\s*\{'
90+
match = re.search(pattern, js_content)
91+
92+
if not match:
93+
print("ERROR: getScript function not found in navtree.js")
94+
sys.exit(1)
95+
96+
start_pos = match.start()
97+
func_start = match.end() - 1 # Position of opening brace
98+
99+
# Count braces to find the matching closing brace
100+
brace_count = 1
101+
pos = func_start + 1
102+
103+
while pos < len(js_content) and brace_count > 0:
104+
if js_content[pos] == '{':
105+
brace_count += 1
106+
elif js_content[pos] == '}':
107+
brace_count -= 1
108+
pos += 1
109+
110+
if brace_count != 0:
111+
print("ERROR: Could not find matching closing brace for getScript function")
112+
sys.exit(1)
113+
114+
end_pos = pos # Position after closing brace
115+
116+
# Replace the function
117+
new_content = js_content[:start_pos] + replacement_func + js_content[end_pos:]
118+
119+
return new_content
120+
121+
84122
def minifier():
85123

86124
# Typically, doxygen's navbar will lazy load the data in all of these variables.
@@ -115,12 +153,10 @@ def minifier():
115153

116154
# getScript(scriptName,func,show) here originally loads the js file and calls func once that is complete
117155
# Here, we just want to skip the whole process and immediately call the callback.
156+
# This replacement works across different Doxygen versions (tested with 1.12.0, 1.14.0, and 1.15.0)
118157
nav_tree_fixed_get_script = "function getScript(scriptName,func,show) { func(); }"
119158

120-
navtree_before_get_script = navtree_orig.split("const getScript = function(scriptName,func) {")[0]
121-
navtree_after_get_script = navtree_orig.split("const getScript = function(scriptName,func) {")[1].split('}', 1)[1]
122-
123-
nav_tree_fixed = navtree_before_get_script + nav_tree_fixed_get_script + navtree_after_get_script
159+
nav_tree_fixed = replace_getScript_function(navtree_orig, nav_tree_fixed_get_script)
124160
navtree = navtree_built_data + "\n" + nav_tree_fixed
125161

126162
fp = open("html/navtree.js", "w")
@@ -133,9 +169,6 @@ def build_doxygen(args):
133169
print('No Doxyfile found. Are you in the right directory?')
134170
sys.exit(1)
135171
_, vers, _ = system_with_output(f"{doxygen} -V")
136-
if __DOXYGEN_REQUIRED_VERSION__ not in vers.strip():
137-
print(f'Please use Doxygen {__DOXYGEN_REQUIRED_VERSION__} to build documentation')
138-
sys.exit(1)
139172

140173
if args.docset:
141174
stat, _, _ = system_with_output("doxygen2docset --help")

api-docs/cppdocs/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1+
// SPDX-License-Identifier: MIT
12
/**
23
34
Doxygen Awesome
45
https://github.com/jothepro/doxygen-awesome-css
56
6-
MIT License
7-
8-
Copyright (c) 2021 - 2022 jothepro
9-
10-
Permission is hereby granted, free of charge, to any person obtaining a copy
11-
of this software and associated documentation files (the "Software"), to deal
12-
in the Software without restriction, including without limitation the rights
13-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
copies of the Software, and to permit persons to whom the Software is
15-
furnished to do so, subject to the following conditions:
16-
17-
The above copyright notice and this permission notice shall be included in all
18-
copies or substantial portions of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26-
SOFTWARE.
7+
Copyright (c) 2021 - 2025 jothepro
278
289
*/
2910

api-docs/cppdocs/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1+
// SPDX-License-Identifier: MIT
12
/**
23
34
Doxygen Awesome
45
https://github.com/jothepro/doxygen-awesome-css
56
6-
MIT License
7-
8-
Copyright (c) 2022 jothepro
9-
10-
Permission is hereby granted, free of charge, to any person obtaining a copy
11-
of this software and associated documentation files (the "Software"), to deal
12-
in the Software without restriction, including without limitation the rights
13-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
copies of the Software, and to permit persons to whom the Software is
15-
furnished to do so, subject to the following conditions:
16-
17-
The above copyright notice and this permission notice shall be included in all
18-
copies or substantial portions of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26-
SOFTWARE.
7+
Copyright (c) 2022 - 2025 jothepro
278
289
*/
2910

@@ -33,8 +14,8 @@ class DoxygenAwesomeFragmentCopyButton extends HTMLElement {
3314
this.onclick=this.copyContent
3415
}
3516
static title = "Copy to clipboard"
36-
static copyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>`
37-
static successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>`
17+
static copyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M23.04,10.322c0,-2.582 -2.096,-4.678 -4.678,-4.678l-6.918,-0c-2.582,-0 -4.678,2.096 -4.678,4.678c0,-0 0,8.04 0,8.04c0,2.582 2.096,4.678 4.678,4.678c0,-0 6.918,-0 6.918,-0c2.582,-0 4.678,-2.096 4.678,-4.678c0,-0 0,-8.04 0,-8.04Zm-2.438,-0l-0,8.04c-0,1.236 -1.004,2.24 -2.24,2.24l-6.918,-0c-1.236,-0 -2.239,-1.004 -2.239,-2.24l-0,-8.04c-0,-1.236 1.003,-2.24 2.239,-2.24c0,0 6.918,0 6.918,0c1.236,0 2.24,1.004 2.24,2.24Z"/><path d="M5.327,16.748c-0,0.358 -0.291,0.648 -0.649,0.648c0,0 0,0 0,0c-2.582,0 -4.678,-2.096 -4.678,-4.678c0,0 0,-8.04 0,-8.04c0,-2.582 2.096,-4.678 4.678,-4.678l6.918,0c2.168,0 3.994,1.478 4.523,3.481c0.038,0.149 0.005,0.306 -0.09,0.428c-0.094,0.121 -0.239,0.191 -0.392,0.191c-0.451,0.005 -1.057,0.005 -1.457,0.005c-0.238,0 -0.455,-0.14 -0.553,-0.357c-0.348,-0.773 -1.128,-1.31 -2.031,-1.31c-0,0 -6.918,0 -6.918,0c-1.236,0 -2.24,1.004 -2.24,2.24l0,8.04c0,1.236 1.004,2.24 2.24,2.24l0,-0c0.358,-0 0.649,0.29 0.649,0.648c-0,0.353 -0,0.789 -0,1.142Z" style="fill-opacity:0.6;"/></svg>`
18+
static successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M8.084,16.111c-0.09,0.09 -0.212,0.141 -0.34,0.141c-0.127,-0 -0.249,-0.051 -0.339,-0.141c-0.746,-0.746 -2.538,-2.538 -3.525,-3.525c-0.375,-0.375 -0.983,-0.375 -1.357,0c-0.178,0.178 -0.369,0.369 -0.547,0.547c-0.375,0.375 -0.375,0.982 -0,1.357c1.135,1.135 3.422,3.422 4.75,4.751c0.27,0.27 0.637,0.421 1.018,0.421c0.382,0 0.749,-0.151 1.019,-0.421c2.731,-2.732 10.166,-10.167 12.454,-12.455c0.375,-0.375 0.375,-0.982 -0,-1.357c-0.178,-0.178 -0.369,-0.369 -0.547,-0.547c-0.375,-0.375 -0.982,-0.375 -1.357,0c-2.273,2.273 -9.567,9.567 -11.229,11.229Z"/></svg>`
3819
static successDuration = 980
3920
static init() {
4021
$(function() {

api-docs/cppdocs/doxygen-awesome-css/doxygen-awesome-paragraph-link.js

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1+
// SPDX-License-Identifier: MIT
12
/**
23
34
Doxygen Awesome
45
https://github.com/jothepro/doxygen-awesome-css
56
6-
MIT License
7-
8-
Copyright (c) 2022 jothepro
9-
10-
Permission is hereby granted, free of charge, to any person obtaining a copy
11-
of this software and associated documentation files (the "Software"), to deal
12-
in the Software without restriction, including without limitation the rights
13-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
copies of the Software, and to permit persons to whom the Software is
15-
furnished to do so, subject to the following conditions:
16-
17-
The above copyright notice and this permission notice shall be included in all
18-
copies or substantial portions of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26-
SOFTWARE.
7+
Copyright (c) 2022 - 2025 jothepro
278
289
*/
2910

api-docs/cppdocs/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1-
1+
/* SPDX-License-Identifier: MIT */
22
/**
33
44
Doxygen Awesome
55
https://github.com/jothepro/doxygen-awesome-css
66
7-
MIT License
8-
9-
Copyright (c) 2021 jothepro
10-
11-
Permission is hereby granted, free of charge, to any person obtaining a copy
12-
of this software and associated documentation files (the "Software"), to deal
13-
in the Software without restriction, including without limitation the rights
14-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15-
copies of the Software, and to permit persons to whom the Software is
16-
furnished to do so, subject to the following conditions:
17-
18-
The above copyright notice and this permission notice shall be included in all
19-
copies or substantial portions of the Software.
20-
21-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27-
SOFTWARE.
7+
Copyright (c) 2021 - 2025 jothepro
288
299
*/
3010

api-docs/cppdocs/doxygen-awesome-css/doxygen-awesome-sidebar-only.css

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1+
/* SPDX-License-Identifier: MIT */
12
/**
23
34
Doxygen Awesome
45
https://github.com/jothepro/doxygen-awesome-css
56
6-
MIT License
7-
8-
Copyright (c) 2021 jothepro
9-
10-
Permission is hereby granted, free of charge, to any person obtaining a copy
11-
of this software and associated documentation files (the "Software"), to deal
12-
in the Software without restriction, including without limitation the rights
13-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14-
copies of the Software, and to permit persons to whom the Software is
15-
furnished to do so, subject to the following conditions:
16-
17-
The above copyright notice and this permission notice shall be included in all
18-
copies or substantial portions of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26-
SOFTWARE.
7+
Copyright (c) 2021 - 2025 jothepro
278
289
*/
2910

@@ -35,6 +16,8 @@ html {
3516
--menu-display: none;
3617

3718
--top-height: 120px;
19+
--toc-sticky-top: -25px;
20+
--toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 25px);
3821
}
3922

4023
#projectname {
@@ -58,10 +41,6 @@ html {
5841
height: calc(100vh - var(--top-height)) !important;
5942
}
6043

61-
#nav-tree {
62-
padding: 0;
63-
}
64-
6544
#top {
6645
display: block;
6746
border-bottom: none;
@@ -71,21 +50,24 @@ html {
7150
overflow: hidden;
7251
background: var(--side-nav-background);
7352
}
53+
7454
#main-nav {
7555
float: left;
7656
padding-right: 0;
7757
}
7858

7959
.ui-resizable-handle {
80-
cursor: default;
81-
width: 1px !important;
82-
box-shadow: 0 calc(-2 * var(--top-height)) 0 0 var(--separator-color);
60+
display: none;
61+
}
62+
63+
.ui-resizable-e {
64+
width: 0;
8365
}
8466

8567
#nav-path {
8668
position: fixed;
8769
right: 0;
88-
left: var(--side-nav-fixed-width);
70+
left: calc(var(--side-nav-fixed-width) + 1px);
8971
bottom: 0;
9072
width: auto;
9173
}
@@ -110,4 +92,14 @@ html {
11092
left: var(--spacing-medium) !important;
11193
right: auto;
11294
}
95+
96+
#nav-sync {
97+
bottom: 4px;
98+
right: auto;
99+
left: 300px;
100+
width: 35px;
101+
top: auto !important;
102+
user-select: none;
103+
position: fixed
104+
}
113105
}

0 commit comments

Comments
 (0)