From cd226924891f77a87c95a4da2aef16f289b57d66 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 10:15:40 +0700 Subject: [PATCH 01/15] build: add support to generate XML docs with Doxygen --- error/CMakeLists.txt | 7 +++++++ error/cmake/add_xml_docs.cmake | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 error/cmake/add_xml_docs.cmake diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt index d9b4656..3f948da 100644 --- a/error/CMakeLists.txt +++ b/error/CMakeLists.txt @@ -17,6 +17,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) option(CHECK_FORMAT "Enable source code formatting check" OFF) option(CHECK_WARNING "Enable static analysis warning check" OFF) option(CHECK_COVERAGE "Enable test coverage check" OFF) + option(BUILD_DOCS "Enable documentations build" OFF) # Import Format.cmake to format source code if(CHECK_FORMAT) @@ -56,4 +57,10 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) target_link_options(${TARGET} PRIVATE --coverage) endif() endforeach() + + # Build XML documentation + if(BUILD_DOCS) + include(cmake/add_xml_docs.cmake) + add_xml_docs(error_docs include) + endif() endif() diff --git a/error/cmake/add_xml_docs.cmake b/error/cmake/add_xml_docs.cmake new file mode 100644 index 0000000..554705b --- /dev/null +++ b/error/cmake/add_xml_docs.cmake @@ -0,0 +1,15 @@ +# A function that creates XML documentation with the specified target name. +function(add_xml_docs targetName) + # Try to find Doxygen + find_package(Doxygen) + if(DOXYGEN_FOUND) + # Configure Doxygen to generate XML documentation + set(DOXYGEN_GENERATE_HTML NO) + set(DOXYGEN_GENERATE_XML YES) + + # Generate Doxygen documentation + doxygen_add_docs(${targetName} ${ARGN} ALL) + else() + message(WARNING "Could not found Doxygen!") + endif() +endfunction() From 5db240523e0ed036907a0c92dab1a5f3fd12d085 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 10:36:17 +0700 Subject: [PATCH 02/15] build: modify `add_xml_docs` function to `target_generate_xml_docs` --- error/CMakeLists.txt | 4 ++-- error/cmake/add_xml_docs.cmake | 15 --------------- error/cmake/target_generate_xml_docs.cmake | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 error/cmake/add_xml_docs.cmake create mode 100644 error/cmake/target_generate_xml_docs.cmake diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt index 3f948da..0237331 100644 --- a/error/CMakeLists.txt +++ b/error/CMakeLists.txt @@ -60,7 +60,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) # Build XML documentation if(BUILD_DOCS) - include(cmake/add_xml_docs.cmake) - add_xml_docs(error_docs include) + include(cmake/target_generate_xml_docs.cmake) + target_generate_xml_docs(error) endif() endif() diff --git a/error/cmake/add_xml_docs.cmake b/error/cmake/add_xml_docs.cmake deleted file mode 100644 index 554705b..0000000 --- a/error/cmake/add_xml_docs.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# A function that creates XML documentation with the specified target name. -function(add_xml_docs targetName) - # Try to find Doxygen - find_package(Doxygen) - if(DOXYGEN_FOUND) - # Configure Doxygen to generate XML documentation - set(DOXYGEN_GENERATE_HTML NO) - set(DOXYGEN_GENERATE_XML YES) - - # Generate Doxygen documentation - doxygen_add_docs(${targetName} ${ARGN} ALL) - else() - message(WARNING "Could not found Doxygen!") - endif() -endfunction() diff --git a/error/cmake/target_generate_xml_docs.cmake b/error/cmake/target_generate_xml_docs.cmake new file mode 100644 index 0000000..ebfafab --- /dev/null +++ b/error/cmake/target_generate_xml_docs.cmake @@ -0,0 +1,22 @@ +# A function that generates XML documentation from the specified target. +function(target_generate_xml_docs TARGET) + # Try to find Doxygen + find_package(Doxygen) + if(DOXYGEN_FOUND) + # Configure Doxygen to generate XML documentation + set(DOXYGEN_GENERATE_HTML NO) + set(DOXYGEN_GENERATE_XML YES) + + # Get include directories of the target + foreach(PROP INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES) + get_target_property(TARGET_INCLUDE_DIRS ${TARGET} ${PROP}) + list(APPEND INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}) + endforeach() + + # Generate XML documentation from the target + doxygen_add_docs(${TARGET}_docs ${INCLUDE_DIRS}) + add_dependencies(${TARGET} ${TARGET}_docs) + else() + message(WARNING "Could not found Doxygen!") + endif() +endfunction() From 13fc4f21b5ed799d73ce40cc86936a432f804ba4 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 12:16:26 +0700 Subject: [PATCH 03/15] build: use file glob to trigger XML docs generation --- error/cmake/target_generate_xml_docs.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/error/cmake/target_generate_xml_docs.cmake b/error/cmake/target_generate_xml_docs.cmake index ebfafab..2d9938f 100644 --- a/error/cmake/target_generate_xml_docs.cmake +++ b/error/cmake/target_generate_xml_docs.cmake @@ -10,11 +10,20 @@ function(target_generate_xml_docs TARGET) # Get include directories of the target foreach(PROP INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES) get_target_property(TARGET_INCLUDE_DIRS ${TARGET} ${PROP}) - list(APPEND INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}) + if(NOT "${TARGET_INCLUDE_DIRS}" STREQUAL "TARGET_INCLUDE_DIRS-NOTFOUND") + list(APPEND INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}) + endif() endforeach() + list(REMOVE_DUPLICATES INCLUDE_DIRS) - # Generate XML documentation from the target - doxygen_add_docs(${TARGET}_docs ${INCLUDE_DIRS}) + # Get header files from the include directories + foreach(DIR ${TARGET_INCLUDE_DIRS}) + file(GLOB_RECURSE FILES CONFIGURE_DEPENDS "${DIR}/*") + list(APPEND HEADER_FILES ${FILES}) + endforeach() + + # Generate XML documentation for the target + doxygen_add_docs(${TARGET}_docs ${HEADER_FILES} USE_STAMP_FILE) add_dependencies(${TARGET} ${TARGET}_docs) else() message(WARNING "Could not found Doxygen!") From 1e4ac70f493cdb1d162f6e0a8083bb29089b7f1f Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 12:28:45 +0700 Subject: [PATCH 04/15] ci: add a job in the `build.yml` workflow for generating documentation --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0ca665..239841c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,3 +95,23 @@ jobs: source-dir: ${{ matrix.package }} cxx-compiler: cl run-build: true + + docs: + runs-on: ubuntu-latest + strategy: + matrix: + package: [error] + steps: + - name: Checkout repository + uses: actions/checkout@v3.5.3 + + - name: Install requirements + run: | + sudo apt-get install -y doxygen + + - name: Configure and build documentation + uses: threeal/cmake-action@v1.2.0 + with: + source-dir: ${{ matrix.package }} + options: BUILD_DOCS=ON + run-build: true From 34a309eb3c78e9a1a9807fbf09a01d69155bac60 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 12:55:21 +0700 Subject: [PATCH 05/15] build: add support to auto-install doxygen if not found --- .github/workflows/build.yml | 4 ---- error/cmake/target_generate_xml_docs.cmake | 20 +++++++++++++++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 239841c..47afced 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,10 +105,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3.5.3 - - name: Install requirements - run: | - sudo apt-get install -y doxygen - - name: Configure and build documentation uses: threeal/cmake-action@v1.2.0 with: diff --git a/error/cmake/target_generate_xml_docs.cmake b/error/cmake/target_generate_xml_docs.cmake index 2d9938f..6229475 100644 --- a/error/cmake/target_generate_xml_docs.cmake +++ b/error/cmake/target_generate_xml_docs.cmake @@ -1,5 +1,21 @@ -# A function that generates XML documentation from the specified target. +# A function that generates XML documentation for the specified target. function(target_generate_xml_docs TARGET) + # Try to install Doxygen if not found + find_program(DOXYGEN_PROGRAM doxygen) + if(NOT DOXYGEN_PROGRAM) + find_program(APT_GET_PROGRAM apt-get) + if(APT_GET_PROGRAM) + message(STATUS "Doxygen could not be found, installing...") + execute_process(COMMAND ${APT_GET_PROGRAM} install -y doxygen) + endif() + + find_program(BREW_PROGRAM brew) + if(BREW_PROGRAM) + message(STATUS "Doxygen could not be found, installing...") + execute_process(COMMAND ${BREW_PROGRAM} install doxygen) + endif() + endif() + # Try to find Doxygen find_package(Doxygen) if(DOXYGEN_FOUND) @@ -25,7 +41,5 @@ function(target_generate_xml_docs TARGET) # Generate XML documentation for the target doxygen_add_docs(${TARGET}_docs ${HEADER_FILES} USE_STAMP_FILE) add_dependencies(${TARGET} ${TARGET}_docs) - else() - message(WARNING "Could not found Doxygen!") endif() endfunction() From bee807a5151eb35057d6e9a72f0afd04520d29e4 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 13:07:11 +0700 Subject: [PATCH 06/15] build: modify `target_generate_xml_docs` to `add_xml_docs` function --- .github/workflows/build.yml | 6 ++- error/CMakeLists.txt | 4 +- error/cmake/add_xml_docs.cmake | 30 +++++++++++++++ error/cmake/target_generate_xml_docs.cmake | 45 ---------------------- 4 files changed, 36 insertions(+), 49 deletions(-) create mode 100644 error/cmake/add_xml_docs.cmake delete mode 100644 error/cmake/target_generate_xml_docs.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47afced..5223e55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,9 +105,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3.5.3 - - name: Configure and build documentation + - name: Configure project uses: threeal/cmake-action@v1.2.0 with: source-dir: ${{ matrix.package }} options: BUILD_DOCS=ON - run-build: true + + - name: Build documentation + run: cmake --build ${{ matrix.package }}/build --target docs diff --git a/error/CMakeLists.txt b/error/CMakeLists.txt index 0237331..2269aa9 100644 --- a/error/CMakeLists.txt +++ b/error/CMakeLists.txt @@ -60,7 +60,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) # Build XML documentation if(BUILD_DOCS) - include(cmake/target_generate_xml_docs.cmake) - target_generate_xml_docs(error) + include(cmake/add_xml_docs.cmake) + add_xml_docs(docs include/error/error.hpp) endif() endif() diff --git a/error/cmake/add_xml_docs.cmake b/error/cmake/add_xml_docs.cmake new file mode 100644 index 0000000..7d1cebc --- /dev/null +++ b/error/cmake/add_xml_docs.cmake @@ -0,0 +1,30 @@ +# A function that generates XML documentation from the specified source files. +function(add_xml_docs TARGET_NAME) + # Try to install Doxygen if not found + find_program(DOXYGEN_PROGRAM doxygen) + if(NOT DOXYGEN_PROGRAM) + find_program(APT_GET_PROGRAM apt-get) + if(APT_GET_PROGRAM) + message(STATUS "Doxygen could not be found, installing...") + execute_process(COMMAND ${APT_GET_PROGRAM} install -y doxygen) + endif() + + find_program(BREW_PROGRAM brew) + if(BREW_PROGRAM) + message(STATUS "Doxygen could not be found, installing...") + execute_process(COMMAND ${BREW_PROGRAM} install doxygen) + endif() + endif() + + # Try to find Doxygen + find_package(Doxygen) + if(DOXYGEN_FOUND) + # Configure Doxygen to generate XML documentation + set(DOXYGEN_GENERATE_HTML NO) + set(DOXYGEN_GENERATE_XML YES) + set(DOXYGEN_XML_OUTPUT ${TARGET_NAME}) + + # Generate XML documentation for the target + doxygen_add_docs(${TARGET_NAME} ${ARGN} USE_STAMP_FILE) + endif() +endfunction() diff --git a/error/cmake/target_generate_xml_docs.cmake b/error/cmake/target_generate_xml_docs.cmake deleted file mode 100644 index 6229475..0000000 --- a/error/cmake/target_generate_xml_docs.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# A function that generates XML documentation for the specified target. -function(target_generate_xml_docs TARGET) - # Try to install Doxygen if not found - find_program(DOXYGEN_PROGRAM doxygen) - if(NOT DOXYGEN_PROGRAM) - find_program(APT_GET_PROGRAM apt-get) - if(APT_GET_PROGRAM) - message(STATUS "Doxygen could not be found, installing...") - execute_process(COMMAND ${APT_GET_PROGRAM} install -y doxygen) - endif() - - find_program(BREW_PROGRAM brew) - if(BREW_PROGRAM) - message(STATUS "Doxygen could not be found, installing...") - execute_process(COMMAND ${BREW_PROGRAM} install doxygen) - endif() - endif() - - # Try to find Doxygen - find_package(Doxygen) - if(DOXYGEN_FOUND) - # Configure Doxygen to generate XML documentation - set(DOXYGEN_GENERATE_HTML NO) - set(DOXYGEN_GENERATE_XML YES) - - # Get include directories of the target - foreach(PROP INCLUDE_DIRECTORIES INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(TARGET_INCLUDE_DIRS ${TARGET} ${PROP}) - if(NOT "${TARGET_INCLUDE_DIRS}" STREQUAL "TARGET_INCLUDE_DIRS-NOTFOUND") - list(APPEND INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}) - endif() - endforeach() - list(REMOVE_DUPLICATES INCLUDE_DIRS) - - # Get header files from the include directories - foreach(DIR ${TARGET_INCLUDE_DIRS}) - file(GLOB_RECURSE FILES CONFIGURE_DEPENDS "${DIR}/*") - list(APPEND HEADER_FILES ${FILES}) - endforeach() - - # Generate XML documentation for the target - doxygen_add_docs(${TARGET}_docs ${HEADER_FILES} USE_STAMP_FILE) - add_dependencies(${TARGET} ${TARGET}_docs) - endif() -endfunction() From cc3f7bc83cc2df9182e65a83d90680dba0b1eab6 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 13:25:51 +0700 Subject: [PATCH 07/15] build: use `sudo` when tried to install Doxygen --- error/cmake/add_xml_docs.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/error/cmake/add_xml_docs.cmake b/error/cmake/add_xml_docs.cmake index 7d1cebc..dfd02c3 100644 --- a/error/cmake/add_xml_docs.cmake +++ b/error/cmake/add_xml_docs.cmake @@ -6,7 +6,7 @@ function(add_xml_docs TARGET_NAME) find_program(APT_GET_PROGRAM apt-get) if(APT_GET_PROGRAM) message(STATUS "Doxygen could not be found, installing...") - execute_process(COMMAND ${APT_GET_PROGRAM} install -y doxygen) + execute_process(COMMAND sudo ${APT_GET_PROGRAM} install -y doxygen) endif() find_program(BREW_PROGRAM brew) From 154f9e377cac9b02c169f27a2cc47888c78dc109 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 13:39:19 +0700 Subject: [PATCH 08/15] docs: initialize documentation with Sphinx --- docs/_static/.gitkeep | 0 docs/conf.py | 8 ++++++++ docs/index.rst | 11 +++++++++++ docs/requirements.txt | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 docs/_static/.gitkeep create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/requirements.txt diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..165b86c --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,8 @@ +import os, subprocess + +project = 'cpp' +copyright = '2023, Alfi Maulana' +author = 'Alfi Maulana' + +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..4ab767b --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,11 @@ +Overview +======== + +|build_status_badge|_ + +A comprehensive collection of `C++`_ utility packages. + +.. |build_status_badge| image:: https://img.shields.io/github/actions/workflow/status/threeal/cpp/build.yml?branch=main +.. _build_status_badge: https://github.com/threeal/cpp/actions/workflows/build.yml + +.. _C++: https://isocpp.org diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..cbf1e36 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx +sphinx-rtd-theme From ad222fa58ce8c71fbeec229b1db92f37cdf1d644 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 13:41:46 +0700 Subject: [PATCH 09/15] docs: use Breathe to integrate Doxygen docs into Sphinx --- docs/conf.py | 8 ++++++++ docs/requirements.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 165b86c..1656c40 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,5 +4,13 @@ copyright = '2023, Alfi Maulana' author = 'Alfi Maulana' +extensions = ['breathe'] + +subprocess.call('cmake ../error -B ../error/build -D BUILD_DOCS=ON', shell=True) +subprocess.call('cmake --build ../error/build --target docs', shell=True) + +breathe_projects = {"error": "../error/build/docs"} +breathe_default_project = "error" + html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] diff --git a/docs/requirements.txt b/docs/requirements.txt index cbf1e36..28179ea 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,2 +1,3 @@ +breathe sphinx sphinx-rtd-theme From ecf3718467cb763374e6ad677894c9096f5f446d Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 13:42:48 +0700 Subject: [PATCH 10/15] ci: modify `docs` job to build documentation using Sphinx --- .github/workflows/build.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5223e55..253342c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,18 +98,12 @@ jobs: docs: runs-on: ubuntu-latest - strategy: - matrix: - package: [error] steps: - name: Checkout repository uses: actions/checkout@v3.5.3 - - name: Configure project - uses: threeal/cmake-action@v1.2.0 - with: - source-dir: ${{ matrix.package }} - options: BUILD_DOCS=ON + - name: Install dependencies + run: pip3 install -r docs/requirements.txt - name: Build documentation - run: cmake --build ${{ matrix.package }}/build --target docs + run: sphinx-build -b html docs build/docs -W --keep-going From 067862fcbe583f53b8959a888be2f2fcdf0ea44c Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 14:05:11 +0700 Subject: [PATCH 11/15] docs: add page that contains the API docs of the Error package --- docs/error/index.rst | 15 +++++++++++++++ docs/index.rst | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 docs/error/index.rst diff --git a/docs/error/index.rst b/docs/error/index.rst new file mode 100644 index 0000000..65a2e01 --- /dev/null +++ b/docs/error/index.rst @@ -0,0 +1,15 @@ +Error Package +============= + +A C++ package that provides utilities for error handling. + +.. doxygenfunction:: error::make + +.. doxygenfunction:: error::format + +.. doxygenstruct:: error::Error + :members: + +.. doxygenfunction:: error::operator== + +.. doxygenfunction:: error::operator!= diff --git a/docs/index.rst b/docs/index.rst index 4ab767b..7863d1a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,3 +9,11 @@ A comprehensive collection of `C++`_ utility packages. .. _build_status_badge: https://github.com/threeal/cpp/actions/workflows/build.yml .. _C++: https://isocpp.org + +Packages +-------- + +.. toctree:: + :maxdepth: 1 + + error/index.rst From 82b438769cbbf01fc731dfcb1744ad2277830661 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 14:12:02 +0700 Subject: [PATCH 12/15] docs: add license section in the documentation --- docs/error/index.rst | 36 ++++++++++++++++++++++++++++++++++++ docs/index.rst | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/docs/error/index.rst b/docs/error/index.rst index 65a2e01..20173cd 100644 --- a/docs/error/index.rst +++ b/docs/error/index.rst @@ -3,6 +3,9 @@ Error Package A C++ package that provides utilities for error handling. +API Docs +-------- + .. doxygenfunction:: error::make .. doxygenfunction:: error::format @@ -13,3 +16,36 @@ A C++ package that provides utilities for error handling. .. doxygenfunction:: error::operator== .. doxygenfunction:: error::operator!= + +License +------- + +.. image:: https://opensource.org/wp-content/uploads/2022/10/osi-badge-dark.svg + :width: 150 + :align: right + :target: https://opensource.org/licenses + +This project is licensed under the terms of the `MIT License`_. + +Copyright © 2023 `Alfi Maulana`_ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +.. _Alfi Maulana: https://github.com/threeal +.. _MIT License: https://opensource.org/licenses/MIT diff --git a/docs/index.rst b/docs/index.rst index 7863d1a..81c1dea 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,3 +17,36 @@ Packages :maxdepth: 1 error/index.rst + +License +------- + +.. image:: https://opensource.org/wp-content/uploads/2022/10/osi-badge-dark.svg + :width: 150 + :align: right + :target: https://opensource.org/licenses + +This project is licensed under the terms of the `MIT License`_. + +Copyright © 2023 `Alfi Maulana`_ + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +.. _Alfi Maulana: https://github.com/threeal +.. _MIT License: https://opensource.org/licenses/MIT From a8a83a275b0b9cdd7b46731b571e042a61fdea68 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 14:13:33 +0700 Subject: [PATCH 13/15] docs: remove build badge in the documentation --- docs/index.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 81c1dea..816a30a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,13 +1,8 @@ Overview ======== -|build_status_badge|_ - A comprehensive collection of `C++`_ utility packages. -.. |build_status_badge| image:: https://img.shields.io/github/actions/workflow/status/threeal/cpp/build.yml?branch=main -.. _build_status_badge: https://github.com/threeal/cpp/actions/workflows/build.yml - .. _C++: https://isocpp.org Packages From 08db1e4d62e51a2b65b39d336d9e3d5b31e9702a Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 15:32:30 +0700 Subject: [PATCH 14/15] ci: upload docs as artifact in the workflow --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 253342c..8edc0fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,3 +107,9 @@ jobs: - name: Build documentation run: sphinx-build -b html docs build/docs -W --keep-going + + - name: Upload documentation as artifact + uses: actions/upload-artifact@v3.1.2 + with: + name: docs + path: build/docs From 8f39251ff1f4fde8b60ab3f20ba6449754fbba9d Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 10 Jul 2023 15:37:36 +0700 Subject: [PATCH 15/15] ci: add readthedocs configuration --- .gitignore | 1 + .readthedocs.yaml | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.gitignore b/.gitignore index ee3c7e0..6ab56e3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ !.clang* !.cmake* !.git* +!.readthedocs* build diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..a376b46 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,10 @@ +version: 2 +build: + os: ubuntu-22.04 + tools: + python: "3.9" +sphinx: + configuration: docs/conf.py +python: + install: + - requirements: docs/requirements.txt