Skip to main content

describe_params_lines

Function describe_params_lines 

Source
pub(crate) fn describe_params_lines(
    doc_tags: &[String],
    forward: impl Fn(&str) -> bool,
    r_params: &str,
    page: &str,
    choice_docs: Option<&HashMap<String, String>>,
    label: &str,
) -> Vec<String>
Expand description

The documentation body of a method block that has no \usage (env methods): the author tags forward accepts, verbatim, then one \describe{} list with the author’s @param items followed by the choice items of generated_params. A formal without choice text gets no item (nothing in \usage asks for one), and no @param line is emitted: with no usage entry to match, roxygen2 would write an \arguments entry that R CMD check reports as “Documented arguments not in \usage”.

After a forwarded @description / @details, the list continues that section after a blank line; after @examples / @examplesIf, whose code block a blank line does not end, it opens a @details. Otherwise @description Arguments of \code{<label>()}: and a blank line open it: roxygen2 runs a tag’s text up to the next tag, so after any other tag (@return, @seealso, @title, …) the list would land in that tag’s section, and an untagged list would be the block’s intro paragraph, i.e. its title, which roxygen2 drops on the class page the block merges into.

doc_tags is the full tag list, so a page tag that forward rejects still sends the arguments elsewhere. Emits nothing when there is neither a forwarded tag nor an item.