From 88a3264b2b4b2e408adedcbb80eb58bd7e59ed0e Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Wed, 9 Dec 2009 12:07:26 +0000 Subject: [PATCH] more sphinx docs --- doc/conf.py | 4 ++++ doc/cppmethod.rst | 10 ++++++++++ doc/function.rst | 10 ++++++++++ doc/index.rst | 3 +++ doc/tutorial.rst | 8 ++++---- 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 doc/cppmethod.rst create mode 100644 doc/function.rst diff --git a/doc/conf.py b/doc/conf.py index b9958b0..f4015cc 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -199,3 +199,7 @@ latex_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} + + +autoclass_content = "both" + diff --git a/doc/cppmethod.rst b/doc/cppmethod.rst new file mode 100644 index 0000000..941f23d --- /dev/null +++ b/doc/cppmethod.rst @@ -0,0 +1,10 @@ + +============================== +cppmethod: C++ method wrappers +============================== + + +.. automodule:: pybindgen.cppmethod + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/function.rst b/doc/function.rst new file mode 100644 index 0000000..cca9943 --- /dev/null +++ b/doc/function.rst @@ -0,0 +1,10 @@ + +================================= +function: C/C++ function wrappers +================================= + + +.. automodule:: pybindgen.function + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/index.rst b/doc/index.rst index c8302fb..23c2c7a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -15,7 +15,10 @@ Contents: module utils + function cppclass + cppmethod + gccxmlparser diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 4f58c55..12f2a3f 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -155,7 +155,7 @@ single argument an 'int' of name 'value':: [pybindgen.param ('int', 'v1'), pybindgen.param ('int', 'v2')]) -The above then allows you to write: +The above then allows you to write:: >>> import MyModule >>> v = MyModule.MyModuleDoAction (10, -1) @@ -263,7 +263,7 @@ pybindgen can wrap both C and C++ APIs: in C++, there exist both instance and st members so, pybindgen provides two methods: add_instance_attribute and add_static_attribute to register these two kinds of members. -Our C API then becomes accessible from python: +Our C API then becomes accessible from python:: >>> import MyModule >>> st = MyModule.MyModuleStruct () >>> st.a = 10 @@ -308,7 +308,7 @@ and, then, specify that it has a constructor:: klass.add_constructor([]) We can declare the setter method which is really -a straightforward extension from the add_function function.:: +a straightforward extension from the add_function function:: klass.add_method('SetInt', None, [param('int', 'value')]) @@ -371,7 +371,7 @@ simply need to carefully use the fully scoped name of the enum.:: inner.add_method('Do', None, [param('Outer::inner_e', value)]) -The resulting python API reflects the underlying C++ API very closely: +The resulting python API reflects the underlying C++ API very closely:: >>> import MyModule >>> print MyModule.Outer.INNER_A