Skip to content

Commit

Permalink
Adding a docstring for PyMaterialXCore.
Browse files Browse the repository at this point in the history
This PR adds a docstring in markdown format to the `PyMaterialXCore` module.

The docstring is defined in a macro named `PyMaterialXCore_DOCSTRING` that
uses the new `PYMATERIALX_DOCSTRING` macro to allow us to place the first
and last lines in lines by themselves, rather than starting the docstring
contents immediately after the `R"docstring(` marker.

The `PyMaterialXCore_DOCSTRING` macro is placed in a separate header file
named `__doc__.md.h` which lives side-by-side with the `PyModule.cpp` file
in which it is included.

Split from AcademySoftwareFoundation#1567.

Depends on AcademySoftwareFoundation#2038.

Update AcademySoftwareFoundation#342.

Signed-off-by: Stefan Habel <[email protected]>
  • Loading branch information
StefanHabel committed Sep 30, 2024
1 parent 76bef70 commit 7292249
Show file tree
Hide file tree
Showing 2 changed files with 420 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/PyMaterialX/PyMaterialXCore/PyModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//

#include <PyMaterialX/PyMaterialX.h>
#include "__doc__.md.h"

namespace py = pybind11;

Expand All @@ -26,7 +27,7 @@ void bindPyVariant(py::module& mod);

PYBIND11_MODULE(PyMaterialXCore, mod)
{
mod.doc() = "Module containing Python bindings for the MaterialXCore library";
mod.doc() = PyMaterialXCore_DOCSTRING;

bindPyElement(mod);
bindPyTraversal(mod);
Expand Down
Loading

0 comments on commit 7292249

Please sign in to comment.