diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | docs/conf.py | 31 | ||||
| -rw-r--r-- | docs/index.rst | 13 | ||||
| -rw-r--r-- | requirements.txt | 3 | ||||
| -rw-r--r-- | source/CMakeLists.txt | 24 | ||||
| -rw-r--r-- | source/cmake/Modules/FindSphinx.cmake | 10 |
6 files changed, 80 insertions, 4 deletions
@@ -1,7 +1,8 @@ /.venv /build /.conan/install +/docs/_build # Conan Generated CMake presets CMakeUserPresets.json -.gdb_history
\ No newline at end of file +.gdb_history diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..90ed3dc --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,31 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "TeachOS Kernel" +copyright = "2023, Felix Morgner" +author = "Felix Morgner" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["breathe"] + +templates_path = ["_templates"] +exclude_patterns = [] + +# -- Options Breathe --------------------------------------------------------- +# https://breathe.readthedocs.io/en/stable/directives.html#config-values + +breathe_projects = {"kernel": "../build/doxygen/xml"} +breathe_default_project = "kernel" + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_book_theme" +html_static_path = [] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..44e7617 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,13 @@ +Welcome to TeachOS Kernel's documentation! +========================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/requirements.txt b/requirements.txt index 4479984..5468185 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,6 @@ black>=23 conan~=1.61 mypy~=1.5 +sphinx>=6,<7 +breathe~=4.35 +sphinx-book-theme~=1.0
\ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b2dc9f1..215dd39 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -24,13 +24,31 @@ find_package("Doxygen") set(DOXYGEN_GENERATE_HTML NO) set(DOXYGEN_GENERATE_XML YES) set(DOXYGEN_EXCLUDE_PATTERNS "*.cpp") -set(DOXYGEN_OUTPUT_DIRECTORY "doxygen-xml") +set(DOXYGEN_OUTPUT_DIRECTORY "doxygen") set(DOXYGEN_QUIET YES) +file(GLOB_RECURSE DOXYGEN_SOURCES CONFIGURE_DEPENDS "*.hpp") + doxygen_add_docs("docs" - ${PROJECT_SOURCE_DIR} + ${DOXYGEN_SOURCES} ALL - COMMENT "Generating source documentation" + USE_STAMP_FILE + COMMENT "Generating developer documentation sources" +) + +add_custom_command(TARGET "docs" + POST_BUILD + COMMAND "${SPHINX_BUILD_EXE}" + ARGS + "../docs" + "docs" + "-q" + COMMENT "Generating developer documentation html" +) + +set_target_properties("docs" PROPERTIES + ADDITIONAL_CLEAN_FILES + "${PROJECT_BINARY_DIR}/doxygen;${PROJECT_BINARY_DIR}/docs" ) #[============================================================================[ diff --git a/source/cmake/Modules/FindSphinx.cmake b/source/cmake/Modules/FindSphinx.cmake new file mode 100644 index 0000000..a0a1c31 --- /dev/null +++ b/source/cmake/Modules/FindSphinx.cmake @@ -0,0 +1,10 @@ +include("FindPackageHandleStandardArgs") + +find_program(SPHINX_BUILD_EXE "sphinx-build" + HINTS "${PROJECT_SOURCE_DIR}/../.venv/bin" +) + +find_package_handle_standard_args("Sphinx" + DEFAULT_MSG + SPHINX_BUILD_EXE +) |
