Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b2ce84

Browse files
authored
Sphinx documentation (#174)
1 parent aa8a0ee commit 7b2ce84

File tree

13 files changed

+270
-10
lines changed

13 files changed

+270
-10
lines changed

.github/workflows/pages.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Set a branch name to trigger deployment
7+
8+
env:
9+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
10+
BUILD_TYPE: Release
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
submodules: true
19+
20+
- name: Setup
21+
run: |
22+
sudo apt-get install ninja-build doxygen graphviz python3-sphinx
23+
pip install breathe sphinx_rtd_theme furo
24+
25+
- name: Configure CMake
26+
shell: bash
27+
working-directory: ${{github.workspace}}
28+
run: |
29+
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILDCC_DOCUMENTATION=ON
30+
31+
- name: Build
32+
working-directory: ${{github.workspace}}
33+
shell: bash
34+
run: cmake --build build --config $BUILD_TYPE
35+
36+
- name: Doxygen + Sphinx
37+
working-directory: ${{github.workspace}}/build
38+
shell: bash
39+
run: |
40+
cmake --build . --target doxygen_documentation
41+
cmake --build . --target sphinx_documentation
42+
43+
- name: Deploy
44+
uses: peaceiris/actions-gh-pages@v3
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
publish_dir: ./docs/output

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _deps
1717
.vs/
1818
.idea/
1919
.cache/
20+
docs/output
2021

2122
# Files
2223
*.gcov

CMakePresets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"BUILDCC_TESTING": true,
2828
"BUILDCC_CLANGTIDY": true,
2929
"BUILDCC_CPPCHECK": true,
30-
"BUILDCC_DOCUMENTATION": true,
30+
"BUILDCC_DOCUMENTATION": false,
3131
"BUILDCC_NO_DEPRECATED": false
3232
}
3333
},
@@ -52,7 +52,7 @@
5252
"BUILDCC_TESTING": true,
5353
"BUILDCC_CLANGTIDY": true,
5454
"BUILDCC_CPPCHECK": true,
55-
"BUILDCC_DOCUMENTATION": true,
55+
"BUILDCC_DOCUMENTATION": false,
5656
"BUILDCC_NO_DEPRECATED": false
5757
}
5858
},
@@ -77,7 +77,7 @@
7777
"BUILDCC_TESTING": true,
7878
"BUILDCC_CLANGTIDY": true,
7979
"BUILDCC_CPPCHECK": true,
80-
"BUILDCC_DOCUMENTATION": true,
80+
"BUILDCC_DOCUMENTATION": false,
8181
"BUILDCC_NO_DEPRECATED": false
8282
}
8383
},

cmake/tool/doxygen.cmake

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@ if (${BUILDCC_DOCUMENTATION})
99
*test/*
1010
*mock/*
1111
)
12-
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
1312
set(DOXYGEN_EXTRACT_ALL YES)
14-
set(DOXYGEN_MARKDOWN_SUPPORT YES)
15-
set(DOXYGEN_WARN_IF_UNDOCUMENTED NO)
16-
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
13+
set(DOXYGEN_WARN_IF_UNDOCUMENTED YES)
14+
set(DOXYGEN_GENERATE_XML YES)
1715
doxygen_add_docs(doxygen_documentation
18-
${CMAKE_CURRENT_SOURCE_DIR}/README.md
19-
${CMAKE_CURRENT_SOURCE_DIR}/TODO.md
20-
${CMAKE_CURRENT_SOURCE_DIR}/example/README.md
2116
${CMAKE_CURRENT_SOURCE_DIR}/buildcc
2217
COMMENT "Doxygen documentation"
2318
)
19+
20+
find_program(sphinx_build
21+
NAMES "sphinx-build"
22+
REQUIRED
23+
)
24+
add_custom_target(sphinx_documentation
25+
COMMAND ${sphinx_build} -b html -Dbreathe_projects.buildcc_documentation=${CMAKE_CURRENT_BINARY_DIR}/xml . ../output
26+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/source
27+
VERBATIM USES_TERMINAL
28+
)
2429
endif()

docs/source/arch/design_patterns.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Design Patterns
2+
===============

docs/source/arch/namespaces.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Namespaces
2+
==========

docs/source/arch/outputs.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Outputs
2+
=======

docs/source/arch/project_layout.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Project Layout
2+
==============
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Software Heirarchy
2+
==================

docs/source/arch/testing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Testing
2+
=======

0 commit comments

Comments
 (0)