Skip to content

Commit c71e68d

Browse files
committed
Demodocs: move the rest of the example from the index page
1 parent 34a1f7e commit c71e68d

File tree

3 files changed

+44
-58
lines changed

3 files changed

+44
-58
lines changed

demo_docs/source/api.rst

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,46 @@
1+
2+
*********************
13
:mod:`test_py_module`
2-
=====================
4+
*********************
35

46
.. automodule:: test_py_module.test
57
:members:
68
:private-members:
79
:special-members:
10+
11+
12+
Optional parameter args
13+
=======================
14+
15+
At this point optional parameters `cannot be generated from code`_.
16+
However, some projects will manually do it, like so:
17+
18+
This example comes from `django-payments module docs`_.
19+
20+
.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])
21+
22+
This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.
23+
24+
Due to API limitations there is no support for transferring purchased items.
25+
26+
27+
:param seller_id: Seller ID assigned by Dotpay
28+
:param pin: PIN assigned by Dotpay
29+
:param channel: Default payment channel (consult reference guide)
30+
:param lang: UI language
31+
:param lock: Whether to disable channels other than the default selected above
32+
33+
.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
34+
.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvide
35+
36+
37+
Data
38+
====
39+
40+
.. data:: Data_item_1
41+
Data_item_2
42+
Data_item_3
43+
44+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
45+
46+
Some data link :data:`Data_item_1`.

demo_docs/source/demo.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Character-level inline markup is also possible (although exceedingly ugly!)
2727
in *re*\ ``Structured``\ *Text*. Problems are indicated by |problematic| text
2828
(generated by processing errors; this one is intentional).
2929

30+
Also with ``sphinx.ext.autodoc``, which I use in the demo,
31+
I can link to :class:`test_py_module.test.Foo`.
32+
It will link you right my code documentation for it.
33+
3034
The default role for interpreted text is `Title Reference`. Here are
3135
some explicit interpreted text roles: a PEP reference (:PEP:`287`); an
3236
RFC reference (:RFC:`2822`); a :sub:`subscript`; a :sup:`superscript`;

demo_docs/source/index.rst

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -26,60 +26,3 @@ Contents
2626
long
2727

2828
You can also read the :ref:`genindex`
29-
30-
Optional parameter args
31-
=======================
32-
33-
At this point optional parameters `cannot be generated from code`_.
34-
However, some projects will manually do it, like so:
35-
36-
This example comes from `django-payments module docs`_.
37-
38-
.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl'])
39-
40-
This backend implements payments using a popular Polish gateway, `Dotpay.pl <http://www.dotpay.pl>`_.
41-
42-
Due to API limitations there is no support for transferring purchased items.
43-
44-
45-
:param seller_id: Seller ID assigned by Dotpay
46-
:param pin: PIN assigned by Dotpay
47-
:param channel: Default payment channel (consult reference guide)
48-
:param lang: UI language
49-
:param lock: Whether to disable channels other than the default selected above
50-
51-
.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw
52-
.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvider
53-
54-
55-
Inline code and references
56-
==========================
57-
58-
`reStructuredText`_ is a markup language. It can use roles and
59-
declarations to turn reST into HTML.
60-
61-
In reST, ``*hello world*`` becomes ``<em>hello world</em>``. This is
62-
because a library called `Docutils`_ was able to parse the reST and use a
63-
``Writer`` to output it that way.
64-
65-
If I type ````an inline literal```` it will wrap it in ``<tt>``. You can
66-
see more details on the `Inline Markup`_ on the Docutils homepage.
67-
68-
Also with ``sphinx.ext.autodoc``, which I use in the demo, I can link to
69-
:class:`test_py_module.test.Foo`. It will link you right my code
70-
documentation for it.
71-
72-
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
73-
.. _Docutils: http://docutils.sourceforge.net/
74-
.. _Inline Markup: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup
75-
76-
Data
77-
====
78-
79-
.. data:: Data_item_1
80-
Data_item_2
81-
Data_item_3
82-
83-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue elit eu hendrerit mattis.
84-
85-
Some data link :data:`Data_item_1`.

0 commit comments

Comments
 (0)