From fd21aca2ce70915c531d9657565bf5a3602fca57 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Tue, 5 Nov 2013 23:32:48 +0800 Subject: [PATCH] Examples for issue #34 and #35 for dave tomorrow --- demo_docs/source/index.rst | 36 +++++++++++++++++++++++++ demo_docs/source/test_py_module/test.py | 1 + 2 files changed, 37 insertions(+) diff --git a/demo_docs/source/index.rst b/demo_docs/source/index.rst index 13233418..93bf2698 100644 --- a/demo_docs/source/index.rst +++ b/demo_docs/source/index.rst @@ -32,6 +32,30 @@ API Test :private-members: :special-members: +Optional parameter args +----------------------- + +At this point optional parameters `cannot be generated from code`_. +However, some projects will manually do it, like so: + +This example comes from `django-payments module docs`_. + +.. class:: payments.dotpay.DotpayProvider(seller_id, pin[, channel=0[, lock=False], lang='pl']) + + This backend implements payments using a popular Polish gateway, `Dotpay.pl `_. + + Due to API limitations there is no support for transferring purchased items. + + + :param seller_id: Seller ID assigned by Dotpay + :param pin: PIN assigned by Dotpay + :param channel: Default payment channel (consult reference guide) + :param lang: UI language + :param lock: Whether to disable channels other than the default selected above + +.. _cannot be generated from code: https://groups.google.com/forum/#!topic/sphinx-users/_qfsVT5Vxpw +.. _django-payments module docs: http://django-payments.readthedocs.org/en/latest/modules.html#payments.authorizenet.AuthorizeNetProvider + Code test ========= @@ -73,6 +97,18 @@ The first hexagram is made up of six unbroken lines. These unbroken lines stand The power represented by the hexagram is to be interpreted in a dual sense in terms of its action on the universe and of its action on the world of men. In relation to the universe, the hexagram expresses the strong, creative action of the Deity. In relation to the human world, it denotes the creative action of the holy man or sage, of the ruler or leader of men, who through his power awakens and develops their higher nature. +Code with Sidebar +================= + +.. sidebar:: A code example + + With a sidebar on the right. + +.. literalinclude:: test_py_module/test.py + :language: python + :linenos: + :lines: 1-40 + Boxes ===== diff --git a/demo_docs/source/test_py_module/test.py b/demo_docs/source/test_py_module/test.py index 0b2c37a8..357d0da7 100644 --- a/demo_docs/source/test_py_module/test.py +++ b/demo_docs/source/test_py_module/test.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """Test Module for sphinx_rtd_theme.""" + class Foo: r"""Docstring for class Foo.