| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/sass.R |
| 3 |
\name{output_template} |
| 4 |
\alias{output_template} |
| 5 |
\title{An intelligent (temporary) output file} |
| 6 |
\usage{ |
| 7 |
output_template( |
| 8 |
basename = "sass", |
| 9 |
dirname = basename, |
| 10 |
fileext = NULL, |
| 11 |
path = tempdir() |
| 12 |
) |
| 13 |
} |
| 14 |
\arguments{ |
| 15 |
\item{basename}{a non-empty character string giving the outfile name (without |
| 16 |
the extension).} |
| 17 |
|
| 18 |
\item{dirname}{a non-empty character string giving the initial part of the |
| 19 |
directory name.} |
| 20 |
|
| 21 |
\item{fileext}{the output file extension. The default is \code{".min.css"} for |
| 22 |
compressed and compact output styles; otherwise, its \code{".css"}.} |
| 23 |
|
| 24 |
\item{path}{the output file's root directory path.} |
| 25 |
} |
| 26 |
\value{ |
| 27 |
A function with two arguments: \code{options} and \code{suffix}. When called inside |
| 28 |
\code{\link[=sass]{sass()}} with caching enabled, the caching key is supplied to \code{suffix}. |
| 29 |
} |
| 30 |
\description{ |
| 31 |
Intended for use with \code{\link[=sass]{sass()}}'s \code{output} argument for temporary file |
| 32 |
generation that is \code{cache} and \code{options} aware. In particular, this ensures |
| 33 |
that new redundant file(s) aren't generated on a \code{\link[=sass]{sass()}} cache hit, and that |
| 34 |
the file's extension is suitable for the \code{\link[=sass_options]{sass_options()}}'s \code{output_style}. |
| 35 |
} |
| 36 |
\examples{ |
| 37 |
sass("body {color: red}", output = output_template()) |
| 38 |
|
| 39 |
func <- output_template(basename = "foo", dirname = "bar-") |
| 40 |
func(suffix = "baz") |
| 41 |
|
| 42 |
} |