File: StyleFuns.Rd

package info (click to toggle)
r-cran-diffobj 0.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,432 kB
  • sloc: ansic: 455; javascript: 96; sh: 32; makefile: 8
file content (86 lines) | stat: -rwxr-xr-x 2,569 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/styles.R
\docType{class}
\name{StyleFuns-class}
\alias{StyleFuns-class}
\alias{StyleFuns}
\title{Functions Used for Styling Diff Components}
\arguments{
\item{container}{function used primarily by HTML styles to generate an
outermost \code{DIV} that allows for CSS targeting of its contents
(see \code{\link{cont_f}} for a function generator appropriate for use
here)}

\item{line}{function}

\item{line.insert}{function}

\item{line.delete}{function}

\item{line.match}{function}

\item{line.guide}{function formats guide lines (see \code{\link{guides}})}

\item{text}{function}

\item{text.insert}{function}

\item{text.delete}{function}

\item{text.match}{function}

\item{text.guide}{function formats guide lines (see \code{\link{guides}})}

\item{gutter}{function}

\item{gutter.insert}{function}

\item{gutter.delete}{function}

\item{gutter.match}{function}

\item{gutter.guide}{function}

\item{gutter.pad}{function}

\item{header}{function to format each hunk header with}

\item{banner}{function to format entire banner}

\item{banner.insert}{function to format insertion banner}

\item{banner.delete}{function to format deletion banner}

\item{meta}{function format meta information lines}

\item{context.sep}{function to format the separator used to visually
distinguish the A and B hunks in \dQuote{context} \code{mode}}
}
\value{
a StyleFuns S4 object
}
\description{
Except for \code{container} every function specified here should be
vectorized and apply formatting to each element in a character vectors.  The
functions must accept at least one argument and require no more than one
argument.  The text to be formatted will be passed as a character vector
as the first argument to each function.
}
\details{
These functions are applied in post processing steps.  The \code{diff*}
methods do not do any of the formatting.  Instead, the formatting is done
only if the user requests to \code{show} the object.  Internally, \code{show}
first converts the object to a character vector using \code{as.character},
which applies every formatting function defined here except for
\code{container}.  Then \code{show} applies \code{container} before
forwarding the result to the screen or pager.
}
\note{
the slots are set to class \dQuote{ANY} to allow classed functions
  such as those defined in the \code{crayon} package.  Despite this seemingly
  permissive slot definition, only functions are allowed in the slots by
  the validation functions.
}
\seealso{
\code{\link{Style}}
}