You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue to share my experience of compileHTMLDietFileString() usage for diet templates embedded to code. There are two problems: file name required and incorrect line number when error is found. To fix it I created inlineDiet.d:
I add "t" to the end of current file so if template included from some component.d it will be visible to diet-ng library as component.dt file. To fix line number template is prepended by required amount of new line symbols (requirement for correct work: opening quote of template string must be on the same line as diet() template call). So now I can create simple 1-file components like this:
I think it will be useful to add something like inlineDiet.d to library (or modify compileHTMLDietFileString to fix these issues) because every who will use compileHTMLDietFileString() will face same problems.
The text was updated successfully, but these errors were encountered:
This issue to share my experience of compileHTMLDietFileString() usage for diet templates embedded to code. There are two problems: file name required and incorrect line number when error is found. To fix it I created inlineDiet.d:
I add "t" to the end of current file so if template included from some
component.d
it will be visible to diet-ng library ascomponent.dt
file. To fix line number template is prepended by required amount of new line symbols (requirement for correct work: opening quote of template string must be on the same line as diet() template call). So now I can create simple 1-file components like this:I think it will be useful to add something like inlineDiet.d to library (or modify compileHTMLDietFileString to fix these issues) because every who will use compileHTMLDietFileString() will face same problems.
The text was updated successfully, but these errors were encountered: