Skip to content

Commit 2ce68fe

Browse files
sbryngelsonclaude
andcommitted
Add unified API landing page and fix footer layout
- Add docs/api/ Doxygen target with a landing page linking to Pre-Process, Simulation, and Post-Process API docs - Consolidate sidebar from 4 links to 2: "User Guide" and "API Documentation" (highlights for all API sub-projects) - Unify browser tab title to "MFC" across all Doxygen targets - Fix footer blank space caused by missing #nav-path element that navtree.js needs for content height calculation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c612b6a commit 2ce68fe

6 files changed

Lines changed: 71 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,10 @@ if (MFC_DOCUMENTATION)
803803
\"${CMAKE_CURRENT_SOURCE_DIR}/docs/custom.css\"")
804804

805805
# > Generate Documentation & Landing Page
806-
GEN_DOCS(pre_process "MFC: Pre-Process")
807-
GEN_DOCS(simulation "MFC: Simulation")
808-
GEN_DOCS(post_process "MFC: Post-Process")
806+
GEN_DOCS(pre_process "MFC")
807+
GEN_DOCS(simulation "MFC")
808+
GEN_DOCS(post_process "MFC")
809+
GEN_DOCS(api "MFC")
809810
GEN_DOCS(documentation "MFC")
810811

811812
# Generate API landing pages for pre_process, simulation, post_process.
@@ -826,6 +827,7 @@ if (MFC_DOCUMENTATION)
826827
add_dependencies(pre_process_doxygen gen_api_landing)
827828
add_dependencies(simulation_doxygen gen_api_landing)
828829
add_dependencies(post_process_doxygen gen_api_landing)
830+
add_dependencies(api_doxygen gen_api_landing)
829831

830832
# Fix @file/@brief headers to match actual module/program declarations.
831833
# Handles mixed-case Fortran names and catches stale module renames.

docs/api/readme.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@mainpage API Documentation
2+
3+
MFC's source code is organized into three components that form a complete simulation pipeline. Each component has full module-level API documentation.
4+
5+
### [Pre-Process](../pre_process/index.html)
6+
7+
The pre-process component generates initial conditions and computational meshes for MFC simulations. It supports patch-based geometry construction, multi-component material initialization, and immersed boundary geometry.
8+
9+
### [Simulation](../simulation/index.html)
10+
11+
The simulation component is the core flow solver. It advances the governing equations in time using high-order finite-volume methods on structured grids with GPU acceleration via OpenACC/OpenMP offloading.
12+
13+
### [Post-Process](../post_process/index.html)
14+
15+
The post-process component reads raw simulation output and computes derived quantities for visualization. It produces silo/HDF5 files compatible with VisIt, ParaView, and other visualization tools.
16+
17+
All three components share a set of **common modules** for MPI communication, variable conversion, derived types, and utility functions. These are documented within each component's API reference.

docs/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
* Overrides for doxygen-awesome theme
44
*/
55

6+
/* Hide empty nav-path footer (kept for navtree.js height calculation) */
7+
#nav-path {
8+
height: 0;
9+
overflow: hidden;
10+
}
11+
612
/* Cross-navigation panel at top of sidebar */
713
#mfc-nav {
814
display: flex;

docs/footer.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!-- HTML footer for doxygen 1.9.1-->
22
<!-- start footer part -->
33
<!--BEGIN GENERATE_TREEVIEW-->
4+
<div id="nav-path" class="navpath">
5+
<ul></ul>
6+
</div>
47
<!--END GENERATE_TREEVIEW-->
58
<!--BEGIN !GENERATE_TREEVIEW-->
69
<!--END !GENERATE_TREEVIEW-->

docs/gen_api_landing.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env python3
2-
"""Generate API landing pages for pre_process, simulation, and post_process.
2+
"""Generate API landing pages for MFC documentation.
33
44
Usage: python3 gen_api_landing.py [source_dir]
55
source_dir defaults to current directory.
66
77
Scans src/{target}/*.fpp,*.f90 and src/common/*.fpp,*.f90 to produce module
8-
tables in docs/{target}/readme.md. Intro text is defined below per target.
8+
tables in docs/{target}/readme.md. Also generates a unified API landing page
9+
at docs/api/readme.md that links to all three sub-project APIs.
910
"""
1011

1112
from __future__ import annotations
@@ -149,3 +150,31 @@ def get_modules(directory: Path) -> list[tuple[str, str]]:
149150
out.parent.mkdir(parents=True, exist_ok=True)
150151
out.write_text("\n".join(lines), encoding="utf-8")
151152
print(f"Generated {out}")
153+
154+
# --- Unified API landing page ---
155+
api_lines = [
156+
"@mainpage API Documentation",
157+
"",
158+
"MFC's source code is organized into three components that form a complete "
159+
"simulation pipeline. Each component has full module-level API documentation.",
160+
"",
161+
]
162+
163+
for target, info in TARGETS.items():
164+
label = info["title"].replace("MFC ", "")
165+
api_lines.append(f"### [{label}](../{target}/index.html)")
166+
api_lines.append("")
167+
api_lines.append(info["intro"])
168+
api_lines.append("")
169+
170+
api_lines.append(
171+
"All three components share a set of **common modules** for MPI communication, "
172+
"variable conversion, derived types, and utility functions. "
173+
"These are documented within each component's API reference."
174+
)
175+
api_lines.append("")
176+
177+
api_out = src_dir / "docs" / "api" / "readme.md"
178+
api_out.parent.mkdir(parents=True, exist_ok=True)
179+
api_out.write_text("\n".join(api_lines), encoding="utf-8")
180+
print(f"Generated {api_out}")

docs/header.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,21 @@
7373
nav.id = 'mfc-nav';
7474
var items = [
7575
['../documentation/index.html', 'documentation', 'User Guide'],
76-
['../pre_process/index.html', 'pre_process', 'Pre-Process API'],
77-
['../simulation/index.html', 'simulation', 'Simulation API'],
78-
['../post_process/index.html', 'post_process', 'Post-Process API']
76+
['../api/index.html', 'api', 'API Documentation']
7977
];
8078
var path = window.location.pathname;
79+
var apiPaths = ['/api/', '/pre_process/', '/simulation/', '/post_process/'];
8180
for (var i = 0; i < items.length; i++) {
8281
var a = document.createElement('a');
8382
a.href = items[i][0];
8483
a.textContent = items[i][2];
85-
if (path.indexOf('/' + items[i][1] + '/') !== -1) a.className = 'active';
84+
if (items[i][1] === 'api') {
85+
for (var j = 0; j < apiPaths.length; j++) {
86+
if (path.indexOf(apiPaths[j]) !== -1) { a.className = 'active'; break; }
87+
}
88+
} else {
89+
if (path.indexOf('/' + items[i][1] + '/') !== -1) a.className = 'active';
90+
}
8691
nav.appendChild(a);
8792
}
8893
var sideNav = document.getElementById('side-nav');

0 commit comments

Comments
 (0)