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

handle partials by calling other (plmustache) functions #17

Open
wolfgangwalther opened this issue Jan 6, 2024 · 1 comment
Open

handle partials by calling other (plmustache) functions #17

wolfgangwalther opened this issue Jan 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@wolfgangwalther
Copy link
Member

Since it doesn't make sense to load partials from file, it would be great if other functions could be called via partials:

create or replace function hello() returns text as $$
Hello, {{>world}}
$$ language plmustache;

create or replace function world() returns text as $$
World
$$ language plmustache;

select hello();
Hello, World

It should even be possible to pass arguments to those functions via blocks and parents:

create or replace function hello(subject text) returns text as $$
Hello, {{subject}}
$$ language plmustache;

create or replace function hello_world() returns text as $$
{{<hello}}
  {{$subject}}World{{/subject}}
{{/hello}}
$$ language plmustache;

select hello();
Hello, World

Neither blocks, nor parents are supported by jobol/mustach, yet. I opened an issue about it.

I don't think it's possible to override the default "file loader" either, so that probably needs some changes in jobol/mustach, too.

@steve-chavez steve-chavez added the enhancement New feature or request label Jan 10, 2024
@wolfgangwalther
Copy link
Member Author

Upstream started development on partials and blocks and is asking for feedback: https://gitlab.com/jobol/mustach/-/issues/46#note_1856323871

@steve-chavez maybe you have time to try how that would work with plmustache?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants