Skip to content

Commit 8a82ccb

Browse files
committed
Add Doxygen documentation with GitHub Pages deployment
1 parent 96f6b97 commit 8a82ccb

5 files changed

Lines changed: 343 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install Doxygen
29+
run: sudo apt-get update && sudo apt-get install -y doxygen graphviz
30+
31+
- name: Generate documentation
32+
run: |
33+
cd docs
34+
doxygen Doxyfile
35+
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: 'docs/html'
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ build/
33
cmake-build-*/
44
out/
55

6+
# Documentation
7+
docs/html/
8+
docs/xml/
9+
610
# IDE
711
.idea/
812
.vscode/

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ if(THERMO_BUILD_TESTS)
2626
add_subdirectory(tests)
2727
endif()
2828

29+
# Documentation
30+
option(THERMO_BUILD_DOCS "Build documentation" OFF)
31+
32+
if(THERMO_BUILD_DOCS)
33+
find_package(Doxygen)
34+
if(DOXYGEN_FOUND)
35+
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs)
36+
add_custom_target(docs
37+
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIRECTORY}
38+
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile
39+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs
40+
COMMENT "Generating API documentation with Doxygen"
41+
VERBATIM
42+
)
43+
message(STATUS "Doxygen found: documentation can be built with 'make docs'")
44+
else()
45+
message(WARNING "Doxygen not found: documentation cannot be built")
46+
endif()
47+
endif()
48+
2949
# Installation
3050
include(GNUInstallDirs)
3151
include(CMakePackageConfigHelpers)

docs/.nojekyll

Whitespace-only changes.

docs/Doxyfile

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
# Doxyfile for thermo-cpp
2+
3+
#---------------------------------------------------------------------------
4+
# Project related configuration options
5+
#---------------------------------------------------------------------------
6+
7+
DOXYFILE_ENCODING = UTF-8
8+
PROJECT_NAME = "thermo"
9+
PROJECT_NUMBER = "1.0.0"
10+
PROJECT_BRIEF = "Type-safe temperature handling library modeled after std::chrono"
11+
PROJECT_LOGO =
12+
OUTPUT_DIRECTORY = .
13+
CREATE_SUBDIRS = NO
14+
ALLOW_UNICODE_NAMES = YES
15+
OUTPUT_LANGUAGE = English
16+
BRIEF_MEMBER_DESC = YES
17+
REPEAT_BRIEF = YES
18+
ALWAYS_DETAILED_SEC = NO
19+
INLINE_INHERITED_MEMB = NO
20+
FULL_PATH_NAMES = YES
21+
STRIP_FROM_PATH = ../include
22+
STRIP_FROM_INC_PATH = ../include
23+
SHORT_NAMES = NO
24+
JAVADOC_AUTOBRIEF = YES
25+
MULTILINE_CPP_IS_BRIEF = NO
26+
INHERIT_DOCS = YES
27+
SEPARATE_MEMBER_PAGES = NO
28+
TAB_SIZE = 4
29+
OPTIMIZE_OUTPUT_FOR_C = NO
30+
OPTIMIZE_OUTPUT_JAVA = NO
31+
MARKDOWN_SUPPORT = YES
32+
TOC_INCLUDE_HEADINGS = 5
33+
AUTOLINK_SUPPORT = YES
34+
35+
#---------------------------------------------------------------------------
36+
# Build related configuration options
37+
#---------------------------------------------------------------------------
38+
39+
EXTRACT_ALL = YES
40+
EXTRACT_PRIVATE = NO
41+
EXTRACT_PACKAGE = NO
42+
EXTRACT_STATIC = YES
43+
EXTRACT_LOCAL_CLASSES = YES
44+
EXTRACT_LOCAL_METHODS = NO
45+
EXTRACT_ANON_NSPACES = NO
46+
HIDE_UNDOC_MEMBERS = NO
47+
HIDE_UNDOC_CLASSES = NO
48+
HIDE_FRIEND_COMPOUNDS = NO
49+
HIDE_IN_BODY_DOCS = NO
50+
INTERNAL_DOCS = NO
51+
CASE_SENSE_NAMES = YES
52+
HIDE_SCOPE_NAMES = NO
53+
HIDE_COMPOUND_REFERENCE= NO
54+
SHOW_INCLUDE_FILES = YES
55+
SHOW_GROUPED_MEMB_INC = NO
56+
FORCE_LOCAL_INCLUDES = NO
57+
INLINE_INFO = YES
58+
SORT_MEMBER_DOCS = YES
59+
SORT_BRIEF_DOCS = NO
60+
SORT_MEMBERS_CTORS_1ST = NO
61+
SORT_GROUP_NAMES = NO
62+
SORT_BY_SCOPE_NAME = NO
63+
STRICT_PROTO_MATCHING = NO
64+
GENERATE_TODOLIST = YES
65+
GENERATE_TESTLIST = YES
66+
GENERATE_BUGLIST = YES
67+
GENERATE_DEPRECATEDLIST= YES
68+
MAX_INITIALIZER_LINES = 30
69+
SHOW_USED_FILES = YES
70+
SHOW_FILES = YES
71+
SHOW_NAMESPACES = YES
72+
LAYOUT_FILE =
73+
74+
#---------------------------------------------------------------------------
75+
# Configuration options related to warning and progress messages
76+
#---------------------------------------------------------------------------
77+
78+
QUIET = NO
79+
WARNINGS = YES
80+
WARN_IF_UNDOCUMENTED = YES
81+
WARN_IF_DOC_ERROR = YES
82+
WARN_NO_PARAMDOC = NO
83+
WARN_AS_ERROR = NO
84+
WARN_FORMAT = "$file:$line: $text"
85+
WARN_LOGFILE =
86+
87+
#---------------------------------------------------------------------------
88+
# Configuration options related to the input files
89+
#---------------------------------------------------------------------------
90+
91+
INPUT = ../README.md \
92+
../include/thermo
93+
INPUT_ENCODING = UTF-8
94+
FILE_PATTERNS = *.hpp \
95+
*.h \
96+
*.md
97+
RECURSIVE = YES
98+
EXCLUDE =
99+
EXCLUDE_SYMLINKS = NO
100+
EXCLUDE_PATTERNS =
101+
EXCLUDE_SYMBOLS = thermo::_*
102+
EXAMPLE_PATH =
103+
EXAMPLE_PATTERNS = *
104+
EXAMPLE_RECURSIVE = NO
105+
IMAGE_PATH =
106+
INPUT_FILTER =
107+
FILTER_PATTERNS =
108+
FILTER_SOURCE_FILES = NO
109+
FILTER_SOURCE_PATTERNS =
110+
USE_MDFILE_AS_MAINPAGE = ../README.md
111+
112+
#---------------------------------------------------------------------------
113+
# Configuration options related to source browsing
114+
#---------------------------------------------------------------------------
115+
116+
SOURCE_BROWSER = YES
117+
INLINE_SOURCES = NO
118+
STRIP_CODE_COMMENTS = YES
119+
REFERENCED_BY_RELATION = YES
120+
REFERENCES_RELATION = YES
121+
REFERENCES_LINK_SOURCE = YES
122+
SOURCE_TOOLTIPS = YES
123+
USE_HTAGS = NO
124+
VERBATIM_HEADERS = YES
125+
CLANG_ASSISTED_PARSING = NO
126+
127+
#---------------------------------------------------------------------------
128+
# Configuration options related to the alphabetical class index
129+
#---------------------------------------------------------------------------
130+
131+
ALPHABETICAL_INDEX = YES
132+
COLS_IN_ALPHA_INDEX = 5
133+
134+
#---------------------------------------------------------------------------
135+
# Configuration options related to the HTML output
136+
#---------------------------------------------------------------------------
137+
138+
GENERATE_HTML = YES
139+
HTML_OUTPUT = html
140+
HTML_FILE_EXTENSION = .html
141+
HTML_HEADER =
142+
HTML_FOOTER =
143+
HTML_STYLESHEET =
144+
HTML_EXTRA_STYLESHEET =
145+
HTML_EXTRA_FILES =
146+
HTML_COLORSTYLE_HUE = 220
147+
HTML_COLORSTYLE_SAT = 100
148+
HTML_COLORSTYLE_GAMMA = 80
149+
HTML_TIMESTAMP = NO
150+
HTML_DYNAMIC_MENUS = YES
151+
HTML_DYNAMIC_SECTIONS = NO
152+
HTML_INDEX_NUM_ENTRIES = 100
153+
GENERATE_DOCSET = NO
154+
GENERATE_HTMLHELP = NO
155+
GENERATE_QHP = NO
156+
GENERATE_ECLIPSEHELP = NO
157+
DISABLE_INDEX = NO
158+
GENERATE_TREEVIEW = YES
159+
ENUM_VALUES_PER_LINE = 1
160+
TREEVIEW_WIDTH = 250
161+
EXT_LINKS_IN_WINDOW = NO
162+
HTML_FORMULA_FORMAT = png
163+
FORMULA_FONTSIZE = 10
164+
FORMULA_TRANSPARENT = YES
165+
FORMULA_MACROFILE =
166+
USE_MATHJAX = NO
167+
SEARCHENGINE = YES
168+
SERVER_BASED_SEARCH = NO
169+
170+
#---------------------------------------------------------------------------
171+
# Configuration options related to the LaTeX output
172+
#---------------------------------------------------------------------------
173+
174+
GENERATE_LATEX = NO
175+
176+
#---------------------------------------------------------------------------
177+
# Configuration options related to the RTF output
178+
#---------------------------------------------------------------------------
179+
180+
GENERATE_RTF = NO
181+
182+
#---------------------------------------------------------------------------
183+
# Configuration options related to the man page output
184+
#---------------------------------------------------------------------------
185+
186+
GENERATE_MAN = NO
187+
188+
#---------------------------------------------------------------------------
189+
# Configuration options related to the XML output
190+
#---------------------------------------------------------------------------
191+
192+
GENERATE_XML = NO
193+
194+
#---------------------------------------------------------------------------
195+
# Configuration options related to the DOCBOOK output
196+
#---------------------------------------------------------------------------
197+
198+
GENERATE_DOCBOOK = NO
199+
200+
#---------------------------------------------------------------------------
201+
# Configuration options for the AutoGen Definitions output
202+
#---------------------------------------------------------------------------
203+
204+
GENERATE_AUTOGEN_DEF = NO
205+
206+
#---------------------------------------------------------------------------
207+
# Configuration options related to the Perl module output
208+
#---------------------------------------------------------------------------
209+
210+
GENERATE_PERLMOD = NO
211+
212+
#---------------------------------------------------------------------------
213+
# Configuration options related to the preprocessor
214+
#---------------------------------------------------------------------------
215+
216+
ENABLE_PREPROCESSING = YES
217+
MACRO_EXPANSION = YES
218+
EXPAND_ONLY_PREDEF = NO
219+
SEARCH_INCLUDES = YES
220+
INCLUDE_PATH = ../include
221+
INCLUDE_FILE_PATTERNS =
222+
PREDEFINED = __cplusplus=202302L \
223+
__cpp_lib_format=202106L
224+
EXPAND_AS_DEFINED =
225+
SKIP_FUNCTION_MACROS = YES
226+
227+
#---------------------------------------------------------------------------
228+
# Configuration options related to external references
229+
#---------------------------------------------------------------------------
230+
231+
TAGFILES =
232+
GENERATE_TAGFILE =
233+
ALLEXTERNALS = NO
234+
EXTERNAL_GROUPS = YES
235+
EXTERNAL_PAGES = YES
236+
237+
#---------------------------------------------------------------------------
238+
# Configuration options related to the dot tool
239+
#---------------------------------------------------------------------------
240+
241+
CLASS_DIAGRAMS = YES
242+
DIA_PATH =
243+
HIDE_UNDOC_RELATIONS = YES
244+
HAVE_DOT = NO
245+
DOT_NUM_THREADS = 0
246+
DOT_FONTNAME = Helvetica
247+
DOT_FONTSIZE = 10
248+
DOT_FONTPATH =
249+
CLASS_GRAPH = YES
250+
COLLABORATION_GRAPH = YES
251+
GROUP_GRAPHS = YES
252+
UML_LOOK = NO
253+
UML_LIMIT_NUM_FIELDS = 10
254+
TEMPLATE_RELATIONS = NO
255+
INCLUDE_GRAPH = YES
256+
INCLUDED_BY_GRAPH = YES
257+
CALL_GRAPH = NO
258+
CALLER_GRAPH = NO
259+
GRAPHICAL_HIERARCHY = YES
260+
DIRECTORY_GRAPH = YES
261+
DOT_IMAGE_FORMAT = png
262+
INTERACTIVE_SVG = NO
263+
DOT_GRAPH_MAX_NODES = 50
264+
MAX_DOT_GRAPH_DEPTH = 0
265+
DOT_TRANSPARENT = NO
266+
DOT_MULTI_TARGETS = NO
267+
GENERATE_LEGEND = YES
268+
DOT_CLEANUP = YES

0 commit comments

Comments
 (0)