regextools extends the devtools, roxygen2, & testthat packages to regular expressions library documentation, testing, and storage. The framework assumes the user will document and store regular expressions as an R package via the devtools, roxygen2, & testthat packages. This extends these existing frameworks to work make regular expression management easier for long term documentation, maintenance, and
testing. The only change to these existing frameworks is that the user must include a tag @section Regex: TRUE
in the roxygen2 markup, indicating the object is a regular expression.
regextools is a philosophy of regular expression management that sees unit testing and transparency of test coverage as an essential part of maintaining a regular expression library. In the spirit of transparent unit testing, regextools adds functions to test regular expressions, extending the testthat package. This avoids unforeseen breaks due to changes in a regular expression and explicitally describes the expression's intended behavior. regextools offers a template system that encourages this transparent unit testing philosophy through the use of GitHub, Travis-CI, and the covr package to indicate coverage in the GitHub README.md.
regextools also highlights the need for minimal, clear, description of a regular expression's behavior. regextools provides tools to generate html, .md, and .Rmd vignettes from existing roxygen2 markup rather than the more verbose package help documentation. Regular expressions are often difficult to parse, particularly as the expression's complexity grows. Visual presentation of the regular expression can enhance the maintainer and user's abilities to understand the expression's design. regextools includes a link/iframe of Debuggex's terrific visual diagram representation of regular expressions.
To download the development version of regextools:
Download the zip ball or tar ball, decompress and run R CMD INSTALL
on it, or use the pacman package to install the development version:
if (!require("pacman")) install.packages("pacman") pacman::p_load_gh("trinker/regextools")
You are welcome to: submit suggestions and bug-reports at: https://github.com/trinker/regextools/issues send a pull request on: https://github.com/trinker/regextools/ * compose a friendly e-mail to: tyler.rinker@gmail.com
library(regextools) thefuns <- readLines("vignettes/functions_table/functions.R") cat(paste(thefuns, collapse="\n"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.