class Crinja::Config
- Crinja::Config
- Reference
- Object
Overview
This class holds configuration values for a Crinja environment.
Defined in:
config.crConstructors
-
.new(autoescape : Crinja::Config::Autoescape = Autoescape.new, keep_trailing_newline : Bool = false, trim_blocks : Bool = false, lstrip_blocks : Bool = false)
Initializes a configuration object.
Instance Method Summary
-
#autoescape : Autoescape
This setting configures autoescape behaviour.
- #autoescape=(flag : Bool)
-
#autoescape=(autoescape : Autoescape)
This setting configures autoescape behaviour.
- #autoescape?(*args, **options)
- #autoescape?(*args, **options, &)
-
#disabled_filters : Array(String)
A list of disabled_filters that will raise a
SecurityError
when invoked. -
#disabled_filters=(disabled_filters : Array(String))
A list of disabled_filters that will raise a
SecurityError
when invoked. -
#disabled_functions : Array(String)
A list of disabled_functions that will raise a
SecurityError
when invoked. -
#disabled_functions=(disabled_functions : Array(String))
A list of disabled_functions that will raise a
SecurityError
when invoked. -
#disabled_operators : Array(String)
A list of disabled_operators that will raise a
SecurityError
when invoked. -
#disabled_operators=(disabled_operators : Array(String))
A list of disabled_operators that will raise a
SecurityError
when invoked. -
#disabled_tags : Array(String)
A list of disabled_tags that will raise a
SecurityError
when invoked. -
#disabled_tags=(disabled_tags : Array(String))
A list of disabled_tags that will raise a
SecurityError
when invoked. -
#disabled_tests : Array(String)
A list of disabled_test that will raise a
SecurityError
when invoked. -
#disabled_tests=(disabled_tests : Array(String))
A list of disabled_test that will raise a
SecurityError
when invoked. -
#keep_trailing_newline : Bool
Preserve the trailing newline when rendering templates.
-
#keep_trailing_newline=(keep_trailing_newline : Bool)
Preserve the trailing newline when rendering templates.
-
#liquid_compatibility_mode : Bool
Enables liquid compatibility mode.
-
#liquid_compatibility_mode=(liquid_compatibility_mode : Bool)
Enables liquid compatibility mode.
-
#lstrip_blocks : Bool
If this is set to
true
, leading spaces and tabs are stripped from the start of a line to a block. -
#lstrip_blocks=(lstrip_blocks : Bool)
If this is set to
true
, leading spaces and tabs are stripped from the start of a line to a block. -
#register_defaults : Bool
If register_defaults is set to
true
, all feature libraries will be populated with the defaults (Crinja standards and registered custom features). -
#register_defaults=(register_defaults : Bool)
If register_defaults is set to
true
, all feature libraries will be populated with the defaults (Crinja standards and registered custom features). -
#trim_blocks : Bool
If this is set to `true``, the first newline after a block is removed.
-
#trim_blocks=(trim_blocks : Bool)
If this is set to `true``, the first newline after a block is removed.
Constructor Detail
Initializes a configuration object.
Instance Method Detail
This setting configures autoescape behaviour. See Autoescape
for details.
When set to a boolean value, false
deactivates any autoescape and true
activates autoescape for any template.
NOTE The default configuration of Crinja differs from that of Jinja 2.9, that autoescape is activated by default for XML and HTML files. This will most likely be changed by Jinja2 in the future, too.
This setting configures autoescape behaviour. See Autoescape
for details.
When set to a boolean value, false
deactivates any autoescape and true
activates autoescape for any template.
NOTE The default configuration of Crinja differs from that of Jinja 2.9, that autoescape is activated by default for XML and HTML files. This will most likely be changed by Jinja2 in the future, too.
A list of disabled_filters that will raise a SecurityError
when invoked.
A list of disabled_filters that will raise a SecurityError
when invoked.
A list of disabled_functions that will raise a SecurityError
when invoked.
A list of disabled_functions that will raise a SecurityError
when invoked.
A list of disabled_operators that will raise a SecurityError
when invoked.
A list of disabled_operators that will raise a SecurityError
when invoked.
A list of disabled_tags that will raise a SecurityError
when invoked.
A list of disabled_tags that will raise a SecurityError
when invoked.
A list of disabled_test that will raise a SecurityError
when invoked.
A list of disabled_test that will raise a SecurityError
when invoked.
Preserve the trailing newline when rendering templates.
If set to false
, a single newline, if present, willl be stripped from the end of the template.
Preserve the trailing newline when rendering templates.
If set to false
, a single newline, if present, willl be stripped from the end of the template.
Enables liquid compatibility mode. The parser will additionally parse tags and expressions with liquid/django syntax:
- filter:
val | filter: arg, arg
- tag
include
:{% include file.name %}
Enables liquid compatibility mode. The parser will additionally parse tags and expressions with liquid/django syntax:
- filter:
val | filter: arg, arg
- tag
include
:{% include file.name %}
If this is set to true
, leading spaces and tabs are stripped from the start of a line to a block.
If this is set to true
, leading spaces and tabs are stripped from the start of a line to a block.
If register_defaults is set to true
, all feature libraries will be populated with the
defaults (Crinja standards and registered custom features).
Otherwise the libraries will be empty. They can be manually populated with library.register_defaults
.
This setting needs to be set at the creation of an environment.
If register_defaults is set to true
, all feature libraries will be populated with the
defaults (Crinja standards and registered custom features).
Otherwise the libraries will be empty. They can be manually populated with library.register_defaults
.
This setting needs to be set at the creation of an environment.
If this is set to `true``, the first newline after a block is removed. This only applies to blocks, not expression tags.
If this is set to `true``, the first newline after a block is removed. This only applies to blocks, not expression tags.