Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scriggo: suggest '.scriggo.*' extensions for editor plugins #873

Closed
zapateo opened this issue Sep 17, 2021 · 3 comments
Closed

scriggo: suggest '.scriggo.*' extensions for editor plugins #873

zapateo opened this issue Sep 17, 2021 · 3 comments
Labels
templates Related to the template

Comments

@zapateo
Copy link
Member

zapateo commented Sep 17, 2021

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
@zapateo zapateo changed the title doc: add documentation about the '.scriggo' extension Add support for the '.scriggo' extension and document it Sep 17, 2021
@zapateo zapateo added the api Related to Scriggo's exported APIs label Sep 17, 2021
@gazerro
Copy link
Member

gazerro commented Sep 20, 2021

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.

@gazerro gazerro changed the title Add support for the '.scriggo' extension and document it proposal: add support for the '.scriggo' extension and document it Sep 20, 2021
@gazerro gazerro added templates Related to the template and removed Documentation labels Sep 20, 2021
@gazerro gazerro changed the title proposal: add support for the '.scriggo' extension and document it proposal: add support for the '.scriggo' extension Sep 20, 2021
@gazerro gazerro changed the title proposal: add support for the '.scriggo' extension proposal: scriggo: add support for the '.scriggo' extension Sep 20, 2021
@gazerro gazerro added this to Incoming in Proposals Sep 20, 2021
@zapateo
Copy link
Member Author

zapateo commented Sep 21, 2021

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 named index.html.scriggo there is only one possible match.

@gazerro gazerro changed the title proposal: scriggo: add support for the '.scriggo' extension proposal: scriggo: add support for '.scriggo.*' extensions Sep 22, 2021
@gazerro gazerro added Proposal-Accepted and removed api Related to Scriggo's exported APIs labels Sep 22, 2021
@gazerro
Copy link
Member

gazerro commented Sep 22, 2021

As discussed with @zapateo, we will use .scriggo.* as extensions. For example header.scriggo.html and index.scriggo.md.

@gazerro gazerro moved this from Incoming to Accepted in Proposals Sep 22, 2021
@gazerro gazerro changed the title proposal: scriggo: add support for '.scriggo.*' extensions proposal: scriggo: suggest '.scriggo.*' extensions for editor plugins Sep 22, 2021
@gazerro gazerro changed the title proposal: scriggo: suggest '.scriggo.*' extensions for editor plugins scriggo: suggest '.scriggo.*' extensions for editor plugins Sep 22, 2021
@gazerro gazerro removed this from Accepted in Proposals Sep 22, 2021
@gazerro gazerro closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
templates Related to the template
Projects
None yet
Development

No branches or pull requests

2 participants