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

Support for alternative handlebars delimiters #210

Open
mark-lester opened this issue Jul 16, 2020 · 0 comments
Open

Support for alternative handlebars delimiters #210

mark-lester opened this issue Jul 16, 2020 · 0 comments

Comments

@mark-lester
Copy link

I am implementing a scheme of 3 phase template execution, these being

  1. Once. First time only for a given locale (typically to resolve translations)
  2. Every. At deliver time, classic CGI page production
  3. Client. Client side

In order to have all three potentially in the same file, I am using {% for first/once election, {@ for delivery time, and {{ for usage in the client. For server time delivery I need support for asynchronous helpers, which you have.
So you can go

{%#__ "something to translate" %}

to call the __ translation helper in the "once" phase. I will implement something like {""something to translate""}
I also want to be able to go

{@#__ a_variable_to translate @}

and actually pass data through the translator (e.g. football team names), so I need asynchronous for that as I want to write dynamically into the dictionary.

The first phase saves the output from executing the {% stuff in <filename> for <> in .foxbat/<>/<>
I just need tp overload render to do that then call render with the permuted filename.

There is a handlebars-delimiter package to do this, I will implement and report back. I guess the neatest way would be to just overload the constructor to allow handlebars to be passed to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant