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

[RFC] Kara: template once #15

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Draft

Conversation

petzku
Copy link
Contributor

@petzku petzku commented May 8, 2023

Currently more a RFC, but this proposes a sample implementation of template once.

The template line acts as its own input line, thus taking e.g. timing and styles from it, as well as (obviously) all the tags and text.

Currently, main caveat is that the template would double up all text, so notext is forced—but this breaks any mixins. Anything but mixin line will not even execute, and those will also put their tags after the template line's content.

It would thus seem preferable to instead strip the text parts from the template, but what if the user wants to add tags manually in between? keeptags could serve this purpose, possibly. In that case, it should have special behavior on template once lines, where it would disable all tag generation from the template itself, as those would otherwise be duplicated... but now, what about any code that should be run as well?

In short: this is a complex issue, with no clear answers to a lot of questions, but I hope this PR at least gets us going somewhere.

petzku added 2 commits May 8, 2023 08:35
Move body of function into run_template function,
leaving run_templates simply as a loop wrapper,
in order to make `template once` logic simpler
@petzku petzku changed the title Kara: template once [RFC] Kara: template once May 11, 2023
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.

1 participant