welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::doc_style Concept Reference

A style folds a welder::detail::function_doc into one docstring, and a welder::detail::enum_doc (an enum's summary plus its enumerator docs) into the enum's class docstring. More...

#include <welder/concepts.hpp>

Concept definition

template<class S>
concept doc_style = requires(const detail::function_doc& d, const detail::enum_doc& e) {
{ S::format(d) } -> std::same_as<std::string>;
{ S::format_enum(e) } -> std::same_as<std::string>;
}
A style folds a welder::detail::function_doc into one docstring, and a welder::detail::enum_doc (an e...
Definition concepts.hpp:435
The raw documentation pieces of an enum, handed to a style to assemble.
Definition doc.hpp:277
The raw documentation pieces of a function, handed to a style to assemble.
Definition doc.hpp:253

Detailed Description

A style folds a welder::detail::function_doc into one docstring, and a welder::detail::enum_doc (an enum's summary plus its enumerator docs) into the enum's class docstring.

It is the customization point for how documentation reads in the target language; swap it to emit Google-, NumPy-, or any house style. Any type with static std::string format(const detail::function_doc&) and static std::string format_enum(const detail::enum_doc&) qualifies. Concrete styles live with the rods that share them (e.g. welder::rods::python::google_style in <welder/rods/python/doc_style.hpp>), keeping this core layer neutral.

Template Parameters
Sthe candidate style type.

Definition at line 435 of file concepts.hpp.