Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pretty-printting of function call in Usage section in .Rd #415
Rendered help files for multi-line function calls have a
# S3 method for class 'tbl_df' inner_join(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ..., na_matches = pkgconfig::get_config("dplyr::na_matches"))
I think developers should potentially have control over how their
# S3 method for class 'tbl_df' inner_join(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ..., na_matches = pkgconfig::get_config("dplyr::na_matches") )
Manually changing the
Roxygen: list( markdown = TRUE, roclets = c("rd", "namespace", "collate", "pkgapi::api_roclet", "styler::style_usage_roclet") )
@krlmlr implemented https://github.com/r-lib/pkgapi that uses this field. Maybe you @krlmlr could support us develop this feature as you are already experienced with this? Should be a quick shot. Alternatively, this feature could be implemented in roxygen itself. Don't know what the best place is, happy to discuss.
Also, for this to not end in a one-line formatting, we potentially need styler to be able to break long lines (as WIP at #390 ) if roxygen does not handle that before with the
On a related note: We recently implemented styling of roxygen example code source in #381.
If I am correct, this would extend the roxygen2 dependency graph as follows:
setdiff( miniCRAN::pkgDep("styler", availPkgs = available.packages(), suggests = FALSE), miniCRAN::pkgDep("roxygen2", availPkgs = available.packages(), suggests = FALSE) ) #>  "styler" "enc" "rematch2"
Created on 2018-09-23 by the reprex package (v0.2.0.9000)
As stated above, styler can't break long lines, but it's not a problem because we just had to apply styler to the current formatting, which already breaks the lines correctly (up to the fact that the first line should only contain unnamed arguments, which styler would then fix) I believe.