File: output_template.Rd

package info (click to toggle)
r-cran-sass 0.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,012 kB
  • sloc: cpp: 29,639; ansic: 962; sh: 668; makefile: 321; perl: 56
file content (35 lines) | stat: -rw-r--r-- 1,352 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sass.R
\name{output_template}
\alias{output_template}
\title{An intelligent (temporary) output file}
\usage{
output_template(basename = "sass", dirname = basename, fileext = NULL)
}
\arguments{
\item{basename}{a non-empty character vector giving the outfile name (without
the extension).}

\item{dirname}{a non-empty character vector giving the initial part of the
directory name.}

\item{fileext}{the output file extension. The default is \code{".min.css"} for
compressed and compact output styles; otherwise, its \code{".css"}.}
}
\value{
A function with two arguments: \code{options} and \code{suffix}. When called inside
\code{\link[=sass]{sass()}} with caching enabled, the caching key is supplied to \code{suffix}.
}
\description{
Intended for use with \code{\link[=sass]{sass()}}'s \code{output} argument for temporary file
generation that is \code{cache} and \code{options} aware. In particular, this ensures
that new redundant file(s) aren't generated on a \code{\link[=sass]{sass()}} cache hit, and that
the file's extension is suitable for the \code{\link[=sass_options]{sass_options()}}'s \code{output_style}.
}
\examples{
sass("body {color: red}", output = output_template())

func <- output_template(basename = "foo", dirname = "bar-")
func(suffix = "baz")

}