Archived Beta Discussions > SlickEdit 2020 v25 Beta Discussion
Jinja?
jporkkahtc:
I don't see a language def for Jinja.
I have some *.Jinja macro files that are used it part of a code generator - so this macro code is stand alone, not embedded in anything
Clark:
No Jinja as a stand alone language yet. Didn't know there was such a thing.
Can you post a sample .Jinja macros file?
How is a stand alone Jinja file used?
Clark:
Your stand alone Jinja sample looks pretty much like embedded code. {% Jinja code ... %}. etc.
The only thing in your Jinja file which is out side of this are some double quoted strings:
--- Code: ---"Array"{%...%}
--- End code ---
Are quoted strings outside of {%...%} part of the Jinja language or just some arbitrary text? There's also a some commas outside of {%...%}. I'm guessing if it's outside of {%...%}, then it's not colored as Jinja.
jporkkahtc:
"Array" appears verbatim (including quotes) in the output -- Jinja doesn't interpret the quotes.
outside of {% %}, double braces {{variable}} are substitutions.
From this: https://jinja.palletsprojects.com/en/2.11.x/templates/#synopsis
Anything outside of these
--- Code: ---{% ... %} for Statements
{{ ... }} for Expressions to print to the template output
{# ... #} for Comments not included in the template output
# ... ## for Line Statements
--- End code ---
is just plain text.
If I rename my file from "something.jina" to "something.cs" or "something.ps1"
should Slick recognize this is Jinja macros embedded in csharp or powershell script?
jporkkahtc:
yes, renaming the files works - along with toggle_jinja_color_coding!
Navigation
[0] Message Index
[#] Next page
Go to full version