sample API documentation and generated content¶
Table of Contents
Python API¶
test_py_module
¶
.. automodule:: test_py_module.test
:members:
:private-members:
:special-members:
Test Module for sphinx_rtd_theme.
- class test_py_module.test.Foo[source]¶
Docstring for class Foo.
This text tests for the formatting of docstrings generated from output
sphinx.ext.autodoc
. Which contain reST, but sphinx nests it in the<dl>
, and<dt>
tags. Also,<tt>
is used for class, method names and etc, but those will always have the.descname
or.descclassname
class.Normal
<tt>
(like the <tt> I just wrote here) needs to be shown with the same style as anything else with``this type of markup``
.It’s common for programmers to give a code example inside of their docstring:
from test_py_module import Foo myclass = Foo() myclass.dothismethod('with this argument') myclass.flush() print(myclass)
Here is a link to
capitalize()
. Here is a link to__init__()
.- __weakref__¶
list of weak references to the object
- another_function(a, b, **kwargs)[source]¶
Here is another function.
- Parameters:¶
- a : int¶
The number of green hats you own.
- b : int¶
The number of non-green hats you own.
- kwargs : float¶
Additional keyword arguments. Each keyword parameter should specify the name of your favorite cuisine. The values should be floats, specifying the mean price of your favorite dish in that cooking style.
- Returns:¶
A 2-tuple. The first element is the mean price of all dishes across cuisines. The second element is the total number of hats you own: \(a + b\).
- Return type:¶
- Raises:¶
ValueError – When
a
is not an integer.
Added in version 1.0: This was added in 1.0
Changed in version 2.0: This was changed in 2.0
Deprecated since version 3.0: This is deprecated since 3.0
-
bar =
1
¶ Doc comment for class attribute Foo.bar. It can have multiple lines.
-
baz =
2
¶ Docstring for class attribute Foo.baz.
-
flox =
1.5
¶ Doc comment for Foo.flox. One line only.
- qux¶
Doc comment for instance attribute qux.
- spam¶
Docstring for instance attribute spam.
.. py:function:: overloaded_func(a: int, b: int) -> int
overloaded_func(a: float, b: float) -> float
Adds :py:param:`a` and :py:param:`b`.
:param a: First operand.
:param b: Second operand.
C++ API¶
.. cpp:type:: MyType
Some type
- type MyType;¶
Some type
.. c:macro:: DEFAULT_LENGTH
.. cpp:function:: template <typename T, int K> \
const MyType Foo(\
const MyType bar, uint8_t* arr, \
unsigned int len = DEFAULT_LENGTH, \
bool baz= false)
const MyType Foo(\
const MyType bar, uint16_t* arr, \
unsigned int len = DEFAULT_LENGTH, \
bool baz= false)
Some function type thing
:tparam T: Some type template parameter.
:tparam K: Some non-type template parameter.
:param bar: This is the bar parameter.
:param arr[out]: Array of something. Elements may be either
:cpp:expr:`uint8_t` or :cpp:expr:`uint16_t`.
:param len: Length of :cpp:expr:`arr`.
:param baz: Baz parameter.
-
DEFAULT_LENGTH¶
.. c:macro:: MY_MACRO(X, Y, Z)
Expands to something.
:param X: The X parameter to the macro.
:param Y: The Y parameter to the macro.
.. cpp:class:: template<typename T, typename A, typename B, typename C, std::size_t N> std::array
Some cpp class
.. cpp:member:: float Sphinx::version
The description of `Sphinx::version`.
- float Sphinx::version;¶
The description of
Sphinx::version
.
.. cpp:var:: int version
The description of version.
- int version;¶
The description of version.
.. cpp:type:: std::vector<int> List
The description of List type.
.. cpp:enum:: MyEnum
An unscoped enum.
.. cpp:enumerator:: A
.. cpp:enum-class:: MyScopedEnum
A scoped enum.
.. cpp:enumerator:: B
Description of enumerator B.
.. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type_t<MyScopedEnum>
A scoped enum with non-default visibility, and with a specified underlying type.
.. cpp:enumerator:: B
-
protected
enum struct MyScopedVisibilityEnum : std::underlying_type_t<
MyScopedEnum>;
¶ A scoped enum with non-default visibility, and with a specified underlying type.
- enumerator B;¶
.. cpp:type:: synopses_ex::SomeType
Description will be shown as a tooltip when hovering over
cross-references to :cpp:expr:`SomeType` in other signatures as well as
in the TOC.
Additional description not shown in tooltip. This is the return type
for :cpp:expr:`Foo`.
.. cpp:function:: template <typename T, int N> \
synopses_ex::SomeType synopses_ex::Foo(\
T param, \
const int (&arr)[N]\
);
Synopsis for this function, shown when hovering over cross references
as well as in the TOC.
:tparam T: Tooltip shown when hovering over cross-references to this
template parameter. Additional description not included in
tooltip.
:tparam N: Tooltip shown for N.
:param param: Tooltip shown for cross-references to this function
parameter param.
:param arr: Tooltip shown for cross-references to this function
parameter arr. To cross reference another parameter, use the
:rst:role:`cpp:expr` role, e.g.: :cpp:expr:`N`. Parameters can
also be referenced via their fake qualified name,
e.g. :cpp:expr:`synopses_ex::Foo::N`.
:returns: Something or other.
- type synopses_ex::SomeType;¶
Description will be shown as a tooltip when hovering over cross-references to
SomeType
in other signatures as well as in the TOC.Additional description not shown in tooltip. This is the return type for
Foo
.
-
template <typename T, int N>
synopses_ex::SomeType synopses_ex::Foo(T param,
const int (&arr)[N]);¶ Synopsis for this function, shown when hovering over cross references as well as in the TOC.
- Template Parameters:¶
- Parameters:¶
- T param¶
Tooltip shown for cross-references to this function parameter param.
- const int (&arr)[N]¶
Tooltip shown for cross-references to this function parameter arr. To cross reference another parameter, use the
cpp:expr
role, e.g.:N
. Parameters can also be referenced via their fake qualified name, e.g.synopses_ex::Foo::N
.
- Returns:¶
Something or other.
.. cpp:class:: synopses_ex::Class
.. cpp:function:: Class(uint16_t _cepin, uint16_t _cspin, uint32_t _spi_speed=RF24_SPI_SPEED)
:param _cepin: The pin attached to Chip Enable on the RF module
:param _cspin: The pin attached to Chip Select (often labeled CSN) on the radio module.
:param _spi_speed: The SPI speed in Hz ie: 1000000 == 1Mhz
JavaScript API¶
* Link to :js:class:`ModTopLevel`
Link to
ModTopLevel()
.. js:class:: ModTopLevel
* Link to :js:meth:`mod_child_1`
* Link to :js:meth:`ModTopLevel.mod_child_1`
- class module_a.submodule.ModTopLevel()¶
Link to
mod_child_1()
Link to
ModTopLevel.mod_child_1()
.. js:method:: ModTopLevel.mod_child_1
* Link to :js:meth:`mod_child_2`
.. js:method:: ModTopLevel.mod_child_2
* Link to :js:meth:`module_a.submodule.ModTopLevel.mod_child_1`
- ModTopLevel.mod_child_1()¶
Link to
mod_child_2()
- ModTopLevel.mod_child_2()¶
* Link to :js:class:`ModTopLevel`
Link to
ModTopLevel()
.. js:class:: ModNested
.. js:method:: nested_child_1
* Link to :js:meth:`nested_child_2`
.. js:method:: nested_child_2
* Link to :js:meth:`nested_child_1`
.. js:method:: getJSON(href, callback, priority[, err_back, flags])
:param string href: An URI to the location of the resource.
:param callback: Gets called with the object.
:param err_back:
Gets called in case the request fails. And a lot of other
text so we need multiple lines.
:throws SomeError: For whatever reason in that case.
:returns: Something.
- class module_b.submodule.ModNested()¶
- ModNested.nested_child_1()¶
Link to
nested_child_2()
- ModNested.nested_child_2()¶
Link to
nested_child_1()
- ModNested.getJSON(href, callback, priority[, err_back, flags])¶
Generated Index¶
A generated index (:ref:`genindex`) is part of the Sphinx build process, unless
`html_use_index` is set to :python:`False`.
Sphinx also allows indexing by domain (programming language), as seen in the
:ref:`modindex` for the demo Python module that is documented on this page.
A generated index (Index) is part of the Sphinx build process, unless
html_use_index
is set to False
.
Sphinx also allows indexing by domain (programming language), as seen in the Module Index for the demo Python module that is documented on this page.
Note
This theme does not support a separate search page, since the search functionality is accessible in the site’s navigation bar.
Data¶
.. data:: Data_item_1
Data_item_2
Data_item_3
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
Some data link :data:`Data_item_1`.
- test_py_module.test.Data_item_1¶
- test_py_module.test.Data_item_2¶
- test_py_module.test.Data_item_3¶
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
Some data link Data_item_1
.