Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/more defaults #20

Merged
merged 6 commits into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_install:
- ./run.sh bootstrap

install:
- ./run.sh install_aptget r-cran-htmltools r-cran-knitr r-cran-rmarkdown
- ./run.sh install_aptget r-cran-htmltools r-cran-knitr r-cran-rmarkdown r-cran-ggplot2

script:
- ./run.sh run_tests
Expand Down
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2017-11-01 Dirk Eddelbuettel <edd@debian.org>

* vignettes/tintPDF.Rmd (vignette): New PDF vignette
* vignettes/tintHTML.Rmd (vignette): New HTML vignette

* DESCRIPTION: Added 'VignetteDriver: knitr', 'Suggests: ggplot2'
* .travis.yml (install): Also install r-cran-ggplot2

2017-10-31 Dirk Eddelbuettel <edd@debian.org>

* R/pdf.R (tintPdf): More default argument
* inst/examples/simplePdf.Rmd: Shorter YAML frontmatter
* inst/examples/simpleHtml.Rmd: Idem
* inst/rmarkdown/templates/pdf/skeleton/skeleton.Rmd: Idem
* inst/rmarkdown/templates/html/skeleton/skeleton.Rmd: Idem

2017-04-16 Dirk Eddelbuettel <edd@debian.org>

* .travis.yml (before_install): Use https to download
Expand Down
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Package: tint
Type: Package
Title: Tint is not Tufte
Version: 0.0.3
Date: 2016-10-15
Version: 0.0.3.2
Date: 2017-11-01
Author: Dirk Eddelbuettel
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Description: A 'tufte'-alike style for 'rmarkdown'.
URL: http://dirk.eddelbuettel.com/code/tint.html
BugReports: https://github.com/eddelbuettel/tint/issues
Imports: htmltools, knitr, rmarkdown
Suggests: ggplot2
VignetteBuilder: knitr
License: GPL-3
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
2 changes: 1 addition & 1 deletion R/html.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ tintHtml <- function(...) {
format
}

#' @importFrom htmltools htmlDependency
# ' @ import From htmltools htmlDependency
tint_html_dependency = function() {
list(htmlDependency(
## tufte-css', '2015.12.29',
Expand Down
13 changes: 8 additions & 5 deletions R/pdf.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#' @inheritParams rmarkdown::pdf_document
#' @rdname tintHtml
tintPdf <- function(fig_width = 4, fig_height = 2.5, fig_crop = TRUE, dev = 'pdf',
highlight = 'default', ...) {
tintPdfCreate('tufte-handout', fig_width, fig_height, fig_crop, dev, highlight, ...)
tintPdf <- function(fig_width = 4, fig_height = 2.5, fig_crop = TRUE,
dev = 'pdf', highlight = 'default',
citation_package = 'natbib', latex_engine = 'pdflatex', ...) {
tintPdfCreate('tufte-handout', fig_width, fig_height, fig_crop,
dev, highlight, citation_package, ...)
}

tintPdfCreate <- function(documentclass = c('tufte-handout', 'tufte-book'),
fig_width = 4, fig_height = 2.5,
fig_crop = TRUE, dev = 'pdf', highlight = 'default',
fig_width = 4, fig_height = 2.5, fig_crop = TRUE,
dev = 'pdf', highlight = 'default', citation_package = 'natbib',
template = template_resources('pdf', 'tintPdf-template.tex'), ...) {

## resolve default highlight
Expand All @@ -16,6 +18,7 @@ tintPdfCreate <- function(documentclass = c('tufte-handout', 'tufte-book'),
## call the base pdf_document format with the appropriate options
format <- rmarkdown::pdf_document(fig_width = fig_width, fig_height = fig_height,
fig_crop = fig_crop, dev = dev, highlight = highlight,
citation_package = citation_package,
template = template, ...)

## LaTeX document class
Expand Down
4 changes: 1 addition & 3 deletions inst/examples/simpleHtml.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: "Tint Is Not Tufte"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire, Yihui Xie, Dirk Eddelbuettel"
date: "`r Sys.Date()`"
output:
tint::tintHtml:
self_contained: TRUE
output: tint::tintHtml
---

```{r setup, include=FALSE}
Expand Down
4 changes: 1 addition & 3 deletions inst/examples/simplePdf.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: "Tint Is Not Tufte"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire, Yihui Xie, Dirk Eddelbuettel"
date: "`r Sys.Date()`"
output:
tint::tintPdf:
latex_engine: pdflatex
output: tint::tintPdf
---

```{r setup, include=FALSE}
Expand Down
6 changes: 2 additions & 4 deletions inst/rmarkdown/templates/html/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ title: "Tint Is Not Tufte"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire, Yihui Xie, Dirk Eddelbuettel"
date: "`r Sys.Date()`"
output:
tint::tintHtml:
self_contained: TRUE
output: tint::tintHtml
bibliography: skeleton.bib
link-citations: yes
---
Expand Down Expand Up @@ -223,7 +221,7 @@ There are a few other things in Tufte CSS that we have not mentioned so far. If

We hope you will enjoy the simplicity of R Markdown and this R package, and we sincerely thank the authors of the Tufte-CSS and Tufte-LaTeX projects for developing the beautiful CSS and LaTeX classes. Our **tufte** package would not have been possible without their heavy lifting.

To see the R Markdown source of this example document, you may follow [this link to Github](https://github.com/rstudio/tufte/raw/master/inst/rmarkdown/templates/tufte_html/skeleton/skeleton.Rmd), use the wizard in RStudio IDE (`File -> New File -> R Markdown -> From Template`), or open the Rmd file in the package:
To see the R Markdown source of this example document, you may follow [this link to Github](https://github.com/eddelbuettel/tint/blob/master/inst/rmarkdown/templates/html/skeleton/skeleton.Rmd), use the wizard in RStudio IDE (`File -> New File -> R Markdown -> From Template`), or open the Rmd file in the package:

```{r eval=FALSE}
file.edit(
Expand Down
7 changes: 2 additions & 5 deletions inst/rmarkdown/templates/pdf/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ title: "Tint Is Not Tufte"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire, Yihui Xie, Dirk Eddelbuettel"
date: "`r Sys.Date()`"
output:
tint::tintPdf:
citation_package: natbib
latex_engine: pdflatex
output: tint::tintPdf
bibliography: skeleton.bib
link-citations: yes
---
Expand Down Expand Up @@ -224,7 +221,7 @@ There are a few other things in Tufte CSS that we have not mentioned so far. If

We hope you will enjoy the simplicity of R Markdown and this R package, and we sincerely thank the authors of the Tufte-CSS and Tufte-LaTeX projects for developing the beautiful CSS and LaTeX classes. Our **tufte** package would not have been possible without their heavy lifting.

To see the R Markdown source of this example document, you may follow [this link to Github](https://github.com/rstudio/tufte/raw/master/inst/rmarkdown/templates/tufte_html/skeleton/skeleton.Rmd), use the wizard in RStudio IDE (`File -> New File -> R Markdown -> From Template`), or open the Rmd file in the package:
To see the R Markdown source of this example document, you may follow [this link to Github](https://github.com/eddelbuettel/tint/blob/master/inst/rmarkdown/templates/pdf/skeleton/skeleton.Rmd), use the wizard in RStudio IDE (`File -> New File -> R Markdown -> From Template`), or open the Rmd file in the package:

```{r eval=FALSE}
file.edit(
Expand Down
18 changes: 12 additions & 6 deletions man/tintHtml.Rd

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

Loading