Working cpp documentation breathe + exhale

This commit is contained in:
Alexandre Foucher 2024-01-23 17:07:41 +01:00
parent 453516610c
commit 8dfcbf83f5
17 changed files with 232 additions and 58 deletions

View file

@ -1,10 +0,0 @@
# Doxyfile 1.8.17
PROJECT_NAME = "my_project"
INPUT = ../include
INPUT_ENCODING = UTF-8
RECURSIVE = YES
GENERATE_XML = YES
XML_OUTPUT = build/doxyxml
GENERATE_LATEX = NO
GENERATE_HTML = NO

View file

@ -5,18 +5,16 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
# help:
# @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
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
@mkdir -p build
@doxygen ./Doxyfile.in
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View file

@ -1,12 +0,0 @@
from cgitb import html
extensions = ["breathe"]
html_theme = "shibuya"
html_theme_options = {
"globaltoc_expand_depth": 1,
}
breathe_projects = {"my_project": "build/doxyxml/"}
breathe_default_project = "my_project"

View file

@ -1,9 +0,0 @@
driver.h
========
..
doxygenfile:: driver.h
.. doxygenfunction:: add
:project: my_project
:sections: parameters

View file

@ -1,13 +0,0 @@
Reference
=========
ROS est un méta-système d'exploitation à code source ouvert pour votre robot. Il fournit les services que vous attendez d'un système d'exploitation, notamment l'abstraction matérielle, le contrôle des périphériques de bas niveau, la mise en œuvre des fonctionnalités les plus courantes, le passage de messages entre les processus et la gestion des paquets.
.. toctree::
:maxdepth: 2
:caption: Contents:
driver.h
Lancement
---------

4
cpp-example/docs/make.bat Executable file → Normal file
View file

@ -7,7 +7,7 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set SOURCEDIR=source
set BUILDDIR=build
%SPHINXBUILD% >NUL 2>NUL
@ -25,8 +25,6 @@ if errorlevel 9009 (
if "%1" == "" goto help
mkdir build 2>nul
doxygen ./Doxyfile.in
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

View file

@ -0,0 +1,17 @@
.. _exhale_class_classDriver:
Class Driver
============
- Defined in :ref:`file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h`
Class Documentation
-------------------
.. doxygenclass:: Driver
:project: My Project
:members:
:protected-members:
:undoc-members:

View file

@ -0,0 +1,18 @@
Class Hierarchy
---------------
.. raw:: html
<ul class="treeView" id="class-treeView">
<li>
<ul class="collapsibleList">
<li class="lastChild">Class <a href="classDriver.html#exhale-class-classDriver">Driver</a></li>
</ul>
</li><!-- only tree view element -->
</ul><!-- /treeView class-treeView -->
.. end raw html for treeView

View file

@ -0,0 +1,16 @@
.. _dir__home_alexandre_Documents_test-sphinx_cpp-example_include:
Directory include
=================
*Directory path:* ``/home/alexandre/Documents/test-sphinx/cpp-example/include``
Files
-----
- :ref:`file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h`

View file

@ -0,0 +1,39 @@
.. _file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h:
File Driver.h
=============
|exhale_lsh| :ref:`Parent directory <dir__home_alexandre_Documents_test-sphinx_cpp-example_include>` (``/home/alexandre/Documents/test-sphinx/cpp-example/include``)
.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS
.. contents:: Contents
:local:
:backlinks: none
Definition (``/home/alexandre/Documents/test-sphinx/cpp-example/include/Driver.h``)
-----------------------------------------------------------------------------------
.. toctree::
:maxdepth: 1
program_listing_file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h.rst
Classes
-------
- :ref:`exhale_class_classDriver`

View file

@ -0,0 +1,18 @@
File Hierarchy
--------------
.. raw:: html
<ul class="treeView" id="file-treeView">
<li>
<ul class="collapsibleList">
<li class="lastChild">Directory <a href="dir__home_alexandre_Documents_test-sphinx_cpp-example_include.html#dir-home-alexandre-Documents-test-sphinx-cpp-example-include">include</a><ul><li class="lastChild">File <a href="file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h.html#file-home-alexandre-Documents-test-sphinx-cpp-example-include-Driver.h">Driver.h</a></li></ul></li>
</ul>
</li><!-- only tree view element -->
</ul><!-- /treeView file-treeView -->
.. end raw html for treeView

View file

@ -0,0 +1,10 @@
===========
Library API
===========
.. include:: class_view_hierarchy.rst.include
.. include:: file_view_hierarchy.rst.include
.. include:: unabridged_api.rst.include

View file

@ -0,0 +1,21 @@
.. _program_listing_file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h:
Program Listing for File Driver.h
=================================
|exhale_lsh| :ref:`Return to documentation for file <file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h>` (``/home/alexandre/Documents/test-sphinx/cpp-example/include/Driver.h``)
.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS
.. code-block:: cpp
class Driver
{
public:
int write(unsigned char *buffer);
private:
bool mIsActive;
};

View file

@ -0,0 +1,12 @@
Full API
--------
Classes and Structs
*******************
.. toctree::
:maxdepth: 5
classDriver.rst

View file

@ -0,0 +1,23 @@
:orphan:
Full API
========
Directories
***********
.. toctree::
:maxdepth: 5
dir__home_alexandre_Documents_test-sphinx_cpp-example_include.rst
Files
*****
.. toctree::
:maxdepth: 5
file__home_alexandre_Documents_test-sphinx_cpp-example_include_Driver.h.rst

View file

@ -0,0 +1,49 @@
# 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 = 'cpp-example'
copyright = '2024, Alexandre Foucher'
author = 'Alexandre Foucher'
release = '1.0'
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'breathe',
'exhale'
]
breathe_projects = {"My Project": "../build/_doxygen/xml"}
breathe_default_project = "My Project"
exhale_args = {
# These arguments are required
"containmentFolder": "./api",
"rootFileName": "library_root.rst",
"doxygenStripFromPath": "..",
# Heavily encouraged optional argument (see docs)
"rootFileTitle": "Library API",
# Suggested optional arguments
"createTreeView": True,
# TIP: if using the sphinx-bootstrap-theme, you need
# "treeViewIsBootstrap": True,
"exhaleExecutesDoxygen": True,
"exhaleDoxygenStdin": "INPUT = ../../include"
}
templates_path = ['_templates']
exclude_patterns = []
language = 'fr'
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'shibuya'
html_static_path = ['_static']

View file

@ -1,17 +1,16 @@
.. test documentation master file, created by
sphinx-quickstart on Fri Jan 19 17:24:42 2024.
.. cpp-example documentation master file, created by
sphinx-quickstart on Tue Jan 23 15:55:27 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to test's documentation!
================================
Welcome to cpp-example's documentation!
=======================================
.. toctree::
:maxdepth: 2
:caption: Contents:
cpp-reference/index
api/library_root
Indices and tables
==================