Skip to content

Commit ae78e90

Browse files
committed
feat: mkdocs
1 parent 671e857 commit ae78e90

6 files changed

Lines changed: 33 additions & 12 deletions

File tree

.github/workflows/documentation.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,23 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
apt install -y doxygen gource libgs-dev
32-
pip3 install jinja2 Pygments mkdocs-material mkdocs mkdocs-same-dir mkdocs-minify-plugin
32+
pip3 install jinja2 Pygments mkdocs-material mkdocs mkdocs-same-dir mkdocs-minify-plugin mkdocs-redirects mkdocs-exclude
33+
npm install
3334
3435
- name: Configure
3536
run: emcmake cmake -S. -Bbuild -DENABLE_TEST_COVERAGE=OFF -DENABLE_STANDALONE=ON -DENABLE_DOCUMENTATION=ON
3637

37-
- name: Build Docs
38-
run: cmake --build build --target GenerateDocs
38+
# - name: Build Docs
39+
# run: cmake --build build --target GenerateDocs
40+
#
41+
# - name: Build Emscripten
42+
# run: cmake --build build -j4 --config Release
3943

40-
- name: Build Emscripten
41-
run: cmake --build build -j4 --config Release
44+
- name: mkdocs
45+
run: mkdocs build
4246

4347
- name: COPY CNAME
44-
run: cp CNAME ./build/documentation/doxygen/html/
48+
run: cp CNAME ./site
4549

4650
# - name: Copy Emscripten build to docs
4751
# run: cp -R build/out/* build/documentation/doxygen/html/
@@ -50,4 +54,4 @@ jobs:
5054
uses: peaceiris/actions-gh-pages@v3
5155
with:
5256
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
publish_dir: ./build/documentation/doxygen/html
57+
publish_dir: ./site

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ cmake-*/
3838
out/
3939
build*/
4040
site/
41+
42+
# caches
43+
node_modules/
44+
package-lock.json

documentation/CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ include(../cmake/get_cpm.cmake)
99
CPMAddPackage("gh:mosra/m.css#0da03060e30a23c0e9e54b0e25b71e9d2733d616")
1010
# CPMAddPackage(NAME Concurrency SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
1111

12+
find_package(Doxygen)
13+
if(NOT DOXYGEN_FOUND)
14+
message(FATAL_ERROR "Doxygen need to be installed to generate the doxygen documentation")
15+
endif()
16+
1217
# ---- Doxygen variables ----
1318

1419
# set Doxyfile variables
@@ -19,12 +24,14 @@ set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
1924

2025
configure_file(${CMAKE_CURRENT_LIST_DIR}/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
2126

22-
configure_file(${CMAKE_CURRENT_LIST_DIR}/conf.py ${CMAKE_CURRENT_BINARY_DIR}/conf.py)
23-
2427
add_custom_target(
2528
GenerateDocs
26-
${CMAKE_COMMAND} -E make_directory "${DOXYGEN_OUTPUT_DIRECTORY}"
27-
COMMAND "${m.css_SOURCE_DIR}/documentation/doxygen.py" "${CMAKE_CURRENT_BINARY_DIR}/conf.py"
29+
# ${CMAKE_COMMAND} -E make_directory "${DOXYGEN_OUTPUT_DIRECTORY}"
30+
# COMMAND "${m.css_SOURCE_DIR}/documentation/doxygen.py" "${CMAKE_CURRENT_BINARY_DIR}/conf.py"
31+
# COMMAND doxygen ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
32+
# COMMAND moxygen --anchors --groups --output ${CMAKE_CURRENT_SOURCE_DIR}/api/api-%s.md ${DOXYGEN_OUTPUT_DIRECTORY}/xml
33+
COMMAND mkdocs
2834
COMMAND echo "Docs written to: ${DOXYGEN_OUTPUT_DIRECTORY}"
29-
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
35+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../"
36+
# WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
3037
)

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ plugins:
141141
- search:
142142
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
143143
- minify
144+
- exclude:
145+
glob:
146+
- node_modules/*
147+
- buildDocs/*
148+
- cmake-build-debug/*
144149

145150
extra:
146151
analytics:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@semantic-release/github": "^8.0.7",
4545
"@semantic-release/npm": "^9.0.1",
4646
"@semantic-release/release-notes-generator": "^10.0.3",
47+
"moxygen": "^0.8.0",
4748
"rimraf": "^3.0.2"
4849
},
4950
"release": {

0 commit comments

Comments
 (0)