From 34b8c7e62b14220826db72c397ff7299c9b2c6b1 Mon Sep 17 00:00:00 2001 From: Mauro Lepore Date: Sat, 9 Feb 2019 13:28:16 -0500 Subject: [PATCH] Add an internal pkgdoc demo --- docs/articles/index.html | 2 +- .../siteonly/reference-chirunconf.html | 653 ++++++++++++++++++ .../crosstalk-1.0.0/css/crosstalk.css | 0 .../crosstalk-1.0.0/js/crosstalk.js | 0 .../crosstalk-1.0.0/js/crosstalk.js.map | 0 .../crosstalk-1.0.0/js/crosstalk.min.js | 0 .../crosstalk-1.0.0/js/crosstalk.min.js.map | 0 .../datatables-binding-0.5/datatables.js | 0 .../datatables-crosstalk.css | 0 .../css/jquery.dataTables.extra.css | 0 .../css/jquery.dataTables.min.css | 0 .../js/jquery.dataTables.min.js | 0 .../htmlwidgets-1.3/htmlwidgets.js | 0 .../jquery-1.12.4/LICENSE.txt | 0 .../jquery-1.12.4/jquery.min.js | 0 .../kePrint-0.0.1/kePrint.js | 8 + .../siteonly/reference-tidyverse.html | 16 +- docs/articles/siteonly/reference.html | 388 ----------- docs/index.html | 59 +- docs/pkgdown.yml | 2 +- docs/reference/pkgdoc-package.html | 152 ++++ docs/reference/search_docs.html | 18 +- man/pkgdoc-package.Rd | 25 + vignettes/siteonly/reference-chirunconf.Rmd | 127 ++++ vignettes/siteonly/reference.Rmd | 139 ---- 25 files changed, 1014 insertions(+), 575 deletions(-) create mode 100644 docs/articles/siteonly/reference-chirunconf.html rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/crosstalk-1.0.0/css/crosstalk.css (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/crosstalk-1.0.0/js/crosstalk.js (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/crosstalk-1.0.0/js/crosstalk.js.map (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/crosstalk-1.0.0/js/crosstalk.min.js (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/crosstalk-1.0.0/js/crosstalk.min.js.map (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/datatables-binding-0.5/datatables.js (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/datatables-css-0.0.0/datatables-crosstalk.css (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/dt-core-1.10.16/css/jquery.dataTables.extra.css (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/dt-core-1.10.16/css/jquery.dataTables.min.css (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/dt-core-1.10.16/js/jquery.dataTables.min.js (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/htmlwidgets-1.3/htmlwidgets.js (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/jquery-1.12.4/LICENSE.txt (100%) rename docs/articles/siteonly/{reference_files => reference-chirunconf_files}/jquery-1.12.4/jquery.min.js (100%) create mode 100644 docs/articles/siteonly/reference-chirunconf_files/kePrint-0.0.1/kePrint.js delete mode 100644 docs/articles/siteonly/reference.html create mode 100644 docs/reference/pkgdoc-package.html create mode 100644 man/pkgdoc-package.Rd create mode 100644 vignettes/siteonly/reference-chirunconf.Rmd delete mode 100644 vignettes/siteonly/reference.Rmd diff --git a/docs/articles/index.html b/docs/articles/index.html index 602e0fd..da1adeb 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -101,8 +101,8 @@

All vignettes

diff --git a/docs/articles/siteonly/reference-chirunconf.html b/docs/articles/siteonly/reference-chirunconf.html new file mode 100644 index 0000000..147eb0c --- /dev/null +++ b/docs/articles/siteonly/reference-chirunconf.html @@ -0,0 +1,653 @@ + + + + + + + +Demo of <a href="https://maurolepore.github.io/pkgdoc/">pkgdoc</a> for the <a href="https://chirunconf.github.io/">Chicago R Unconference</a> • pkgdoc + + + + + + +

pkgdoc for the Chicago R Unconference" /> + +

+
+
+ + + +
+ + + +
+
+ + + + +
+

+Introduction

+

pkgdoc helps you to reference R documentation across multiple packages, by packages and by concept. pkgdoc does for any number of packages what pkgdown does for a single package.

+
+
+

+Motivation

+

This article will show you different products that you can create with pkgdoc. Imagine you are organizing the Chicago R Unconference. Here you will use pkgdoc to centralize the references of the great packages developed during the event.

+ +

The examples below show real packages developed by Emily Riederer and Alex Hayes. But let’s imagine that these packages were developed during the Chicago R Unconference.

+
library(projmgr)
+library(formulize)
+library(safepredict)
+
+emi_alex <- c("projmgr", "formulize", "safepredict")
+
+
+

+A tibble

+

You can pull the documentation of the packages they built with pkgdoc::search_docs().

+ +

What concepts were covered (created with the tag @family)?

+ +

Emily and Alex worked in different teams and submitted their packages to a single organization, which serves the websites of the packages they built (here ‘maurolepore.github.io’ but think ‘chirunconf.github.io’).

+ +
+
+

+A searchable widget

+

You can create links to online documentation with pkgdoc::reference_package().

+
emi_alex %>% 
+  purrr::map_dfr(reference_package, url = chirunconf) %>% 
+  DT::datatable(
+    escape = FALSE,
+    rownames = NULL,
+    options = list(search = list(search = "issues"))
+  )
+
+ +
+
+

+An OK index

+

You can create an index by package with reference_package().

+
by_alex <- c("formulize", "safepredict")
+
+by_alex %>% 
+  reference_package(, url = chirunconf) %>% 
+  knitr::kable(escape = FALSE)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+topic + +alias + +title + +concept + +package +
+? + +add_id_column + +Add row numbers to a tibble + +NA + +safepredict +
+? + +binomial_helper + +TODO + +NA + +safepredict +
+? + +formulize + +Create a formula/recipe interface to a modelling method + +chirunconf + +formulize +
+? + +genericize + +Turn a modelling function into an S3 modelling generic + +chirunconf + +formulize +
+? + +multi_predict, multi_predict.default + +Safely predict from many fits at once + +NA + +safepredict +
+? + +multi_predict.cv.glmnet + +Safe predictions for cross-validated glmnet objects + +glmnet + +safepredict +
+? + +multi_predict.glmnet + +Safe predictions for cross-validated glmnet objects + +NA + +safepredict +
+? + +predict + +Predict on new data form a ‘wrapped’ object + +chirunconf + +formulize +
+? + +predict_or_na + +Predict at a single observation or return NA + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a C5 classification tree + +NA + +safepredict +
+? + +safe_predict + +Safely predict from a model object + +NA + +safepredict +
+? + +safe_predict + +Safe predictions for cross-validated glmnet objects + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a generalized linear model + +NA + +safepredict +
+? + +safe_predict + +Safe predictions for glmnet objects + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a linear model + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a loess object + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a multiple linear model object + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from an nls object + +NA + +safepredict +
+? + +safe_predict + +Safe predictions from a smooth.spline object + +NA + +safepredict +
+? + +suggest_sweep, safe_predict + +Predictions from time series models + +NA + +safepredict +
+
+

+A nice index by concept

+

Let’s write a helper to produce an output similar to the ‘Reference’ section of a pkgdown website. This helper may become a function in pkgdoc.

+ +

With pkgdoc::reference_concept() you can gather documentation by concept across multiple packages. Here, the functions that start with browse_ come from one package and all other functions come from a different one (follow the links to confirm).

+
pkgdoc::reference_concept("chirunconf", url = chirunconf) %>% 
+  nice_kable()
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+? + +browse_docs + +View GitHub API documentation +
+? + +browse_issues + +Browse issues for given GitHub repo +
+? + +browse_milestones + +Browse milestones for given GitHub repo +
+? + +browse_repo + +Browse a given GitHub repo +
+? + +formulize + +Create a formula/recipe interface to a modelling method +
+? + +genericize + +Turn a modelling function into an S3 modelling generic +
+? + +predict + +Predict on new data form a ‘wrapped’ object +
+
+
+
+ + + +
+ + +
+ +
+

Site built with pkgdown 1.3.0.

+
+
+
+ + + + + + diff --git a/docs/articles/siteonly/reference_files/crosstalk-1.0.0/css/crosstalk.css b/docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/css/crosstalk.css similarity index 100% rename from docs/articles/siteonly/reference_files/crosstalk-1.0.0/css/crosstalk.css rename to docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/css/crosstalk.css diff --git a/docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.js b/docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.js similarity index 100% rename from docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.js rename to docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.js diff --git a/docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.js.map b/docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.js.map similarity index 100% rename from docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.js.map rename to docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.js.map diff --git a/docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.min.js b/docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.min.js similarity index 100% rename from docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.min.js rename to docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.min.js diff --git a/docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.min.js.map b/docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.min.js.map similarity index 100% rename from docs/articles/siteonly/reference_files/crosstalk-1.0.0/js/crosstalk.min.js.map rename to docs/articles/siteonly/reference-chirunconf_files/crosstalk-1.0.0/js/crosstalk.min.js.map diff --git a/docs/articles/siteonly/reference_files/datatables-binding-0.5/datatables.js b/docs/articles/siteonly/reference-chirunconf_files/datatables-binding-0.5/datatables.js similarity index 100% rename from docs/articles/siteonly/reference_files/datatables-binding-0.5/datatables.js rename to docs/articles/siteonly/reference-chirunconf_files/datatables-binding-0.5/datatables.js diff --git a/docs/articles/siteonly/reference_files/datatables-css-0.0.0/datatables-crosstalk.css b/docs/articles/siteonly/reference-chirunconf_files/datatables-css-0.0.0/datatables-crosstalk.css similarity index 100% rename from docs/articles/siteonly/reference_files/datatables-css-0.0.0/datatables-crosstalk.css rename to docs/articles/siteonly/reference-chirunconf_files/datatables-css-0.0.0/datatables-crosstalk.css diff --git a/docs/articles/siteonly/reference_files/dt-core-1.10.16/css/jquery.dataTables.extra.css b/docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/css/jquery.dataTables.extra.css similarity index 100% rename from docs/articles/siteonly/reference_files/dt-core-1.10.16/css/jquery.dataTables.extra.css rename to docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/css/jquery.dataTables.extra.css diff --git a/docs/articles/siteonly/reference_files/dt-core-1.10.16/css/jquery.dataTables.min.css b/docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/css/jquery.dataTables.min.css similarity index 100% rename from docs/articles/siteonly/reference_files/dt-core-1.10.16/css/jquery.dataTables.min.css rename to docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/css/jquery.dataTables.min.css diff --git a/docs/articles/siteonly/reference_files/dt-core-1.10.16/js/jquery.dataTables.min.js b/docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/js/jquery.dataTables.min.js similarity index 100% rename from docs/articles/siteonly/reference_files/dt-core-1.10.16/js/jquery.dataTables.min.js rename to docs/articles/siteonly/reference-chirunconf_files/dt-core-1.10.16/js/jquery.dataTables.min.js diff --git a/docs/articles/siteonly/reference_files/htmlwidgets-1.3/htmlwidgets.js b/docs/articles/siteonly/reference-chirunconf_files/htmlwidgets-1.3/htmlwidgets.js similarity index 100% rename from docs/articles/siteonly/reference_files/htmlwidgets-1.3/htmlwidgets.js rename to docs/articles/siteonly/reference-chirunconf_files/htmlwidgets-1.3/htmlwidgets.js diff --git a/docs/articles/siteonly/reference_files/jquery-1.12.4/LICENSE.txt b/docs/articles/siteonly/reference-chirunconf_files/jquery-1.12.4/LICENSE.txt similarity index 100% rename from docs/articles/siteonly/reference_files/jquery-1.12.4/LICENSE.txt rename to docs/articles/siteonly/reference-chirunconf_files/jquery-1.12.4/LICENSE.txt diff --git a/docs/articles/siteonly/reference_files/jquery-1.12.4/jquery.min.js b/docs/articles/siteonly/reference-chirunconf_files/jquery-1.12.4/jquery.min.js similarity index 100% rename from docs/articles/siteonly/reference_files/jquery-1.12.4/jquery.min.js rename to docs/articles/siteonly/reference-chirunconf_files/jquery-1.12.4/jquery.min.js diff --git a/docs/articles/siteonly/reference-chirunconf_files/kePrint-0.0.1/kePrint.js b/docs/articles/siteonly/reference-chirunconf_files/kePrint-0.0.1/kePrint.js new file mode 100644 index 0000000..e6fbbfc --- /dev/null +++ b/docs/articles/siteonly/reference-chirunconf_files/kePrint-0.0.1/kePrint.js @@ -0,0 +1,8 @@ +$(document).ready(function(){ + if (typeof $('[data-toggle="tooltip"]').tooltip === 'function') { + $('[data-toggle="tooltip"]').tooltip(); + } + if ($('[data-toggle="popover"]').popover === 'function') { + $('[data-toggle="popover"]').popover(); + } +}); diff --git a/docs/articles/siteonly/reference-tidyverse.html b/docs/articles/siteonly/reference-tidyverse.html index 33073a0..ad0e063 100644 --- a/docs/articles/siteonly/reference-tidyverse.html +++ b/docs/articles/siteonly/reference-tidyverse.html @@ -85,12 +85,12 @@

Created by the library(DT)

Let’s pull the documenation of all core-tidyverse-packages with pkgdoc.

+#> # ... with 356 more rows

reference_package() and reference_concept() include the argument url but it only works if all packages are under the GitHub organization and the url is formatted as https://{organization}.github.io/{package}/. But we can create arbitrary links easily with glue::glue().

+#> # ... with 356 more rows

We are now read to create a searchable table with DT::datatable().

linked %>% 
   datatable(
@@ -140,8 +140,8 @@ 

Created by the search = list(search = "filter") ) )

-
- +
+