Documentation strings ===================== We use `doxygen `_ + sphinx + breathe to render libdnf5 documentation. A typical docstring contains the following: * Description (mandatory; we don't use @brief as it doesn't seem to impact the rendered output) * a blank line * @param - argument name and description (only if applicable, can be specified multiple times) * @return - description of the returned value (only if applicable) * @exception - exception type and description (only if applicable, can be specified multiple times) * @since - version an entity become available (mandatory) * @deprecated - reason why an entity is deprecated (only if applicable) * @note - note text (optional) * @warning - warning text (optional) We highlight identifiers with ```backticks```. Example:: /// Split a string by a delimiter into a vector of strings /// /// @param text Input text. /// @param delimiter A delimiter we're using to split the text. /// @param max_items Limit number of splits to produce a vector containing up to `max_items` items. /// @return Split text. /// A continuation line for the return value description. /// @exception std::out_of_range Value of the `max_items` argument is out of expected range. /// @since 5.0 std::vector split(std::string text, std::string delimiter, int max_items); We also reference DNF 4 and libdnf5 0.x API classes, methods, attributes or functions that the subject of the documentation replaces by using @replaces command followed with a description of the replaced entity: * ::class: * ::method:.(args) * ::attribute:. * ::function: We keep these in regular comments rather than docstrings to avoid spamming the rendered docs. Example:: /// // // @replaces dnf:dnf/package.py:attribute:Package.name // @replaces libdnf5:libdnf5/hy-package.h:function:dnf_package_get_name(DnfPackage *pkg); std::string get_name() const;