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

Fix “\special” in usage documentation #1345

Merged
merged 6 commits into from
Aug 24, 2020

Conversation

klmr
Copy link
Contributor

@klmr klmr commented Jun 9, 2020

The reference usage parser was missing support for the Rd \special tag. This PR adds the missing support.

The \special tag is rarely used so it’s easily overlooked. The PR contains an addition to the test project under tests/testthat/assets/reference which illustrates the usage for the ? operator (mirroring that of the core R ? operator defined in ‘utils’).

It’s worth considering how such “special” operators should be rendered in the pkgdown reference index (currently, ? is rendered as `?()`, which is … idiosyncratic). But this affects operators regardless of their Rd usage declaration, and is therefore beyond the scope of this PR.

@klmr klmr changed the title Fix special in usage Fix “\special” in usage documentation Jun 10, 2020
@hadley
Copy link
Member

hadley commented Aug 20, 2020

Can you please point to the docs for \special? I don't see it in R-exts.

@klmr
Copy link
Contributor Author

klmr commented Aug 21, 2020

I don’t think it’s mentioned in R-exts. It’s mentioned in Duncan Murdoch’s 2010 description of parseRd, and it is used extensively throughout the R core library’s Rd files.

@hadley
Copy link
Member

hadley commented Aug 21, 2020

In that case, can you add a comment above as_html.tag_special() that provides a brief explanation and links to a couple of examples in https://github.com/wch/r-source?

@klmr
Copy link
Contributor Author

klmr commented Aug 22, 2020

Gladly. How’s the new commit? Are the path references OK or should I include actual links into the Git mirror?

I’ve also force-pushed a rebase against master, since the previous PR had a conflict.

I’ve just noticed that the ‘rlang’ package currently has no “usage” section for its bang bang, big bang and interpolation operators in ?nse-force, which might be a use-case for \special.

@hadley
Copy link
Member

hadley commented Aug 22, 2020

Could you make them real links please?

Agreed about use in rlang - there are probably a few places we can use it now that we know it exists.

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you you please add a news bullet (it should briefly describe the change and end with (@yourname, #issuenumber)), and then I'll merge.

@hadley hadley merged commit cc2b8d6 into r-lib:master Aug 24, 2020
@klmr klmr deleted the fix-special-in-usage branch August 24, 2020 13:11
klmr added a commit to klmr/pkgdown that referenced this pull request Aug 2, 2021
@klmr klmr mentioned this pull request Aug 2, 2021
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.

None yet

2 participants