scriggo: suggest '.scriggo.*' extensions for editor plugins
zapateo opened this issue · 3 comments
Description
We should handle the .scriggo
file extension in the same way as Jinja handles the .jinja
file extension.
From the Jinja documentation:
As stated above, any file can be loaded as a template, regardless of file extension. Adding a .jinja extension, like user.html.jinja may make it easier for some IDEs or editor plugins, but is not required. Autoescaping, introduced later, can be applied based on file extension, so you’ll need to take the extra suffix into account in that case.
Another good heuristic for identifying templates is that they are in a templates folder, regardless of extension. This is a common layout for projects.
What to do
- Support the
.scriggo
extension in the template API's, that should recognize.html.scriggo
,.css.scriggo
etc.. - Document it
What is the advantage of using for example .html.scriggo
instead of .scriggo.html
? Using .scriggo.html
, if an editor does not support Scriggo it opens the file as HTML. .scriggo.html
does not require changes to the template API's.
What is the advantage of using for example
.html.scriggo
instead of.scriggo.html
? Using.scriggo.html
, if an editor does not support Scriggo it opens the file as HTML..scriggo.html
does not require changes to the template API's.
Using .html.scriggo
is consistent with .html.jinja
, which is a convention used by Jinja.
It has the following advantages:
- it's more natural for those who came from Jinja to name files in Scriggo
- the tools available for Jinja may be changed to work with Scriggo without the needing of too much patching
- some editors chose the syntax as soon as the file extensions matches a known extension; so, for instance, if a file is named
index.scriggo.html
, a text editor may notice the.html
extension and accordingly set the syntax mode to html, without doing further matching against the file name. In the opposite, if the file is namedindex.html.scriggo
there is only one possible match.