Skip to content

Commit

Permalink
Merge pull request #13 and bump to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemahoney218 committed Dec 30, 2019
2 parents 8ff3bf2 + e0e3cac commit ef85422
Show file tree
Hide file tree
Showing 44 changed files with 5,660 additions and 77 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ docs/.*
^\.github$
^\.covrignore$
prepare_development_branch.sh
cran-comments.md
^doc$
^Meta$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
devel/*
.Rhistory
*.Rproj
inst/doc
doc
Meta
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: r
r:
- 3.2
- 3.3
- 3.4
- 3.5
- 3.6
Expand All @@ -11,10 +9,6 @@ os:
- osx
jobs:
exclude:
- r: 3.2
os: osx
- r: 3.3
os: osx
- r: devel
os: osx
after_success:
Expand Down
18 changes: 11 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
Package: heddlr
Title: Dynamic R Markdown Document Generation
Version: 0.3.0
Version: 0.3.1
Authors@R:
person(given = "Michael",
family = "Mahoney",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "https://orcid.org/0000-0003-2402-304X"))
Description: heddlr is a package designed to make
dynamically generating R Markdown documents easier, by providing an
easy way to create section patterns, define how those patterns work
together to form a template, and then using data to generate a report
that fits your templating needs.
Description: Helper functions designed to make
dynamically generating R Markdown documents easier by providing a
simple and tidy way to create report pieces, shape them to your data,
and combine them for exporting into a single R Markdown document.
License: MIT + file LICENSE
Depends:
R (>= 3.2.5)
Expand All @@ -26,7 +25,12 @@ Suggests:
roxygen2,
testthat (>= 2.1.0),
dplyr,
tidyr
tidyr,
nycflights13,
ggplot2,
knitr,
purrr
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
VignetteBuilder: knitr
6 changes: 5 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Generated by roxygen2: do not edit by hand

S3method(heddle,data.frame)
S3method(heddle,default)
S3method(make_template,data.frame)
S3method(make_template,default)
export(":=")
export(.data)
export(as_label)
Expand All @@ -8,6 +12,7 @@ export(assemble_draft)
export(create_yaml_header)
export(enquo)
export(enquos)
export(export_template)
export(expr)
export(heddle)
export(import_pattern)
Expand All @@ -21,6 +26,5 @@ importFrom(rlang,as_name)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,expr)
importFrom(rlang,set_names)
importFrom(rlang,sym)
importFrom(rlang,syms)
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# Version 0.3.1 (2019-12-29)

* New vignettes introducing the concepts behind heddlr
* New hidden docs pages to be linked from vignettes and other docs
* Fixed a few latent bugs in heddle:
* Export methods in order to, well, use the methods
* Fixed a few latent bugs in make_template:
* Export methods in order to, well, use the methods
* Fix vector handling so nested vectors are flattened properly
* Export export_template and fix documentation
* Internal changes (only build on R 3.4 and up, change description to pass
R CMD check)
* Add Suggests for vignettes



# Version 0.3.0 (2019-12-28)

* Implement `heddle` function, making it easy to swap out placeholder keywords
Expand Down
1 change: 0 additions & 1 deletion R/create_yaml_header.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ create_yaml_header <- function(...,

header.content <- vector("list")
for (i in seq_along(yaml.parts)) {

if (length(names(yaml.parts[i])) == 0) {
header.content <- c(header.content, yaml.parts[[i]])
} else if (names(yaml.parts[i]) == "") {
Expand Down
4 changes: 3 additions & 1 deletion R/export_template.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Safely export templates to file.
#'
#' This is a simple wrapper function around \code{\link[utf8]{as_utf8}} and
#' \code{\link{[base]{writeLines}}, letting users write their template strings
#' \code{\link[base]{writeLines}}, letting users write their template strings
#' to file without having to worry about file encodings. For more details on
#' why UTF-8 encoding is necessary, check out
#' [Yihui Xie's](https://yihui.org/en/2018/11/biggest-regret-knitr/) post on
Expand All @@ -24,6 +24,8 @@
#' filename parameter is expected to be a string (that is, a character
#' vector). Setting the value to FALSE disables the warning when a
#' non-character argument is passed, but this is unsupported functionality.
#'
#' @export

export_template <- function(template,
filename,
Expand Down
2 changes: 2 additions & 0 deletions R/heddle.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ heddle <- function(data, pattern, ..., strip.whitespace = F) {
UseMethod("heddle")
}

#' @export
heddle.default <- function(data, pattern, ..., strip.whitespace = F) {
dots <- list(...)
if (length(dots) == 0) stop("argument '...' is missing, with no default")
Expand All @@ -45,6 +46,7 @@ heddle.default <- function(data, pattern, ..., strip.whitespace = F) {
)
}

#' @export
heddle.data.frame <- function(data, pattern, ..., strip.whitespace = F) {
dots <- enquos(...)
if (any(names(dots) == "") || any(is.null(names(dots)))) {
Expand Down
8 changes: 5 additions & 3 deletions R/make_template.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ make_template <- function(data, ...) {
UseMethod("make_template")
}

#' @export
make_template.default <- function(data, ...) {
dots <- list(...)
output <- vector("character", length(dots) + 1)
output <- vector("list", length(dots) + 1)
output[[1]] <- paste0(data, collapse = "")
if (length(dots) != 0) {
for (i in 1:length(dots)) {
output[[i + 1]] <- paste0(dots[[i]], collapse = "")
output[[i + 1]] <- paste0(unlist(dots[[i]]), collapse = "")
}
}
paste0(output, collapse = "")
paste0(unlist(output), collapse = "")
}

#' @export
make_template.data.frame <- function(data, ...) {
dots <- enquos(...)
if (length(dots) == 0) stop("argument '...' is missing, with no default")
Expand Down
2 changes: 1 addition & 1 deletion R/utils-tidy-eval.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#' @md
#' @name tidyeval
#' @keywords internal
#' @importFrom rlang expr enquo enquos sym syms set_names .data := as_name as_label
#' @importFrom rlang expr enquo enquos sym syms .data := as_name as_label
#' @aliases expr enquo enquos sym syms .data := as_name as_label
#' @export expr enquo enquos sym syms .data := as_name as_label
NULL
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,3 @@ compatible with `heddlr`, because `heddlr` just doesn’t care what your
end result will look like – its only goal is to make it easier for you
to get there.

Code of Conduct
---------------

Please note that the ‘heddlr’ project is released with a [Contributor
Code of Conduct](.github/CODE_OF_CONDUCT.md). By contributing to this project,
you agree to abide by its terms.
22 changes: 22 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Test environments
* Local Ubuntu 19.04 install, R 3.6.2
* Linux 16.04 (travis-ci), R devel, 3.6.2, 3.5.3, 3.4.4
* Mac OSX (travis-ci), R 3.6.2, 3.5.3, 3.4.4
* win-builder (devel and release)

## R CMD check results

There were no ERRORs or WARNINGs.

There was one NOTE:

* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Michael Mahoney <[email protected]>'

New submission

This is my first submission of this or any package.

## Downstream Dependencies

There are currently no downstream dependencies for this package.
17 changes: 16 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 18 additions & 9 deletions docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions docs/ISSUE_TEMPLATE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ef85422

Please sign in to comment.