-
Notifications
You must be signed in to change notification settings - Fork 273
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
Make templates more flexible #480
Comments
👋 Feel free to send a PR for me to take a look. |
Thanks for the answer :-) What existing code would it break? We can keep the existing parameters for backwards compatibility I think. |
Yup, if we just add new parameters it should be fine.
I am not aware of a way to do this dynamically to detect what the template expects in an easy way.
Sent from Proton Mail for iOS
…On Sun, Mar 5, 2023 at 09:47, Phillip Kessels ***@***.***> wrote:
Thanks for the answer :-) What existing code would it break? We can keep the existing parameters for backwards compatibility I think.
—
Reply to this email directly, [view it on GitHub](#480 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAG4J4B5LFIJXINE3TXVLMLW2ROL5ANCNFSM6AAAAAAVB7Q5WU).
You are receiving this because you commented.Message ID: ***@***.***>
|
We can just hand in more variables than consumed by the template I suppose? Even if we duplicate the information handed into the template then at least it doesn't break. I will write something up in a PR ASAP |
Olá! Thanks for the project! I am using it with great success.
tl;dr: Hand in the whole
file
/line
and/or other main entities when rendering templates to make them more flexible when overwritten.Context
I am currently using the project to render a diff viewer which can also render comments per line. To do this I query through the generated HTML to find the right file and line. This would be much easier if I could override the template. E.g. for a generic line:
However only the variables which are currently used in the built-in templates are handed in.
My proposal is to hand in the "main entity"/file a template is dealing with to enable users to write more powerful custom templates. I have this working on a branch and would gladly raise a pull request. I only need it in generic lines for now, so I'd be curious if we should add this to other templates as well.
The text was updated successfully, but these errors were encountered: