10 API Documentation#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html

10.1 Info Field Lists#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists

A link: send_message().

send_message(sender, recipient, message_body[, priority=1])#

Send a message to a recipient

Parameters
  • sender (str) – The person sending the message

  • recipient (str) – The recipient of the message

  • message_body (str) – The body of the message

  • priority (integer or None) – The priority of the message, can be a number 1-5

Returns

the message id

Return type

int

Raises
  • ValueError – if the message_body exceeds 160 characters

  • TypeError – if the message_body is not a basestring

10.2 Python#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-python-domain

require(name)#

Hypothetical built-in function.

A link: hello_world().

my_module.hello_world([repeat=1])#

Greet the world.

my_module.__name__#

Name of the module.

exception my_module.MyException(msg[, severity=7])#

A bad thing happened.

class my_module.MyClass#

A useful class.

enable(ignore_errors=False)#

Switch it on.

static from_file(filename)#

Create class instance from file.

classmethod whatever(arg)#

Nobody knows what that does.

data#

Where all the important stuff is stored

@decorate#

Apply festive attire.

@my_module.decorate#

Make it more cozy.

my_module.compile(source: string, filename, symbol='file')ast object#

Do some compilation.

10.3 C#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-c-domain

PyObject *PyTypeObject.tp_bases#

Base classes.

void *ptr#

A pointer.

PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)#

Allocate stuff.

DEBUG#

Show a debugging message.

type MyStruct#

An opaque struct.

10.4 C++#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#cpp-domain

class MyBase#

A base class.

class MyClass : public MyBase, MyOtherBase#

A derived class.

class my_namespace::MyClass#

A class in a namespace.

template<typename T, std::size_t N>
class std::array#

A class template.

template<typename T>
class std::array<T, 42>#

Partial specialization.

template<>
class std::array<bool, 256>#

Full specialization.

bool my_method(int arg1, std::string arg2)#

A function with parameters and types.

bool my_method(int, double)#

A function with unnamed parameters.

const T &std::array::operator[](std::size_t i) const#

An overload for the indexing operator.

operator bool() const#

A casting operator.

constexpr void foo(std::string &bar[2]) noexcept#

A constexpr function.

MyClass::MyClass(const MyClass&) = default#

A copy constructor with default implementation.

template<typename U>
void print(U &&u)#

A function template.

template<>
void print(int i)#

A specialization thereof.

std::string MyClass::my_member#
std::string MyClass::my_other_member[N][M]#
int a = 42#
template<class T>
constexpr T pi = T(3.1415926535897932385)#
typedef std::vector<int> MyList#

A typedef-like declaration of a type.

type MyContainer::const_iterator#

Declaration of a type alias with unspecified type.

using MyType = std::unordered_map<int, std::string>#

Declaration of a type alias.

template<typename T>
using MyContainer = std::vector<T>#

A templated type alias.

enum MyEnum#

An unscoped enum.

enum MySpecificEnum : long#

An unscoped enum with specified underlying type.

enum class MyScopedEnum#

A scoped enum.

protected enum struct MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type#

A scoped enum with non-default visibility, and with a specified underlying type.

enumerator MyEnum::myEnumerator#
enumerator MyEnum::myOtherEnumerator = 42#
union MyUnion#
template<typename It>
concept std::Iterator#

Proxy to an element of a notional sequence that can be compared, indirected, or incremented.

Notation

It r#

An lvalue.

Valid Expressions

  • *r, when r is dereferenceable.

  • ++r, with return type It&, when r is incrementable.

class Data#
union [anonymous]#
int a#
double b#

Explicit ref: Data::[anonymous]::a. Short-hand ref: Data::a.

void f(auto &&arg)#

A function template with a single unconstrained template parameter.

void f(std::Iterator it)#

A function template with a single template parameter, constrained by the Iterator concept.

std::Iterator{It}
void advance(It &it)#

A function template with a template parameter constrained to be an Iterator.

std::LessThanComparable{T}
class MySortedContainer#

A class template with a template parameter constrained to be LessThanComparable.

An expression: a * f(a) (or as text: a * f(a)).

A type: const MySortedContainer<int>& (or as text const MySortedContainer<int>&).

10.5 JavaScript#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-javascript-domain

$.getJSON(href, callback[, errback])#
Arguments
  • href (string) – An URI to the location of the resource.

  • callback – Gets called with the object.

  • errback – 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 jsmodule.MyAnimal(name[, age])#
Arguments
  • name (string) – The name of the animal

  • age (number) – an optional age for the animal

jsmodule.jsdata#
jsobject.name#

10.6 reStructuredText#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-restructuredtext-domain

.. foo::#

Foo description.

.. bar:: baz#

Bar description.

.. my-toctree::#

Directive.

:caption: caption of ToC#

Option.

:glob:#

Another option.

:foo:#

Foo description.

10.7 The Standard Domain#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#the-standard-domain

10.7.2 Environment Variables#

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-envvar

A link: ENV_VAR.

ENV_VAR#

Description of environment variable.

10.7.3 Generic Objects#

PAPER

You can set this variable to select a paper size.

SCISSORS

Destroys the aforementioned object.

10.8 sphinx.ext.autodoc#

A link: insipid_sphinx_theme.setup().

An insipid Sphinx theme.

insipid_sphinx_theme.setup(app)[source]#

Sphinx extension entry point.


Module docstring.

class example_module.TheBestClass(value=4)[source]#

This is a class.

multiplicate(factor)[source]#

Scale the thing.

example_module.a_very_useful_function(one, two, three, four=3)[source]#

This is one of the most useful functions.

Parameters
  • one (str) – First argument

  • two (int) – Second argument

  • three (float) – Third argument

  • four (integer or None) – Fourth argument

10.9 sphinx.ext.autosummary#

Warning

With docutils versions older than 0.18, the HTML line breaks in the left column are not working correctly. Make sure to use at least docutils >= 0.18, which is supported since Sphinx version 5.0.

a_very_useful_function(one, two, three[, four])

This is one of the most useful functions.

TheBestClass([value])

This is a class.

:nosignatures:

a_very_useful_function

This is one of the most useful functions.

TheBestClass

This is a class.