Skip to content

Commit

Permalink
Merge pull request #92 from bburns632/feature/passCran
Browse files Browse the repository at this point in the history
Changes to Remain in CRAN Compliance
  • Loading branch information
bburns632 authored Apr 30, 2018
2 parents 274813a + 4e2fba7 commit 5f43ab6
Show file tree
Hide file tree
Showing 10 changed files with 5,611 additions and 295 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pkgnet
Type: Package
Title: Get Network Representation of an R Package
Version: 0.1.0.9000
Version: 0.2.0.9000
Authors@R: c(
person("Brian", "Burns", email = "[email protected]", role = c("aut", "cre")),
person("James", "Lamb", email = "[email protected]", role = c("aut")),
Expand All @@ -25,7 +25,7 @@ Imports:
methods,
mvbutils,
R6,
rmarkdown,
rmarkdown(>= 1.9),
tools,
visNetwork
Suggests:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ importFrom(mvbutils,foodweb)
importFrom(rmarkdown,render)
importFrom(tools,file_path_as_absolute)
importFrom(tools,package_dependencies)
importFrom(utils,browseURL)
importFrom(utils,installed.packages)
importFrom(utils,lsf.str)
importFrom(visNetwork,visEdges)
Expand Down
5 changes: 4 additions & 1 deletion R/CreatePackageReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
#' report will be produced in working directory.
#' @importFrom assertthat assert_that is.string
#' @importFrom methods is
#' @importFrom utils browseURL
#' @return A list of instantiated pkg_reporters fitted to \code{pkg_name}
#' @export
CreatePackageReport <- function(pkg_name
, pkg_reporters = DefaultReporters()
, pkg_path = NULL
, report_path = file.path(getwd(), paste0(pkg_name, "_report.html"))
, report_path = tempfile(pattern = pkg_name, fileext = ".html")
) {
# Input checks
assertthat::assert_that(
Expand Down Expand Up @@ -51,6 +52,8 @@ CreatePackageReport <- function(pkg_name
, pkg_name = pkg_name
)

utils::browseURL(report_path)

return(invisible(builtReporters))
}

Expand Down
4 changes: 4 additions & 0 deletions inst/package_report/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- This is HTML code for the header at the top of the page -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="http://uptakeopensource.github.io/pkgnet">pkgnet</a>
</nav>
4 changes: 0 additions & 4 deletions inst/package_report/package_dependency_reporter.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: "Package Dependency Report"
output: html_document
---

## Dependency Network

Expand Down
13 changes: 3 additions & 10 deletions inst/package_report/package_report.Rmd
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
---
name: "pkgnet"
title: "`r params$pkg_name`"
output:
html_document:
self_contained: TRUE
theme: flatly
include:
in_header: header.html
after_body: footer.html
params:
reporters: params$reporters
pkg_name: params$pkg_name
---

<!-- This is HTML code for the header at the top of the page -->
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="http://uptakeopensource.github.io/pkgnet">pkgnet</a>
</nav>

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
pkgnet:::silence_logger()
```

```{r title, results="asis"}
cat(sprintf("# %s", pkg_name))
```

```{r}
reportTabs <- lapply(params$reporters, function(reporter) {
report_env <- list2env(list(reporter = reporter))
Expand All @@ -33,6 +25,7 @@ reportTabs <- lapply(params$reporters, function(reporter) {
, envir = report_env
)
})
```

```{r results="asis"}
Expand Down
4 changes: 0 additions & 4 deletions inst/package_report/package_summary_reporter.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: "Package Summary Report"
output: html_document
---

## Package Summary

Expand Down
4 changes: 2 additions & 2 deletions man/CreatePackageReport.Rd

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

Loading

0 comments on commit 5f43ab6

Please sign in to comment.