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

Extending roxygen vignette should mention how to add your extension to your workflow #1447

Closed
hughjonesd opened this issue Nov 21, 2022 · 3 comments · Fixed by #1525
Closed

Comments

@hughjonesd
Copy link
Contributor

I've been playing with a small package to write doctests in roxygen. The "extending roxygen" vignette has been very helpful. One thing I missed was some guidance on how to add a new roclet to your workflow.

Something like this:


## Adding a roclet to your workflow

To use a roclet when developing a package, call

    ```r
    roxygen2::roxygenize(roclets = "yourPackage::roclet")
    ```

where `yourPackage::roclet` is the function which creates the roclet.

You can also add the roclet to the target package DESCRIPTION file, like:

    ```r
    Roxygen: list(roclets = c("collate", "rd", "namespace", "yourPackage::roclet")) 
    ```

You can also optionally add your roclet package to the target package as a Suggests dependency:

    ```r
    usethis::use_dev_package("yourPackage", type = "Suggests", remote = "yourGithubID/yourPackage")
    ```

You don't have to do this, but it will help other developers working on the target package.

I can provide a PR if you want.

@moodymudskipper
Copy link

I would like to see the examples from the vignette implemented in an actual package. While I could define custom tags, I couldn't define custom roclets so far, even with the above.

@hadley
Copy link
Member

hadley commented Nov 2, 2023

A PR would be great if you're still interested.

@hughjonesd
Copy link
Contributor Author

First draft...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants