Skip to content

Commit cad0c0b

Browse files
committed
docs: add Doxygen API reference with doxygen-awesome-css theme
Convert all public API comments from plain // to Doxygen /// with @brief, @param, @return, @throws, @tparam, and @see across all four headers (entitygen.hpp, stats_observer.hpp, entt_adapter.hpp, flecs_adapter.hpp). Grouped members with @name sections. Add Doxyfile configured for HTML output with doxygen-awesome-css v2.4.2 theme, README.md as main page, and usage.md included. Fill usage.md gaps: eg::has(key) in Generator Introspection, stats_observer::report() and operator<< examples, Error Reference table covering all thrown exceptions, and cross-link to generated API docs. Add Makefile docs target (make docs) and include doc/api in clean. Add CI step to build documentation on every push/PR and deploy to GitHub Pages on main via actions/deploy-pages@v4. Add doc/api/ to .gitignore.
1 parent f93bbb8 commit cad0c0b

10 files changed

Lines changed: 3743 additions & 261 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,29 @@ jobs:
6363

6464
- name: Lint
6565
run: make lint
66+
67+
- name: Build documentation
68+
run: |
69+
sudo apt-get install -y doxygen
70+
make docs
71+
72+
- name: Upload documentation
73+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
74+
uses: actions/upload-pages-artifact@v3
75+
with:
76+
path: doc/api/html
77+
78+
deploy-docs:
79+
needs: build-and-test
80+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
81+
runs-on: ubuntu-latest
82+
permissions:
83+
pages: write
84+
id-token: write
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
steps:
89+
- name: Deploy to GitHub Pages
90+
id: deployment
91+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ coverage/
1111
*.profraw
1212
*.profdata
1313

14+
# Doxygen output
15+
doc/api/
16+
1417
# IDE / editor
1518
.vscode/
1619

Doxyfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Doxyfile for Entity Generator
2+
# Run: doxygen Doxyfile
3+
4+
PROJECT_NAME = "Entity Generator"
5+
PROJECT_NUMBER = 1.1.0
6+
PROJECT_BRIEF = "Composable, deterministic entity generation for C++23"
7+
PROJECT_LOGO =
8+
9+
OUTPUT_DIRECTORY = doc/api
10+
CREATE_SUBDIRS = NO
11+
12+
# --- Input ----------------------------------------------------------------
13+
14+
INPUT = dasmig/ doc/usage.md README.md
15+
FILE_PATTERNS = *.hpp
16+
RECURSIVE = YES
17+
USE_MDFILE_AS_MAINPAGE = README.md
18+
19+
# --- Extraction -----------------------------------------------------------
20+
21+
EXTRACT_ALL = NO
22+
EXTRACT_PRIVATE = NO
23+
EXTRACT_STATIC = YES
24+
25+
# --- Source browsing -------------------------------------------------------
26+
27+
SOURCE_BROWSER = YES
28+
INLINE_SOURCES = NO
29+
STRIP_CODE_COMMENTS = NO
30+
31+
# --- Build ----------------------------------------------------------------
32+
33+
BUILTIN_STL_SUPPORT = YES
34+
ENABLE_PREPROCESSING = YES
35+
MACRO_EXPANSION = YES
36+
PREDEFINED = DASMIG_ENTITYGEN_HPP \
37+
DASMIG_EXT_STATS_OBSERVER_HPP \
38+
DASMIG_EXT_ENTT_ADAPTER_HPP \
39+
DASMIG_EXT_FLECS_ADAPTER_HPP
40+
41+
# Exclude deps/ (vendored third-party headers).
42+
EXCLUDE_PATTERNS = */deps/*
43+
44+
# --- Warnings -------------------------------------------------------------
45+
46+
WARN_IF_UNDOCUMENTED = YES
47+
WARN_IF_DOC_ERROR = YES
48+
49+
# --- Output formats --------------------------------------------------------
50+
51+
GENERATE_HTML = YES
52+
HTML_OUTPUT = html
53+
HTML_EXTRA_STYLESHEET = doc/doxygen-awesome-css/doxygen-awesome.css
54+
HTML_COLORSTYLE = LIGHT
55+
GENERATE_TREEVIEW = YES
56+
DISABLE_INDEX = NO
57+
FULL_SIDEBAR = NO
58+
59+
GENERATE_LATEX = NO
60+
GENERATE_MAN = NO
61+
GENERATE_XML = NO
62+
63+
# --- Graphs ----------------------------------------------------------------
64+
65+
HAVE_DOT = NO
66+
CLASS_DIAGRAMS = YES

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TEST_BIN := $(BUILD)/test_runner
1111
COV_FLAGS := -fprofile-instr-generate -fcoverage-mapping
1212
COV_DIR := coverage
1313

14-
.PHONY: all clean lint test coverage
14+
.PHONY: all clean lint test coverage docs
1515

1616
all: $(EXAMPLE_BIN)
1717

@@ -35,8 +35,12 @@ coverage: $(TEST_SRC) dasmig/entitygen.hpp dasmig/random.hpp | $(BUILD)
3535
$(BUILD):
3636
@mkdir -p $(BUILD)
3737

38+
docs:
39+
doxygen Doxyfile
40+
@echo "API docs: doc/api/html/index.html"
41+
3842
lint:
3943
clang-tidy $(EXAMPLE_SRC) -- $(CXXFLAGS)
4044

4145
clean:
42-
rm -rf $(BUILD) $(COV_DIR)
46+
rm -rf $(BUILD) $(COV_DIR) doc/api

0 commit comments

Comments
 (0)