Skip to content

Commit f018feb

Browse files
committed
cleaned up/renamed docs
1 parent 5571f5b commit f018feb

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

docs/cpp_code.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
C++ code
2+
===================
3+
4+
.. doxygenfile:: main.hpp

docs/index.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
Welcome to Python-CPP Example's documentation!
2-
==============================================
1+
Example documentation for a hybrid Python/C++ project
2+
=====================================================
33

44
Contents:
55

66
.. toctree::
77
:maxdepth: 2
88

9-
python_cpp_example
9+
python_code
1010

11-
.. doxygenfunction:: add
11+
cpp_code
1212

1313
Indices and tables
1414
==================
1515

1616
* :ref:`genindex`
17-
* :ref:`modindex`
1817
* :ref:`search`
File renamed without changes.

python_cpp_example/bindings.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace py = pybind11;
66
PYBIND11_PLUGIN(python_cpp_example)
77
{
88
py::module m("python_cpp_example", R"doc(
9-
Pybind11 example plugin
9+
Python module
1010
-----------------------
1111
.. currentmodule:: python_cpp_example
1212
.. autosummary::
@@ -18,19 +18,15 @@ PYBIND11_PLUGIN(python_cpp_example)
1818

1919
m.def("add", &add, R"doc(
2020
Add two numbers
21-
Some other explanation about the add function.
21+
22+
Some other information about the add function.
2223
)doc");
2324

2425
m.def("subtract", &subtract, R"doc(
2526
Subtract two numbers
26-
Some other explanation about the subtract function.
27-
)doc");
2827
29-
#ifdef VERSION_INFO
30-
m.attr("__version__") = py::str(VERSION_INFO);
31-
#else
32-
m.attr("__version__") = py::str("dev");
33-
#endif
28+
Some other information about the subtract function.
29+
)doc");
3430

3531
return m.ptr();
3632
}

python_cpp_example/main.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/*! Add two integers woo! */
1+
/*! Add two integers
2+
\param i an integer
3+
\param j another integer
4+
*/
25
int add(int i, int j);
3-
/*! Subtract one integer from another */
6+
/*! Subtract one integer from another
7+
\param i an integer
8+
\param j an integer to subtract from \p i
9+
*/
410
int subtract(int i, int j);

0 commit comments

Comments
 (0)