diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml new file mode 100644 index 0000000..2ea11b8 --- /dev/null +++ b/.github/workflows/build_docs.yml @@ -0,0 +1,17 @@ +name: Build docs + +on: + push: + pull_request: + paths: + - docs/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + makers-devops: + uses: Infineon/makers-devops/.github/workflows/docs_build.yml@main + with: + doxy-required: true diff --git a/README.md b/README.md index a80667e..6b19b1b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Smart High-Side Switch +[![Build docs](https://github.com/Infineon/high-side-switch/actions/workflows/build_docs.yml/badge.svg)](https://github.com/Infineon/high-side-switch/actions/workflows/build_docs.yml) + C++ library for Infineon's Arduino shields for **PROFETâ„¢ Smart High-Side Power Switches** Automotive grade ## Supported Products @@ -50,4 +52,4 @@ The complete documentation of the library as well as detailed information about ## License -This project is licensed under the MIT License - click [here](https://github.com/Infineon/high-side-switch/blob/master/LICENSE) for details. \ No newline at end of file +This project is licensed under the MIT License - click [here](https://github.com/Infineon/high-side-switch/blob/master/LICENSE) for details. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..7026f8e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,21 @@ + +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 4317f1a..bdea85f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,21 +30,8 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -#... - -# At top on conf.py (with other import statements) -# import recommonmark -# from recommonmark.transform import AutoStructify - -# # At the bottom of conf.py -# def setup(app): -# app.add_config_value('recommonmark_config', { -# 'url_resolver': lambda url: github_doc_root + url, -# 'auto_toc_tree_section': 'Contents', -# }, True) -# app.add_transform(AutoStructify) - extensions = [ + 'sphinx_rtd_theme', 'sphinx.ext.autodoc', 'sphinxemoji.sphinxemoji', 'sphinx_tabs.tabs', @@ -60,17 +47,12 @@ 'sphinx.ext.inheritance_diagram', 'breathe', 'exhale' - ] autosectionlabel_prefix_document = True -# source_parsers = { -# '.md': 'recommonmark.parser.CommonMarkParser', -# } source_suffix = [ '.rst', - # '.md' ] suppress_warnings = ['autosectionlabel.*', 'epub.duplicated_toc_entry'] @@ -84,32 +66,24 @@ "doxygenStripFromPath": "..", # Suggested optional arguments "createTreeView": True, - # TIP: if using the sphinx-bootstrap-theme, you need - # "treeViewIsBootstrap": True, "exhaleExecutesDoxygen": True, - # "exhaleUseDoxyfile" : True, "exhaleDoxygenStdin": textwrap.dedent(''' - INPUT = ../src + INPUT = ../src GENERATE_LATEX = NO - GENERATE_HTML = YES + GENERATE_HTML = NO GENERATE_XML = YES RECURSIVE = YES - VERBATIM_HEADERS = NO - EXCLUDE = ./../src/framework/raspberrypi/examples ./../src/framework/raspberrypi/examples_py ./../src/framework/arduino/examples ./../src/framework/arduino/README.md + VERBATIM_HEADERS = YES '''), # Configure what not to show in the API index page "unabridgedOrphanKinds": {"function", "define", "dir","file", "variable", "namespace"}, "fullToctreeMaxDepth" : 4 - } # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] -# Tell sphinx what the primary language being documented is. -primary_domain = 'cpp' - # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. @@ -121,13 +95,8 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. - -html_theme = 'sphinx_rtd_theme' -# html_theme_options = { -# "head_font_family" : "Source Sans Pro", -# "font_family" : "Source Sans Pro", -# "body_text_align" : "justify", -# } +# +html_theme = "sphinx_rtd_theme" html_logo = 'img/ifx_logo_white_green_s.png' @@ -142,4 +111,4 @@ "High-Side Switch": "build/xml/" } breathe_default_project = "High-Side Switch" -breathe_default_members = ('members', 'undoc-members') \ No newline at end of file +breathe_default_members = ('members', 'undoc-members') diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..7b5d91f --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 790202b..1a6e7f4 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,8 +1,9 @@ -sphinx>=7.2.6 -sphinx-rtd-theme>=0.5.0 -sphinx-sitemap>=2.2.0 -recommonmark>=0.6.0 -sphinxemoji>=0.1.8 +sphinx +sphinx-rtd-theme +sphinx-sitemap +recommonmark +sphinxemoji sphinx-tabs -breathe>=4.13.0 +breathe exhale +