1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vignette.R
\name{rnw}
\alias{rnw}
\alias{isManualVignette}
\alias{as.rnw}
\alias{rnwCompiler}
\alias{rnwWrapper}
\alias{rnwDriver}
\alias{rnwIncludes}
\alias{rnwChildren}
\alias{vignetteMakefile}
\alias{compactVignettes}
\title{Utilities for Vignettes}
\usage{
rnw(x, file = NULL, ..., raw = FALSE)
isManualVignette()
as.rnw(x, ..., load = TRUE)
rnwCompiler(x, verbose = TRUE)
rnwWrapper(x, verbose = TRUE)
rnwDriver(x)
rnwIncludes(x)
rnwChildren(x)
vignetteMakefile(
package = NULL,
skip = NULL,
print = TRUE,
template = NULL,
temp = FALSE,
checkMode = isCHECK() || vignetteCheckMode(),
user = NULL,
tests = TRUE
)
compactVignettes(paths, ...)
}
\arguments{
\item{x}{vignette source file specification as a path or a \code{rnw} object.}
\item{file}{output file}
\item{...}{extra arguments passed to \code{as.rnw} that can be used to force
certain building parameters.}
\item{raw}{a logical that indicates if the raw result for the compilation
should be returned, instead of the result file path.}
\item{load}{logical to indicate if all the object's properties should loaded,
which is done by parsing the file and look up for specific tags.}
\item{verbose}{logical that toggles verbosity}
\item{package}{package name.
If \code{NULL}, a DESRIPTION file is looked for one directory up: this
meant to work when building a vignette directly from a package's
\code{'vignettes'} sub-directory.}
\item{skip}{Vignette files to skip (basename).}
\item{print}{logical that specifies if the path should be printed or
only returned.}
\item{template}{template Makefile to use.
The default is to use the file \dQuote{vignette.mk} shipped with the package
\pkg{pkgmaker} and can be found in its install root directory.}
\item{temp}{logical that indicates if the generated makefile should using a
temporary filename (\code{TRUE}), or simply named \dQuote{vignette.mk}}
\item{checkMode}{logical that indicates if the vignettes should be generated as in a
CRAN check (\code{TRUE}) or in development mode, in which case \code{pdflatex}, \code{bibtex},
and, optionally, \code{qpdf} are required.}
\item{user}{character vector containing usernames that enforce \code{checkMode=TRUE},
if the function is called from within their session.}
\item{tests}{logical that enables the compilation of a vignette that gathers all unit
test results.
Note that this means that all unit tests are run before generating the vignette.
However, unit tests are not (re)-run at this stage when the vignettes are built
when checking the package with \code{R CMD check}.}
\item{paths}{A character vector of paths to PDF files, or a length-one
character vector naming a directory, when all \file{.pdf} files in
that directory will be used.}
}
\value{
\code{rnw} returns the result of compiling the vignette with \link{runVignette}.
}
\description{
\code{rnw} provides a unified interface to run vignettes that detects
the type of vignette (Sweave or knitr), and which Sweave driver
to use (either automatically or from an embedded command \code{\\VignetteDriver}
command).
}
\section{Functions}{
\itemize{
\item \code{isManualVignette()}: tells if a vignette is being run through the function \code{runVignette}
of \pkg{pkgmker}, allowing disabling behaviours not allowed in package vignettes that are
checked vi \code{R CMD check}.
\item \code{as.rnw()}: creates a S3 \code{rnw} object that contains information
about a vignette, e.g., source filename, driver, fixed included files, etc..
\item \code{rnwCompiler()}: tries to detect the vignette compiler to use on a vignette
source file, e.g., \code{\link{Sweave}} or \link[knitr:knitr-package]{knitr}.
\item \code{rnwWrapper()}: tries to detect the type of vignette and if it is meant
to be wrapped into another main file.
\item \code{rnwDriver()}: tries to detect Sweave driver to use on a vignette source
file, e.g., \code{SweaveCache}, \code{highlight}, etc..
\item \code{rnwIncludes()}: detects fixed includes, e.g., image or pdf files, that are
required to build the final document.
\item \code{rnwChildren()}: detects included vignette documents and return them as a
list of vignette objects.
\item \code{vignetteMakefile()}: returns the path to a generic makefile used to make
vignettes.
\item \code{compactVignettes()}: compacts vignette PDFs using either \code{gs_quality='none'} or \code{'ebook'},
depending on which compacts best (as per CRAN check criteria).
}}
|