Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of default field formatters, even with custom formatting string #13

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

dgkf
Copy link
Collaborator

@dgkf dgkf commented Jul 20, 2023

This PR changes some of the internal behaviors to hopefully make it easier to customize.

There is still a default format, but it is functionally much simpler. Instead, each of the fields get their own formatters, which are implemented as methods on as.character. This means that glue::glue() will automatically leverage these formatters when building the documentation.

This mean a format such as ({type})\cr {description} will automatically wrap naked types in backticks and respect quotes the same way the default formatter does.

If one prefers to work with the raw values, they can always use ({unclass(type)}) unclass(description) or provide the formatter as a function.

@dgkf dgkf linked an issue Jul 20, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Merging #13 (c349be0) into main (713d79d) will increase coverage by 2.94%.
The diff coverage is 78.94%.

❗ Current head c349be0 differs from pull request most recent head 47bb24f. Consider uploading reports for the commit 47bb24f to get more accurate results

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   83.00%   85.95%   +2.94%     
==========================================
  Files          11       11              
  Lines         353      363      +10     
==========================================
+ Hits          293      312      +19     
+ Misses         60       51       -9     
Impacted Files Coverage Δ
R/tag_typedreturn.R 0.00% <0.00%> (ø)
R/tag_typed.R 71.42% <75.00%> (+12.60%) ⬆️
R/utils.R 91.66% <100.00%> (+21.29%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dgkf dgkf merged commit 36235fe into main Jul 20, 2023
7 checks passed
@dgkf dgkf deleted the 12-format-syntax branch July 20, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Literal syntax producing malformed roxygen output
1 participant