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

Mojolicious Embedded Perl (.ep) #880

Open
1 task done
ngoomie opened this issue Nov 8, 2023 · 0 comments
Open
1 task done

Mojolicious Embedded Perl (.ep) #880

ngoomie opened this issue Nov 8, 2023 · 0 comments
Labels
help wanted lexer missing Missing a lexer, please contribute

Comments

@ngoomie
Copy link

ngoomie commented Nov 8, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What is the missing lexer?

Mojolicious uses a format called Embedded Perl for templating, as I recall it's pretty similar to Ruby on Rails' Embedded Ruby in terms of how they both delineate which bits are code and which are HTML/etc. When doing templating with HTML, the extension .html.ep will be used.

Here's a bit from the Mojolicious documentation:

Mojolicious includes a minimalistic but very powerful template system out of the box called Embedded Perl or ep for short. It is based on Mojo::Template and allows the embedding of Perl code right into actual content using a small set of special tags and line start characters. For all templates strict, warnings, utf8 and Perl 5.16 features are automatically enabled.

<% Perl code %>
<%= Perl expression, replaced with XML escaped result %>
<%== Perl expression, replaced with result %>
<%# Comment, useful for debugging %>
<%% Replaced with "<%", useful for generating templates %>
% Perl code line, treated as "<% line =%>" (explained later)
%= Perl expression line, treated as "<%= line %>"
%== Perl expression line, treated as "<%== line %>"
%# Comment line, useful for debugging
%% Replaced with "%", useful for generating templates

https://docs.mojolicious.org/Mojolicious/Guides/Rendering#Embedded-Perl

Theoretically EP can be used when doing templating with things other than HTML, but those are not relevant where Mojolicious is concerned and I've also not even seen that myself anywhere — just figured it might be worth a mention just in case?

Links to existing syntax definitions

@ngoomie ngoomie added help wanted lexer missing Missing a lexer, please contribute labels Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted lexer missing Missing a lexer, please contribute
Projects
None yet
Development

No branches or pull requests

1 participant