Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Sphinx for documentation #801

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/sphinx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Documentation

on: [push, pull_request]

jobs:
sphinx:
runs-on: ubuntu-22.04

steps:
- name: Checkout code including full history and submodules
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Install dependencies from APT repository
run: |
sudo apt-get update
sudo apt-get install cmake ninja-build


- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r doc/sphinx/requirements.txt

- name: Build Sphinx documentation
run: |
sphinx-build -M html sphinx sphinx_output
working-directory: doc/

- name: Upload HTML documentation
if: ${{ github.event_name == 'push' && github.ref == 'main' }}
uses: actions/upload-artifact@v1
with:
name: Documentation (HTML)
path: doc/sphinx_output/html
30 changes: 30 additions & 0 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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 = 'Wakaama'
copyright = '2024, Lukas Woodtli'
author = 'Lukas Woodtli'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['literate_sphinx']

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'

# -- Options for literate_sphinx ----------------------------------------------


17 changes: 17 additions & 0 deletions doc/sphinx/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Welcome to Wakaama
==================

Wakaama is a C library for the LwM2M protocol.

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
2 changes: 2 additions & 0 deletions doc/sphinx/logging.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Logging
-------
35 changes: 35 additions & 0 deletions doc/sphinx/make.bat
Original file line number Diff line number Diff line change
@@ -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

%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
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions doc/sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
literate-sphinx==0.1.3
Sphinx==7.2.6
Loading