Skip to content

Commit 2cb78c5

Browse files
committed
[#282]:svarga:docs, Doxygen API reference site + alias vocabulary + content tree
Closes #282. Stand up the full h5cpp API reference site under docs/doxygen/, served from the alias-first docstring vocabulary defined in docs/links/*.txt and catalogued in docs/aliases.md. ALIAS VOCABULARY * docs/aliases.md — publishable catalog with 6 tables (parameters, template params, returns, see-also bundles, function-group headers) plus the standard docstring template, workflow for adding/removing aliases (>= 5-use threshold), and the alias-first contribution rule also added to CONTRIBUTING.md. * docs/links/h5cpp.txt — par_*, tpar_*, returns_*, func_*_hdr. v1.12.6 surface adds: par_mdspan, par_sparse, par_ref_t, sa_async, sa_sparse, sa_mdspan, sa_token. par_args (dataset I/O) and the new par_args_attr (attribute I/O, no chunking, no partial I/O) document the variadic surface. * docs/links/hdf5.txt / stl.txt / linalg.txt — sa_hdf5 / sa_stl / sa_linalg bundles rewritten as inline markdown links because Doxygen substitutes \n as <br/> not real newline, breaking the earlier markdown reference-style ([name][] + [name]: URL) pairing. ALIAS ADOPTION SWEEP * H5Dwrite.hpp — 73 inline @param/@return blocks replaced with aliases. * H5Dcreate.hpp — 14 inline blocks replaced. * H5Dgather.hpp / H5Dranges.hpp / H5Sall.hpp — smaller surfaces. * H5Eall.hpp — 48 exception structs decorated with one-line @brief docstrings; each leaf type now produces a standalone Doxygen struct reference page (84 total reference pages). * H5config.hpp — @defgroup attribute-io added so the \func_attr_hdr alias renders a Group page (companion to the existing io-create, io-read, io-write, io-append, file-io, io-wrap groups). CONTENT PAGES (doxy/anchors.dox) * Error Handling — full hierarchy table, CHECK_* macros, mute/unmute, rollback discipline, all 48 exception types. * Conversion Policy — 6 sections covering default/explicit/refcount/ async/inventory/use_cases; cross-references the Handle Reference page where the conversion mechanism lives. * Handles, Descriptors, and Property Lists — consolidated reference with 6 categorised tables (object handles, async, references, property lists [16 entries], shape descriptors, implementation). * Supported Types — comprehensive 13-section catalog (elementary scalars, strings, compound, arrays, STL sequence/associative/ array-of, ragged, linalg dense, linalg sparse, mdspan, references, smart pointers, NOT supported) each row mapping the type to its storage_representation_t value. * Supported Linear Algebra Types — sparse storage layout, dense storage layout, overview table, then per-library deep dives for Armadillo, Eigen, Blaze, Blitz++, dlib, IT++, Boost uBLAS, xtensor; mixing rules; dispatch traits. * Tightened older stubs (link_stl_template_types, link_linalg_template_types) into focused redirects pointing at the comprehensive Supported Types catalog. COOK BOOK + REPORTS TREE * 28 example READMEs wired into Doxygen as @page subpages under the master examples_guides_index. Top-level "Examples" tab hidden (visible="no" in DoxygenLayout.xml) because the cook book navigation already exposes them. * Tone pass on examples/container/README.md (and the example-guide master) to a neutral / technical voice. * docs/reports/ scaffolded into 4 categories — architecture (12), taxonomies/surveys (8), inventories & guides (5), compatibility & projects (8) — wired into Doxyfile INPUT. RENDERING + SIGNATURE PIPELINE * Doxygen function signatures: compact rendering via customdoxygen.css (collapse <table class="memname"> to inline flow); postprocess step in scripts/docs-postprocess.sh tightens whitespace (trailing space in memname cell, " &amp;" / " *" inside paramtype, " ," in template parameter lists). * MACRO_EXPANSION + EXPAND_AS_DEFINED in doxy/Doxyfile so SFINAE return-type macros (e.g. H5CPP_ATTR_CREATE_RET) collapse to the advertised return type in the rendered signature without leaking std::enable_if_t<...> into the headline. Gated on the H5CPP_DOXYGEN sentinel. * cppreference URLs canonicalised in docs-postprocess.sh: http://...w/... → https://... and trailing .html stripped (~1631 URLs rewritten per build). * HDF5 doc URLs rewritten to support.hdfgroup.org/documentation/ hdf5/latest/. * aliases.md table rendering fix: rewording the Conventions list to avoid \func_*_hdr and @InGroup mentions even inside backticks (Doxygen markdown table parser is fragile to those tokens). * Version pipeline: scripts/docs-build.sh derives the project version from CMakeLists.txt H5CPP_PROJECT_VERSION as source-of-truth; git tag override only when HEAD sits on a clean v<n>.<n>.<n> release tag. * CSS: --content-maxwidth raised to 1600px (over-broad rules from an earlier attempt that broke the doxygen-awesome flex layout were reverted). * Doxygen footer: "Generated by" credit and logo removed; only copyright remains. * @verbatim wrap on aliases.md docstring examples to suppress alias substitution inside the code samples. CI + BUILD * .github/workflows/docs.yml uploads Doxygen WARN_LOGFILE as a build artifact for coverage tracking. * .gitignore drops generated docs/doxygen/ output.
1 parent db16477 commit 2cb78c5

100 files changed

Lines changed: 15300 additions & 563 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,39 @@ jobs:
4545
sudo apt-get update -qq
4646
sudo apt-get install -y doxygen
4747
48-
- name: Build Doxygen API reference
49-
run: cd doxy && doxygen Doxyfile
48+
- name: Checkout repo (with full history so docs-build.sh can resolve git tags)
49+
run: |
50+
if ! git rev-parse --git-dir >/dev/null 2>&1; then
51+
echo "checkout missing — run actions/checkout@v4 above"
52+
exit 1
53+
fi
54+
# actions/checkout@v4 uses depth=1 by default; fetch tags so the
55+
# version-deriving git describe in docs-build.sh sees real releases.
56+
git fetch --tags --depth=0 origin || true
57+
58+
- name: Build Doxygen API reference (version from git tag, post-processed)
59+
run: scripts/docs-build.sh
60+
61+
- name: Summarise Doxygen warnings
62+
if: always()
63+
run: |
64+
log=docs/doxygen/warnings.log
65+
if [[ -f $log ]]; then
66+
count=$(wc -l < $log)
67+
echo "::notice::Doxygen warnings: $count lines (see uploaded artifact 'doxygen-warnings')"
68+
head -50 $log || true
69+
else
70+
echo "::notice::No Doxygen warnings log produced"
71+
fi
72+
73+
- name: Upload Doxygen warnings log
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: doxygen-warnings
78+
path: docs/doxygen/warnings.log
79+
if-no-files-found: ignore
80+
retention-days: 30
5081

5182
- name: Deploy Doxygen to gh-pages/api
5283
uses: peaceiris/actions-gh-pages@v4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,5 @@ data/
159159
# Documentation build output
160160
# =============================================================================
161161
docs/docs/site
162-
site/
162+
site/
163+
docs/doxygen/

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ endif()
1616
# embeds it as PROJECT_VERSION rather than a stale hardcoded number. Falls
1717
# back to a placeholder when building from a tarball without git history.
1818
find_package(Git QUIET)
19-
set(H5CPP_PROJECT_VERSION "1.12.0")
19+
set(H5CPP_PROJECT_VERSION "1.12.7")
2020
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
2121
execute_process(
2222
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 --match "v[0-9]*"

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,21 @@ A pull request should:
111111
- document user-visible behavior changes
112112

113113
The preferred merge target for active development is `staging`. Release branches are promoted from `staging` after validation.
114+
115+
## Documentation — alias-first docstrings
116+
117+
H5CPP's API surface is built on overload sets (`h5::write` has ~40 overloads, `h5::read` ~30, `h5::create` ~20). Each carries the same `file_path`, `dataset_path`, `offset`, `stride`, `count`, `block`, `dxpl`, template parameter, return type. Without discipline, the same `@param` block ends up duplicated across dozens of docstrings — and a wording change requires dozens of edits.
118+
119+
To keep docstrings DRY, the project uses a controlled vocabulary of Doxygen aliases defined in `docs/links/*.txt`. Each alias is a single-token expansion that produces a fully-formed `@param` / `@tparam` / `@return` / `@see` block.
120+
121+
The full vocabulary catalog, standard docstring template, and workflow for adding new aliases live at [`docs/aliases.md`](docs/aliases.md).
122+
123+
### The rule
124+
125+
When writing or refactoring a docstring:
126+
127+
1. If a `@param` / `@tparam` / `@return` line you're about to write would repeat **≥ 5 times** across the codebase, use an existing alias from `docs/links/h5cpp.txt` — or add a new one there and reference it via `\name`.
128+
2. The chained-aliases line goes at the **end** of the comment, after any `\code` block. Order: `\par_*``\tpar_*``\returns_*``\sa_*`.
129+
3. New aliases land in the same commit as their first use. Update `docs/aliases.md` so the catalog stays in sync.
130+
131+
The canonical example is `h5cpp/H5Dread.hpp`. The standard template is in [`docs/aliases.md`](docs/aliases.md).

docs/aliases.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
@page aliases_reference Doxygen alias vocabulary
2+
3+
H5CPP uses a controlled vocabulary of Doxygen aliases so that repeated `@param` / `@tparam` / `@return` / `@see` fragments are defined **once** in `docs/links/*.txt` and referenced everywhere with a `\name` token.
4+
5+
One source of truth. A wording change in one file propagates automatically to every overload that uses the alias.
6+
7+
Use this page as the developer reference when writing or refactoring docstrings, and as the project reference for what each `\alias` token in the generated API site means.
8+
9+
10+
11+
## How the mechanism works
12+
13+
The Doxyfile pulls in four alias-definition files via `@INCLUDE_PATH` and `@INCLUDE`:
14+
15+
| File | Purpose |
16+
|---|---|
17+
| `docs/links/h5cpp.txt` | the core h5cpp alias set — parameters, returns, see-also bundles, function-group headers |
18+
| `docs/links/hdf5.txt` | HDF5 C-API cross-reference bundles |
19+
| `docs/links/linalg.txt` | Armadillo / Eigen / Blitz / Blaze / dlib / uBLAS cross-reference bundles |
20+
| `docs/links/stl.txt` | `std::vector` / `std::array` / `std::string` / `std::mdspan` cross-reference bundles |
21+
22+
When Doxygen processes a docstring, every `\name` token is expanded inline into the alias's full text. A docstring carrying
23+
24+
```text
25+
\\par_file_path \\par_dataset_path \\par_offset \\par_stride \\par_count \\par_block \\par_dxpl \\tpar_T \\returns_object \\sa_h5cpp \\sa_stl
26+
```
27+
28+
(double-backslash here is a display artefact so this guide can show the syntax literally — write a single `\` in your actual docstrings.) Expands into eleven fully-formed `@param` / `@tparam` / `@return` / `@see` blocks at API-reference generation time.
29+
30+
31+
32+
## Standard docstring template
33+
34+
The canonical shape of an h5cpp API docstring:
35+
36+
```text
37+
/** \\func_read_hdr
38+
* One-line summary of what this overload does.
39+
*
40+
* Optional 2–3 sentences elaborating function-specific content. Keep prose
41+
* to what's unique about this overload — boilerplate (param descriptions,
42+
* return types, exception semantics) comes from aliases.
43+
*
44+
* Embedded example block goes here using Doxygen's code / endcode pair.
45+
*
46+
* \\par_file_path \\par_dataset_path \\par_offset \\par_stride \\par_count \\par_block \\par_dxpl \\tpar_T \\returns_object
47+
* \\sa_h5cpp \\sa_stl
48+
*/
49+
```
50+
51+
(Double-backslashes in the template above are a display artefact — write a single `\` in your actual docstrings.)
52+
53+
Conventions:
54+
55+
- The chained-aliases line goes at the **end** of the comment, after any code block.
56+
- One line if it fits in ~120 columns; otherwise one alias per line.
57+
- Order: `par_*` (in declaration order) then `tpar_*` then `returns_*` then `sa_*` aliases.
58+
- The `func_*_hdr` family (one per overload group) goes on the **first** line of the comment.
59+
60+
61+
62+
## Vocabulary catalog
63+
64+
### Parameters
65+
66+
| Alias | Expands to (summary) |
67+
|---|---|
68+
| `\par_file_path` | `@param file_path` — path to the HDF5 container in the OS file system |
69+
| `\par_dataset_path` | `@param dataset_path` — POSIX-style path within the container |
70+
| `\par_attr` | `@param attr` — UTF-8 attribute name (relative to parent object) |
71+
| `\par_fcrt_flags` | `@param flags``H5F_ACC_TRUNC` / `EXCL` / `DEBUG` |
72+
| `\par_fopn_flags` | `@param flags``H5F_ACC_RDWR` / `RDONLY` |
73+
| `\par_fd` | `@param fd` — open `h5::fd_t` file descriptor |
74+
| `\par_ds` | `@param ds` — open `h5::ds_t` dataset descriptor |
75+
| `\par_sp` | `@param sp` — valid `h5::sp_t` dataspace descriptor |
76+
| `\par_handle` | `@param handle` — any `h5::hid_t<T>` descriptor (`fd_t` / `ds_t` / `gr_t` / `at_t` / `dcpl_t` / `fapl_t`) |
77+
| `\par_ref_t` | `@param ref` — valid `h5::reference_t` handle (RAII) |
78+
| `\par_fcpl` | `@param fcpl` — file creation property list |
79+
| `\par_fapl` | `@param fapl` — file access property list (driver, parallel I/O) |
80+
| `\par_dapl` | `@param dapl` — dataset access property list |
81+
| `\par_dcpl` | `@param dcpl` — dataset creation property list |
82+
| `\par_dxpl` | `@param dxpl` — data transfer property list |
83+
| `\par_lcpl` | `@param lcpl` — link creation property list |
84+
| `\par_ref` | `@param ref` — linalg object or `std::vector<T>` |
85+
| `\par_ptr` | `@param ptr` — caller memory region |
86+
| `\par_offset` | `@param offset` — first-element coordinates in file space |
87+
| `\par_stride` | `@param stride` — step between selected elements |
88+
| `\par_count` | `@param count` — blocks per dimension |
89+
| `\par_block` | `@param block` — block size per dimension |
90+
| `\par_max_dims` | `@param max_dims` — max extent; `H5S_UNLIMITED` for extendable |
91+
| `\par_current_dims` | `@param current_dims` — initial extent |
92+
| `\par_chunk_dims` | `@param chunk` — chunked-storage chunk shape |
93+
| `\par_deflate` | `@param deflate` — gzip level 0–9 |
94+
| `\par_thread_count` | `@param N` — FAPL worker-pool size (0 disables) |
95+
| `\par_args` | `@param args[, ...]` — variadic context-sensitive optionals for dataset I/O (offset / stride / count / block / dxpl / current_dims / max_dims / dcpl / lcpl …) |
96+
| `\par_args_attr` | `@param args[, ...]` — variadic context-sensitive optionals for attribute I/O (`h5::current_dims`, `h5::acpl_t`); offset / stride / count / block / dxpl / max_dims / dcpl / lcpl do **not** apply (no chunking, no partial I/O) |
97+
| `\par_mdspan` | `@param view``std::mdspan` over caller storage |
98+
| `\par_sparse` | `@param matrix``arma::SpMat` / `Eigen::SparseMatrix` (CSC layout) |
99+
100+
### Template parameters
101+
102+
| Alias | Expands to |
103+
|---|---|
104+
| `\tpar_T` | `@tparam T` — supported elementary type, registered compound, or linalg object |
105+
| `\tpar_FD` | `@tparam fd_t``hid_t` or `h5::fd_t` |
106+
| `\tpar_DS` | `@tparam ds_t``hid_t` or `h5::ds_t` |
107+
| `\tpar_AP` | `@tparam fcpl_t``h5::fcpl_t` / `hid_t` / `H5P_DEFAULT` |
108+
| `\tpar_CP` | `@tparam fapl_t``h5::fapl_t` / `hid_t` / `H5P_DEFAULT` |
109+
110+
### Returns
111+
112+
| Alias | Expands to |
113+
|---|---|
114+
| `\returns_fd` | `@return` — open `h5::fd_t`; throws `h5::error` |
115+
| `\returns_ds` | `@return` — open `h5::ds_t`; throws `h5::error` |
116+
| `\returns_err` | `@return``void`; errors via `h5::error` exceptions |
117+
| `\returns_object` | `@return` — fully-constructed object of type `T` |
118+
| `\returns_string_vec` | `@return``std::vector<std::string>` |
119+
| `\returns_gr` | `@return``h5::gr_t` for on-disk group layout |
120+
| `\returns_ref` | `@return``h5::reference_t` handle |
121+
| `\returns_paths` | `@return``std::vector<std::string>` of object paths |
122+
123+
### See-also bundles
124+
125+
| Alias | Expands to |
126+
|---|---|
127+
| `\sa_h5cpp` | h5cpp entry points: `open` / `read` / `write` / `fd_t` / `ds_t` / `err_t` |
128+
| `\sa_exception` | `@exception std::runtime_error if the dataset or file is not found` |
129+
| `\sa_conversion` | h5cpp ↔ HDF5 implicit conversion explainer |
130+
| `\sa_hdf5` | HDF5 C-API cross-references (defined in `docs/links/hdf5.txt`) |
131+
| `\sa_linalg` | linalg-library cross-references (defined in `docs/links/linalg.txt`) |
132+
| `\sa_stl` | STL cross-references (defined in `docs/links/stl.txt`) |
133+
| `\sa_sparse` | sparse-CSC API cluster + scipy/Julia/10x interop notes |
134+
| `\sa_mdspan` | C++23 `std::mdspan` + libstdc++/libc++ version floors |
135+
| `\sa_async` | FAPL-scoped async executor model |
136+
| `\sa_token` | HDF5 1.12+ token-based identity (`token_t`, `oinfo`, `token_equal`) |
137+
138+
### Function-group headers
139+
140+
| Alias | Expands to | Use on |
141+
|---|---|---|
142+
| `\func_read_hdr` | `@ingroup io-read` | every `h5::read` overload |
143+
| `\func_write_hdr` | `@ingroup io-write` | every `h5::write` overload |
144+
| `\func_create_hdr` | `@ingroup io-create` | every `h5::create` overload |
145+
| `\func_attr_hdr` | `@ingroup attribute-io` | every `h5::aread` / `h5::awrite` |
146+
| `\func_sparse_hdr` | `@ingroup sparse-io` | sparse read/write overloads |
147+
| `\func_async_hdr` | `@ingroup async-io` | `h5::async::*` factories |
148+
| `\func_traversal_hdr` | `@ingroup traversal` | `h5::ls` / `h5::dfs` / `h5::bfs` |
149+
| `\func_read_desc` | one-line read description | combine with `func_read_hdr` |
150+
| `\func_write_desc` | one-line write description | combine with `func_write_hdr` |
151+
| `\func_create_links` | a `\sa_*` bundle for create | use after `func_create_hdr` |
152+
153+
154+
155+
## Adding a new alias
156+
157+
1. Confirm it'll appear **≥ 5 times** across the API. If not, write the `@param` inline.
158+
2. Open `docs/links/h5cpp.txt` (or `hdf5.txt` / `linalg.txt` / `stl.txt` if cross-domain).
159+
3. Add the alias under the matching section header (e.g. `############ FILE / DATASET PARAMETERS`).
160+
4. Use the alias at one call site to validate the expansion.
161+
5. Run `cd doxy && doxygen Doxyfile` locally; confirm the generated HTML renders the substituted text correctly.
162+
6. Add an entry to this page (`docs/aliases.md`) so the catalog stays in sync.
163+
164+
165+
166+
## Removing an alias
167+
168+
If an alias has zero callers and offers nothing the existing vocabulary can't express, drop it. Same rule applies if an alias is renamed or replaced — the old name doesn't linger. The deletion goes through `docs/links/*.txt` (and removes the row from this page).
169+
170+
If callers exist, migrate them in the same commit as the removal.

0 commit comments

Comments
 (0)