Skip to content

Commit c8cc3ac

Browse files
committed
Initiating some documentation using Doxygen & Sphinx
1 parent 5bef419 commit c8cc3ac

11 files changed

+3081
-1
lines changed

.github/workflows/unix.yml

+27-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
formatting:
1111
runs-on: ubuntu-24.04
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414

1515
- name: Install clang-format
1616
env:
@@ -135,3 +135,29 @@ jobs:
135135
- name: Run Tests Valgrind
136136
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-12'
137137
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/utl-test
138+
139+
doc:
140+
runs-on: ubuntu-latest
141+
steps:
142+
- name: Checkout 🛎️
143+
uses: actions/checkout@v4
144+
- name: Set up Python 3.13 🔧
145+
uses: actions/setup-python@v5
146+
with:
147+
python-version: 3.13
148+
- name: Install doxygen 🔧
149+
uses: ssciwr/doxygen-install@v1
150+
with:
151+
version: "1.13.2"
152+
- name: Install Python dependencies ⚙️
153+
run: pip install -r docs/requirements.txt
154+
- name: Generate HTML documentation 🏗️
155+
run: |
156+
mkdir -p public/
157+
158+
- name: Deploy documentation 🚀
159+
if: github.ref == 'refs/heads/master'
160+
uses: peaceiris/actions-gh-pages@v3
161+
with:
162+
github_token: ${{ secrets.GITHUB_TOKEN }}
163+
publish_dir: public/

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
*.sublime-*
33
/.idea
44
/deps
5+
/docs/html
6+
/docs/xml
57
/.vscode
8+
_build/
69
.clang-tidy

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ target_link_libraries(utl-test utl gtest gmock gtest_main)
2929
if (NOT MSVC)
3030
target_compile_options(utl-test PRIVATE -Wall -Wextra -Werror)
3131
endif()
32+
33+
add_subdirectory ("docs")

docs/CMakeLists.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
find_package(Doxygen REQUIRED)
2+
3+
# Find all the public headers
4+
get_target_property(UTL_PUBLIC_HEADER_DIR utl INTERFACE_INCLUDE_DIRECTORIES)
5+
file(GLOB_RECURSE UTL_PUBLIC_HEADERS ${UTL_PUBLIC_HEADER_DIR}/*.h)
6+
7+
#This will be the main output of our command
8+
set(DOXYGEN_INDEX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/html/index.html)
9+
10+
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
11+
DEPENDS ${UTL_PUBLIC_HEADERS}
12+
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
13+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
14+
MAIN_DEPENDENCY Doxyfile
15+
COMMENT "Generating docs")
16+
17+
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})

0 commit comments

Comments
 (0)