docs: add doxygen (#1004)

This commit is contained in:
ReenigneArcher
2023-03-07 20:26:03 -05:00
committed by GitHub
parent a1e6f441e4
commit 31885434f2
76 changed files with 3375 additions and 221 deletions
+1
View File
@@ -0,0 +1 @@
.. mdinclude:: ../../../CHANGELOG.md
-2
View File
@@ -1,3 +1 @@
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/DOCKER_README.md
.. mdinclude:: ../../../DOCKER_README.md
+11
View File
@@ -8,6 +8,7 @@
from datetime import datetime
import os
import re
import subprocess
# -- Path setup --------------------------------------------------------------
@@ -43,9 +44,11 @@ To use cmake method for obtaining version instead of regex,
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'breathe', # c++ support for sphinx with doxygen
'm2r2', # enable markdown files
'sphinx.ext.autosectionlabel',
'sphinx.ext.todo', # enable to-do sections
'sphinx.ext.graphviz', # enable graphs for breathe
'sphinx.ext.viewcode', # add links to view source code
'sphinx_copybutton', # add a copy button to code blocks
]
@@ -82,4 +85,12 @@ html_theme_options = {
# extension config options
autosectionlabel_prefix_document = True # Make sure the target is unique
breathe_default_project = 'src'
breathe_implementation_filename_extensions = ['.c', '.cc', '.cpp', '.mm']
breathe_order_parameters_first = False
breathe_projects = dict(
src="../build/doxyxml"
)
todo_include_todos = True
subprocess.run('doxygen', shell=True, cwd=source_dir)
+6 -1
View File
@@ -14,11 +14,16 @@ Test clang-format locally.
Sphinx
------
Sunshine uses `Sphinx <https://www.sphinx-doc.org/en/master/>`_ for documentation building. Sphinx, along with other
required documentation depencies are included in the `./docs/requirements.txt` file. Python is required to build
required python dependencies are included in the `./docs/requirements.txt` file. Python is required to build
sphinx docs. Installation and setup of python will not be covered here.
Doxygen is used to generate the XML files required by Sphinx. Doxygen can be obtained from
`Doxygen downloads <https://www.doxygen.nl/download.html>`_. Ensure that the `doxygen` executable is in your path.
The config file for Sphinx is `docs/source/conf.py`. This is already included in the repo and should not be modified.
The config file for Doxygen is `docs/Doxyfile`. This is already included in the repo and should not be modified.
Test with Sphinx
.. code-block:: bash
-2
View File
@@ -1,5 +1,3 @@
:github_url: https://github.com/LizardByte/Sunshine/tree/nightly/docs/source/index.rst
Table of Contents
=================
.. include:: toc.rst
+85
View File
@@ -0,0 +1,85 @@
src
===
We are in process of improving the source code documentation. Code should be documented using Doxygen syntax.
Some examples exist in `main.h` and `main.cpp`. In order for documentation within the code to appear in the
rendered docs, the definition of the object must be in a header file, although the documentation itself can (and
should) be in the source file.
Example Documentation Blocks
----------------------------
**file.h**
.. code-block:: cpp
// functions
int main(int argc, char *argv[]);
**file.cpp** (with markdown)
.. code-block:: cpp
/**
* @brief Main application entry point.
* @param argc The number of arguments.
* @param argv The arguments.
*
* EXAMPLES:
* ```cpp
* main(1, const char* args[] = {"hello", "markdown", nullptr});
* ```
*/
int main(int argc, char *argv[]) {
// do stuff
}
**file.cpp** (with ReStructuredText)
.. code-block:: cpp
/**
* @brief Main application entry point.
* @param argc The number of arguments.
* @param argv The arguments.
* @rst
* EXAMPLES:
*
* .. code-block:: cpp
* main(1, const char* args[] = {"hello", "rst", nullptr});
* @endrst
*/
int main(int argc, char *argv[]) {
// do stuff
}
Code
----
.. toctree::
:maxdepth: 2
:caption: src
src/main
src/audio
src/cbs
src/config
src/confighttp
src/crypto
src/httpcommon
src/input
src/move_by_copy
src/network
src/nvhttp
src/process
src/round_robin
src/rtsp
src/stream
src/sync
src/task_pool
src/thread_pool
src/thread_safe
src/upnp
src/utility
src/uuid
src/video
src/platform
+4
View File
@@ -0,0 +1,4 @@
audio
=====
.. doxygenfile:: audio.h
+4
View File
@@ -0,0 +1,4 @@
cbs
===
.. doxygenfile:: cbs.h
+4
View File
@@ -0,0 +1,4 @@
config
======
.. doxygenfile:: config.h
+4
View File
@@ -0,0 +1,4 @@
confighttp
==========
.. doxygenfile:: confighttp.h
+4
View File
@@ -0,0 +1,4 @@
crypto
======
.. doxygenfile:: crypto.h
+4
View File
@@ -0,0 +1,4 @@
httpcommon
==========
.. doxygenfile:: httpcommon.h
+4
View File
@@ -0,0 +1,4 @@
input
=====
.. doxygenfile:: input.h
+4
View File
@@ -0,0 +1,4 @@
main
====
.. doxygenfile:: main.h
+4
View File
@@ -0,0 +1,4 @@
move_by_copy
============
.. doxygenfile:: move_by_copy.h
+4
View File
@@ -0,0 +1,4 @@
network
=======
.. doxygenfile:: network.h
+4
View File
@@ -0,0 +1,4 @@
nvhttp
======
.. doxygenfile:: nvhttp.h
+10
View File
@@ -0,0 +1,10 @@
platform
========
.. toctree::
:maxdepth: 1
platform/common
platform/linux
platform/macos
platform/windows
@@ -0,0 +1,4 @@
common
======
.. Todo:: Add common.h
+12
View File
@@ -0,0 +1,12 @@
linux
=====
.. toctree::
:maxdepth: 1
linux/cuda
linux/graphics
linux/misc
linux/vaapi
linux/wayland
linux/x11grab
@@ -0,0 +1,4 @@
cuda
====
.. Todo:: Add cuda.h
@@ -0,0 +1,4 @@
graphics
========
.. Todo:: Add graphics.h
@@ -0,0 +1,4 @@
misc
====
.. Todo:: Add misc.h
@@ -0,0 +1,4 @@
vaapi
=====
.. Todo:: Add vaapi.h
@@ -0,0 +1,4 @@
wayland
=======
.. Todo:: Add wayland.h
@@ -0,0 +1,4 @@
x11grab
=======
.. Todo:: Add x11grab.h
+11
View File
@@ -0,0 +1,11 @@
macos
=====
.. toctree::
:maxdepth: 1
macos/av_audio
macos/av_img_t
macos/av_video
macos/misc
macos/nv12_zero_device
@@ -0,0 +1,4 @@
av_audio
========
.. Todo:: Add av_audio.h
@@ -0,0 +1,4 @@
av_img_t
========
.. Todo:: Add av_img_t.h
@@ -0,0 +1,4 @@
av_video
========
.. Todo:: Add av_video.h
@@ -0,0 +1,4 @@
misc
====
.. Todo:: Add misc.h
@@ -0,0 +1,4 @@
nv12_zero_device
================
.. Todo:: Add nv12_zero_device.h
@@ -0,0 +1,9 @@
windows
=======
.. toctree::
:maxdepth: 1
windows/display
windows/misc
windows/PolicyConfig
@@ -0,0 +1,4 @@
PolicyConfig
============
.. Todo:: Add PolicyConfig.h
@@ -0,0 +1,4 @@
display
=======
.. Todo:: Add display.h
@@ -0,0 +1,4 @@
misc
====
.. Todo:: Add misc.h
+4
View File
@@ -0,0 +1,4 @@
process
=======
.. doxygenfile:: process.h
+4
View File
@@ -0,0 +1,4 @@
round_robin
===========
.. doxygenfile:: round_robin.h
+4
View File
@@ -0,0 +1,4 @@
rtsp
====
.. doxygenfile:: rtsp.h
+4
View File
@@ -0,0 +1,4 @@
stream
======
.. doxygenfile:: stream.h
+4
View File
@@ -0,0 +1,4 @@
sync
====
.. doxygenfile:: sync.h
+4
View File
@@ -0,0 +1,4 @@
tasl_pool
=========
.. doxygenfile:: task_pool.h
+4
View File
@@ -0,0 +1,4 @@
thread_pool
===========
.. doxygenfile:: thread_pool.h
+4
View File
@@ -0,0 +1,4 @@
thread_safe
===========
.. doxygenfile:: thread_safe.h
+4
View File
@@ -0,0 +1,4 @@
upnp
====
.. doxygenfile:: upnp.h
+4
View File
@@ -0,0 +1,4 @@
utility
=======
.. Todo:: Add utility.h
+4
View File
@@ -0,0 +1,4 @@
uuid
====
.. doxygenfile:: uuid.h
+4
View File
@@ -0,0 +1,4 @@
video
=====
.. doxygenfile:: video.h
+7
View File
@@ -9,6 +9,7 @@
about/usage
about/app_examples
about/advanced_usage
about/changelog
.. toctree::
:maxdepth: 2
@@ -47,3 +48,9 @@
:caption: Legal
legal/legal
.. toctree::
:maxdepth: 2
:caption: source
source/src