welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::python::google_style Struct Reference

Google-style docstring assembly (the default). More...

#include <welder/rods/python/doc_style.hpp>

Static Public Member Functions

static constexpr std::string format (const ::welder::detail::function_doc &d)
 Assemble d into a Google-style docstring.

Detailed Description

Google-style docstring assembly (the default).

The summary, then an Args: block listing each documented parameter ( name: text), then a Returns: block. Undocumented parameters are omitted; the Args:/Returns: blocks are dropped entirely when empty, and blocks are separated from preceding content by a blank line. A multiline param/returns doc keeps its continuation lines indented under the block, so docstrings carrying multiline examples stay readable.

This is the style both Python backends default to (their DocStyle template parameter); it satisfies welder::doc_style. Google docstrings are what Sphinx's Napoleon extension parses out of the box.

Definition at line 92 of file doc_style.hpp.

Member Function Documentation

◆ format()

constexpr std::string welder::rods::python::google_style::format ( const ::welder::detail::function_doc & d)
inlinestaticconstexpr

Assemble d into a Google-style docstring.

Parameters
dthe documentation pieces.
Returns
the formatted docstring (possibly empty).

Definition at line 96 of file doc_style.hpp.

References welder::rods::python::detail::any_param_doc(), welder::rods::python::detail::append_indented(), and welder::rods::python::detail::blank_line().


The documentation for this struct was generated from the following file: