{"id":21128778,"url":"https://github.com/openpharma/roxytypes","last_synced_at":"2025-08-24T04:06:15.078Z","repository":{"id":65637984,"uuid":"593016360","full_name":"openpharma/roxytypes","owner":"openpharma","description":"typed parameter definitions for `roxygen2`","archived":false,"fork":false,"pushed_at":"2024-10-15T15:34:32.000Z","size":5021,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-20T05:02:58.425Z","etag":null,"topics":["r","roxygen2","type-hints"],"latest_commit_sha":null,"homepage":"https://openpharma.github.io/roxytypes/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openpharma.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T02:43:47.000Z","updated_at":"2024-11-02T17:37:12.000Z","dependencies_parsed_at":"2024-10-16T17:45:21.739Z","dependency_job_id":null,"html_url":"https://github.com/openpharma/roxytypes","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpharma%2Froxytypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpharma%2Froxytypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpharma%2Froxytypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openpharma%2Froxytypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openpharma","download_url":"https://codeload.github.com/openpharma/roxytypes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229948920,"owners_count":18149572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","roxygen2","type-hints"],"created_at":"2024-11-20T05:02:35.581Z","updated_at":"2024-12-16T10:54:49.339Z","avatar_url":"https://github.com/openpharma.png","language":"R","readme":"# `roxytypes`\n\n\u003c!-- badges: start --\u003e\n[![CRAN](https://img.shields.io/cran/v/roxytypes.svg)](https://cran.r-project.org/package=roxytypes)\n[![R-CMD-check](https://github.com/openpharma/roxytypes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openpharma/roxytypes/actions/workflows/R-CMD-check.yaml)\n[![Codecov](https://img.shields.io/codecov/c/github/openpharma/roxytypes/main.svg)](https://app.codecov.io/gh/openpharma/roxytypes)\n\u003c!-- badges: end --\u003e\n\nTyped parameter definition `roxygen2` tag\n\n## Quick Start\n\n### Convert your package\n\nIf you already have a codebase and you'd like to convert it to use `roxytypes`,\nyou can use:\n\n```r\nroxytypes::convert()\n```\n\nYou'll be prompted with a preview of changes and the option to continue by\nmaking edits or aborting changes. By default, will look for type signatures as\nparenthesized inline code at the start of your descriptions. That is, that\ndescriptions are written like `` (`type`) description ``.\n\nIf that's not the case, you can specify your own format. For example, if your\ntypes were in square brackets, you could specify a format like:\n\n```r\nroxytypes::convert(format = \"[`{type}`] {description}\")\n```\n\nBy default, conversions will only happen if an existing type is found using the\nprovided type format. If you'd like to convert all possible tags, pass\n`unmatched = TRUE`. However new typed tags will only be partially populated and\nwill produce documentation notes until they are filled in.\n\n### Tags from scratch \n\nUse the `@typed` tag to define parameters, replacing the `@param` tag.\n\nThe `@typed` tag expects input in the form:\n\n```\n#' @typed \u003cvar\u003e: \u003ctype\u003e\n#'   \u003cdescription\u003e\n```\n\nThe newline after the `type` field is a meaningful delimiter to avoid having to\ndisambiguate between type annotations and written descriptions. In practice it\nlooks something like this:\n\n```r\n#' Example\n#'\n#' @typed who: character\n#'   Who you'd like to say hello to.\n#'\n#' @typedreturn: NULL\n#'   `cat` output returned.\n#'\nhello \u003c- function(who = \"World\") {\n  cat(\"Hello, \", who, \"!\\n\", sep = \"\")\n}\n```\n\nNext order of business is to install the package and declare the \n`roxygen2` dependency. \n\n`DESCRIPTION`\n```\nConfig/Needs/documentation:\n    roxytypes\nRoxygen:\n    list(markdown = TRUE, packages = \"roxytypes\")\n```\n\nWith all of that set up, the only thing left is to rebuild your docs!\n\n## Configuration\n\n`roxytypes` accepts a number of configuration fields. For defaults, see\n`?config`.\n\n### Formatting\n\nThe style of documentation can be configured using `Config/roxytypes`:\n\n`DESCRIPTION`\n```\nConfig/roxytypes: list(format = \"(`{type}`): {description}\")\n```\n\nThe format string uses `glue` and can be expected to have fields `name`, `type`\nand `description`. The parameter name will always be the named argument value,\nbut may be reused for parts of the description.\n\nAltenatively, you can provide a function that accepts the parsed `roxygen2` tag\nand the fields as named arguments.\n\nFor more advanced formatting, see `?tags` or `?typed`.\n\n## [`roxylint`](https://github.com/openpharma/roxylint) compatible\n\n`@typed` tags come with their own `roxylint` linters. To benefit from linting of\n`@typed` tags, simply add the `roxylint::roxylint` roclet.\n\n`DESCRIPTION`\n```\nRoxygen:\n  list(\n    markdown = TRUE,\n    packages = c(\"roxylint\", \"roxytypes\"),\n    roclets = c(\"namespace\", \"rd\", \"roxylint::roxylint\")\n  )\n```\n\n\u003e ***tip!***\n\u003e\n\u003e If your `Roxygen` section gets too long, you can also put this content in\n\u003e `man/roxygen/meta.R` where you can benefit from all the perks of your editor's\n\u003e R file handling.\n\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpharma%2Froxytypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenpharma%2Froxytypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenpharma%2Froxytypes/lists"}