Learn R Programming

jinjar (version 0.3.2)

print.jinjar_template: Print a template

Description

Once a template has been parsed, it can be printed with color highlighting of the templating blocks.

Usage

# S3 method for jinjar_template
print(x, ..., n = 10)

Arguments

x

A parsed template (use parse_template()).

...

These dots are for future extensions and must be empty.

n

Number of lines to show. If Inf, will print all lines. Default: 10.

Examples

Run this code
input <- '


    {{ title }}


    
    {% for item in navigation -%}
        {{ item.caption }}
    {% endfor -%}
    
{# a comment #}

'

x <- parse_template(input)

print(x)

print(x, n = Inf)

Run the code above in your browser using DataLab