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

Introduce syntax for inserting string_builder values #13

Merged
merged 3 commits into from
Feb 4, 2022

Conversation

michaeljones
Copy link
Owner

As suggested by @michallepicki in #11.

I've gone with the {[ name ]} syntax as I feel that the {} are consistent with other parts of the template syntax whilst the [] gives an indication of the list type nature of the string_builder.

There is quite a bit of repetition between the blocks but abstracting it
with functions ends up with little functions that are kind of arbitrary
and annoying. Maybe a macro would do better. I'm not sure.
I fear I might be missing something but it seems to work with relatively
little effort. We just treat them like normal values but use
'append_builder' instead of 'append' in the final render.
@michaeljones michaeljones force-pushed the insert-string-builder branch from dcf533c to b127cf8 Compare February 1, 2022 20:55
@michallepicki
Copy link
Contributor

Very cool, thank you!

@michaeljones michaeljones merged commit ddc0eff into main Feb 4, 2022
@michaeljones michaeljones deleted the insert-string-builder branch February 4, 2022 19:41
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

Successfully merging this pull request may close these issues.

2 participants