MCPcopy Create free account
hub / github.com/nodejs/node / Environment

Class Environment

deps/v8/third_party/jinja2/environment.py:142–1133  ·  view source on GitHub ↗

r"""The core component of Jinja is the `Environment`. It contains important shared variables like configuration, filters, tests, globals and others. Instances of this class may be modified if they are not shared and if no template was loaded so far. Modifications on environments af

Source from the content-addressed store, hash-verified

140
141
142class Environment:
143 r"""The core component of Jinja is the `Environment`. It contains
144 important shared variables like configuration, filters, tests,
145 globals and others. Instances of this class may be modified if
146 they are not shared and if no template was loaded so far.
147 Modifications on environments after the first template was loaded
148 will lead to surprising effects and undefined behavior.
149
150 Here are the possible initialization parameters:
151
152 `block_start_string`
153 The string marking the beginning of a block. Defaults to ``'{%'``.
154
155 `block_end_string`
156 The string marking the end of a block. Defaults to ``'%}'``.
157
158 `variable_start_string`
159 The string marking the beginning of a print statement.
160 Defaults to ``'{{'``.
161
162 `variable_end_string`
163 The string marking the end of a print statement. Defaults to
164 ``'}}'``.
165
166 `comment_start_string`
167 The string marking the beginning of a comment. Defaults to ``'{#'``.
168
169 `comment_end_string`
170 The string marking the end of a comment. Defaults to ``'#}'``.
171
172 `line_statement_prefix`
173 If given and a string, this will be used as prefix for line based
174 statements. See also :ref:`line-statements`.
175
176 `line_comment_prefix`
177 If given and a string, this will be used as prefix for line based
178 comments. See also :ref:`line-statements`.
179
180 .. versionadded:: 2.2
181
182 `trim_blocks`
183 If this is set to ``True`` the first newline after a block is
184 removed (block, not variable tag!). Defaults to `False`.
185
186 `lstrip_blocks`
187 If this is set to ``True`` leading spaces and tabs are stripped
188 from the start of a line to a block. Defaults to `False`.
189
190 `newline_sequence`
191 The sequence that starts a newline. Must be one of ``'\r'``,
192 ``'\n'`` or ``'\r\n'``. The default is ``'\n'`` which is a
193 useful default for Linux and OS X systems as well as web
194 applications.
195
196 `keep_trailing_newline`
197 Preserve the trailing newline when rendering templates.
198 The default is ``False``, which causes a single newline,
199 if present, to be stripped from the end of the template.

Callers 1

babel_extractFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected