Open ctbrown opened 8 years ago
You need one more level of nesting.
data <- list(repo = list(list(name = "resque"), list(name = "hub"), list (name = "rip")))
The fromJSON
call returns the correct format as long as simplifyVector is FALSE i.e.
data <- fromJSON(hash, simplifyVector = FALSE)
While whisker supports sections, it does not appear to support sections with non-empty lists as described in https://mustache.github.io/mustache.5.html:
Template:
Hash:
Output:
Using JSON
This closely follows the mustache documentation by using
jsonlite
to convert the hash to an R object. The R object is a list with a data frame of 3 rows.This does not conform to the specification is not correct as in collapses the
name
column rather than returning three results. According to the specification, I would expect this result:Using list-of-lists
Using a list of lists does not work either: