ninjecto.plugins.filters.comment
¶Filter to comment out a section of text.
filter_comment()
:
Filter to comment out a section of text.ninjecto.plugins.filters.comment.
filter_comment
(environment, text, style='python', **kwargs)¶Filter to comment out a section of text.
bash
, c
, cblock
, cdoc
, cpp
,
cppblock
, csharp
, csharpblock
, doxygen
, erlang
,
html
, java
, javablock
, javadoc
, javascript
,
javascriptblock
, js
, jsblock
, jsdoc
, openscad
,
openscadblock
, perl
, phpdoc
, powershell
, python
,
ruby
, sql
, swift
, swiftblock
, toml
, xml
and
yaml
. You may also use None
or empty string ''
to not apply
the comment filter at all, which can be useful when using it
conditionally.Style overrides. Possible keys are:
newline
(str): Newline character to use. It defaults to Jinja’s
Environment.newline_sequence
.beginning
(str): String to place at the beginning of the comment.
Usually for block style comments.prefix
(str): Decoration to use to prefix the text.prefix_count
(int): Number of prefixes to prepend to the text.decoration
(str): String to use at the beginning of each line.postfix
(str): Decoration to use to postfix the text.postfix_count
(int): Number of postfixes to append to the text.end
(str): String to place at the end of the comment.
Usually for block style comments.The text commented out.