Skip to content

Commit

Permalink
doc: Use the doxygen awesome theme (#2807)
Browse files Browse the repository at this point in the history
* chore: remove cppreference

* feat: add doxyfile

* feat: add doxygen-awesome theme

* chore: remove unneccessary doxygen config form cmake

* test: for doxygen test purposes

Note: revert before merging to main

* fix: try removing css from rm

* fix: set style sheet via cmake

* feat: make doxygen theme finally work

* fix: remove mathjax from doxyfile

* feat: add  sidebar and make mathjax work

* doc: add transparency and make output svg of dot

* fix: make dots interactive

* chore: move math jax from cmake to doxyfile

* feat: add header file

* chore: add header file to cmake

* chore: remove redundant transparency config

* fix: force cmake to use config file

* chore: remove working directory

* fix: use old add_docs command

* feat: fix doxygen build

* fix: re enable clang assited parsing

* fix: use relative paths

* fix: relative paths arent necessary

* feat: add project logo and favicon

* fix: revert gh-pages to master

* fix: add dot to doxyfile

* fix: add lib clang to doxygen

* fix: use source browser

* fix: add clang as compiler

* docs: remove headers from source browser

* revert: branch to master
  • Loading branch information
realstealthninja authored Nov 4, 2024
1 parent 0d766b0 commit 8b1eab2
Show file tree
Hide file tree
Showing 8 changed files with 5,707 additions and 35,517 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Doxygen CI

on:
on:
push:
branches: [master]

Expand All @@ -15,7 +15,7 @@ jobs:
run: |
brew install graphviz ninja doxygen
- name: configure
run: cmake -G Ninja -B ./build -S .
run: cmake -G Ninja -Duse_libclang=ON -DCMAKE_CXX_COMPILER=clang++ -B ./build -S .
- name: build
run: cmake --build build -t doc
- name: gh-pages
Expand All @@ -28,7 +28,7 @@ jobs:
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
rm -rf d* && rm *.html && rm *.svg && rm *.map && rm *.md5 && rm *.png && rm *.js && rm *.css
rm -rf d* && rm *.html && rm *.svg && rm *.map && rm *.md5 && rm *.png && rm *.js
git add .
cp -rp ./build/html/* . && rm -rf ./build && ls -lah
git add .
Expand Down
33 changes: 8 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.22)
project(Algorithms_in_C++
project(TheAlgorithms/C++
LANGUAGES CXX
VERSION 1.0.0
DESCRIPTION "Set of algorithms implemented in C++."
Expand Down Expand Up @@ -54,47 +54,30 @@ add_subdirectory(physics)

cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW)

find_package(Doxygen OPTIONAL_COMPONENTS dot dia)
if(DOXYGEN_FOUND)
set(DOXYGEN_GENERATE_MAN NO)
set(DOXYGEN_USE_MATHJAX YES)
set(DOXYGEN_GENERATE_HTML YES)
# set(DOXYGEN_HTML_TIMESTAMP YES)
set(DOXYGEN_EXTRACT_STATIC YES)
set(DOXYGEN_INLINE_SOURCES YES)
set(DOXYGEN_CREATE_SUBDIRS YES)
set(DOXYGEN_EXTRACT_PRIVATE YES)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_STRIP_CODE_COMMENTS NO)
set(DOXYGEN_EXT_LINKS_IN_WINDOW YES)
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
set(DOXYGEN_EXCLUDE_PATTERNS */build/*)
set(DOXYGEN_ENABLE_PREPROCESSING YES)
set(DOXYGEN_CLANG_ASSISTED_PARSING YES)
set(DOXYGEN_FILE_PATTERNS *.cpp *.h *.hpp *.md)
set(DOXYGEN_MATHJAX_EXTENSIONS TeX/AMSmath TeX/AMSsymbols)
set(DOXYGEN_TAGFILES "doc/cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/")
if(DOXYGEN_FOUND)
if(MSVC)
set(DOXYGEN_CPP_CLI_SUPPORT YES)
endif()
set(DOXYGEN_MATHJAX_RELPATH "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML")

if(Doxygen_dot_FOUND)
set(DOXYGEN_HAVE_DOT YES)
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_INTERACTIVE_SVG YES)
set(DOXYGEN_DOT_IMAGE_FORMAT "svg")
endif()

if(OPENMP_FOUND)
set(DOXYGEN_PREDEFINED "_OPENMP=1")
endif()

if(GLUT_FOUND)
set(DOXYGEN_PREDEFINED ${DOXYGEN_PREDEFINED} "GLUT_FOUND=1")
endif()

doxygen_add_docs(
doc
${PROJECT_SOURCE_DIR}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate documentation"
CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile
)
endif()

Expand Down
Loading

0 comments on commit 8b1eab2

Please sign in to comment.