Giter VIP home page Giter VIP logo

devtag's Introduction

devtag

{devtag} allows you to use @dev tags in your roxygen2 headers so you’ll generate help files for unexported objects, that you will enjoy during development but won’t be accessible for users that install your package.

This is done by adding the relevant help files to “.Rbuildignore” when documenting the package with {roxygen2} (usually through devtools::document())

These files are not git ignored so they are version-controlled and shared with contributors of your repo.

Installation

Install with

remotes::install_github("moodymudskipper/devtag")

How to use

To use {devtag} :

  1. Use “@dev” for unexported functions where you would have used “@export” for exported functions.

  2. Have in your DESCRIPTION file the line :

Roxygen: list(markdown = TRUE, roclets = c("collate", "rd", "namespace", "devtag::dev_roclet"))

This will make sure that when you call document() {devtag} will be triggered.

  1. Have in your yourpkg.Rproj file the line:
PackageRoxygenize: rd,collate,namespace,devtag::dev_roclet

This will make sure than Ctrl+Shift+D, or documenting through the UI in RStudio, triggers {devtag}. You can call file.edit("yourpkg.Rproj") since clicking on the file might open the project rather than open the file for editing.

  1. That’s it! Note that to check that it works you’ll need to use devtools::install(), clicking the Install button in the build pane will still install the build ignored help files with the package (not really a bad thing on your machine anyway).

Example package

We set up the package {devtag.example} as an example. You can check the code at https://github.com/moodymudskipper/devtag.example

If you install it you won’t be able to see the help file for the subtract() function, but if you clone it and use a {devtools} workflow you will had access to it.

Comparison to @noRd and @keywords internal

  • @noRd doesn’t produce help files, it basically makes your roxygen2 blocks regular comments that look like regular documentation
  • @keywords internal removes help files from the index but they are still accessible by users

devtag's People

Contributors

moodymudskipper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

devtag's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.