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

Update some of the documentation #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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 R/pkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' Mustache (and therefore \code{whisker}) takes a simple but different approach to templating compared to
#' most templating engines. Most templating libraries for example \code{Sweave} and \code{brew} allow the user
#' to mix programming code and text throughout the template. This is powerful, but ties a template directly
#' to a programming language. Furthermore that approach makes it difficult to seperate programming code
#' to a programming language. Furthermore that approach makes it difficult to separate programming code
#' from templating code.
#'
#' Whisker on the other hand, takes a Mustache template and uses the variables of the current environment (or the
Expand Down
4 changes: 2 additions & 2 deletions R/whisker.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#' @param data named \code{list} or \code{environment} with variables that will be used during rendering
#' @param partials named \code{list} with partial templates, will be used during template construction
#' @param debug Used for debugging purposes, likely to disappear
#' @param strict \code{logical} if \code{TRUE} the seperation symbol is a "." otherwise a "$"
#' @param strict \code{logical} if \code{TRUE} the separation symbol is a "." otherwise a "$"
#' @return \code{character} with rendered template
#' @rdname whisker.render
#' @example examples/whisker_render.R
#' @export
#' @note
#' By default whisker applies html escaping on the generated text.
#' To prevent this use \{\{\{variable\}\}\} (triple) in stead of
#' To prevent this use \{\{\{variable\}\}\} (triple) instead of
#' \{\{variable\}\}.
whisker.render <- function( template
, data = parent.frame()
Expand Down
18 changes: 9 additions & 9 deletions README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Whisker
=======

Whisker is a [{{Mustache}}](http://mustache.github.com) implementation in
Whisker is a [{{Mustache}}](https://mustache.github.io/) implementation in
[R](http://www.r-project.org/) confirming to the Mustache specification.
Mustache is a logicless templating language, meaning that no programming source
code can be used in your templates. This may seem very limited, but Mustache is
Expand All @@ -16,7 +16,7 @@ Mustache (and therefore whisker) takes a simple, but different, approach to
templating compared to most templating engines. Most templating libraries,
such as `Sweave`, `knitr` and `brew`, allow the user to mix programming code and text
throughout the template. This is powerful, but ties your template directly
to a programming language and makes it difficult to seperate programming code from
to a programming language and makes it difficult to separate programming code from
templating code.

Whisker, on the other hand, takes a Mustache template and uses the variables of the
Expand All @@ -30,8 +30,8 @@ How the mustache template are used with whisker can be found in the whisker docu

Mustache specification
----------------------
Whisker conforms to the [Mustache 1.1 specificaton](https://github.com/mustache/spec) except for delimiter switching and
lambdas. We expect that these will be implented shortly.
Whisker conforms to the [Mustache 1.1 specification](https://github.com/mustache/spec) except for delimiter switching and
lambdas. We expect that these will be implemented shortly.

Installation
============
Expand All @@ -42,19 +42,19 @@ To install whisker use the following statement in your R console
install.packages("whisker")
```

The latest whisker version is not yet available on CRAN, but can be installed from github:
The latest whisker version is not yet available on CRAN, but can be installed from GitHub:

```r
library(devtools)

# dev_mode()
install_github("whisker", "edwindj")
install_github("edwindj/whisker")
```

Usage
-----

`whisker.render` accepts a `character` template and a list or environment containing data to render:
`whisker.render()` accepts a `character` template and a list or environment containing data to render:

```{r tidy=FALSE}
library(whisker)
Expand Down Expand Up @@ -94,6 +94,6 @@ writeLines(whisker.render(template, data), "./output.html")
Note
----

By default `whisker` applies `html` escaping on the generated text.
To prevent this use "{{{variable}}}" (triple) in stead of "{{variable}}".
By default whisker applies html escaping on the generated text.
To prevent this use "{{{variable}}}" (triple) instead of "{{variable}}" (double).