Debian Codegraph @

docs/demo/api.rst

raw
1 ***************************************
2 API documentation and generated content
3 ***************************************
4
5 .. contents:: Table of Contents
6
7 :mod:`test_py_module`
8 =====================
9
10 .. automodule:: test_py_module.test
11 :members:
12 :private-members:
13 :special-members:
14
15
16 C++ API
17 =======
18
19 .. cpp:type:: MyType
20
21 Some type
22
23 .. cpp:function:: const MyType Foo(const MyType bar)
24
25 Some function type thing
26
27 .. cpp:class:: template<typename T, std::size_t N> std::array
28
29 Some cpp class
30
31 .. cpp:member:: float Sphinx::version
32
33 The description of Sphinx::version.
34
35 .. cpp:var:: int version
36
37 The description of version.
38
39 .. cpp:type:: std::vector<int> List
40
41 The description of List type.
42
43 .. cpp:enum:: MyEnum
44
45 An unscoped enum.
46
47 .. cpp:enumerator:: A
48
49 .. cpp:enum-class:: MyScopedEnum
50
51 A scoped enum.
52
53 .. cpp:enumerator:: B
54
55 .. cpp:enum-struct:: protected MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type
56
57 A scoped enum with non-default visibility, and with a specified underlying type.
58
59 .. cpp:enumerator:: B
60
61
62 JavaScript API
63 ==============
64
65 .. Copied from sphinx-doc/sphinx/tests/roots
66
67 .. js:module:: module_a.submodule
68
69 * Link to :js:class:`ModTopLevel`
70
71 .. js:class:: ModTopLevel
72
73 * Link to :js:meth:`mod_child_1`
74 * Link to :js:meth:`ModTopLevel.mod_child_1`
75
76 .. js:method:: ModTopLevel.mod_child_1
77
78 * Link to :js:meth:`mod_child_2`
79
80 .. js:method:: ModTopLevel.mod_child_2
81
82 * Link to :js:meth:`module_a.submodule.ModTopLevel.mod_child_1`
83
84 .. js:module:: module_b.submodule
85
86 * Link to :js:class:`ModTopLevel`
87
88 .. js:class:: ModNested
89
90 .. js:method:: nested_child_1
91
92 * Link to :js:meth:`nested_child_2`
93
94 .. js:method:: nested_child_2
95
96 * Link to :js:meth:`nested_child_1`
97
98
99 Generated Index
100 ===============
101
102 Part of the sphinx build process is to generate an index file: :ref:`genindex`.
103
104
105 Optional parameter args
106 =======================
107
108 At this point optional parameters `cannot be generated from code`_.
109 However, some projects will manually do it, like so:
110
111 This example comes from `django-payments module docs`_.
112
113 .. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])
114
115 This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.
116
117 Due to API limitations there is no support for transferring purchased items.
118
119
120 :param seller_id: Seller ID assigned by Dotpay
121 :param pin: PIN assigned by Dotpay
122 :param channel: Default payment channel (consult reference guide)
123 :param lang: UI language
124 :param lock: Whether to disable channels other than the default selected above
125
126 .. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
127 .. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvide
128
129
130 Data
131 ====
132
133 .. data:: Data_item_1
134 Data_item_2
135 Data_item_3
136
137 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
138
139 Some data link :data:`Data_item_1`.
140
141
142 Sphinx Extensions
143 =================
144
145 sphinx.ext.autosummary
146 ----------------------
147
148 .. autosummary::
149
150 test_py_module.test.add_numbers
151 test_py_module.test.subtract_numbers
152 test_py_module.test.Foo