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
A recent change to the GoHT parser requires that all templates start with no indentation for the first element. Inside of a GoHT template you must have the first line of the template start at column 1. For example:
@goht Example() {
%p Starting at column 1
}
This means very short one line templates will have all three lines along the left side, all at column 1. If there are any nested elements in the template, then the indent style and length will be determined from that nested line.
Possible Change:
If instead GoHT required, not suggesting "allowed", that you must indent template bodies. Then one line templates would visually appear more like a Go func, albeit with Haml instead of Go code:
@goht Example() {
%p Starting with an indent, two spaces in this case.
}
GoHT would require that some kind of indent is used and that nothing may reside inside the template at column 1. If it did require an indent, should it ignore everything about that indent, tab vs space, and length? Or should it use that indent as the indent style and length?
The first option would mean you could indent with a single tab, then for the template body could switch over to using two spaces. Each line of the template would need to start with a tab, then switch over to using spaces when nesting any elements.
The second option would require that the rest of the template body use the same character and length for the indents. Each line of the template would need to continue to use the same character and length for all nested elements.
GoHT requires no indents for the first entity inside of a template. Should this change?
Yes, and the indent should be ignored. Allow me to indent with a tab and then switch to using spaces.
0%
Yes, and the indent should be used to configure the indent style for the template.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Today:
A recent change to the GoHT parser requires that all templates start with no indentation for the first element. Inside of a GoHT template you must have the first line of the template start at column 1. For example:
@goht Example() { %p Starting at column 1 }
This means very short one line templates will have all three lines along the left side, all at column 1. If there are any nested elements in the template, then the indent style and length will be determined from that nested line.
Possible Change:
If instead GoHT required, not suggesting "allowed", that you must indent template bodies. Then one line templates would visually appear more like a Go func, albeit with Haml instead of Go code:
@goht Example() { %p Starting with an indent, two spaces in this case. }
GoHT would require that some kind of indent is used and that nothing may reside inside the template at column 1. If it did require an indent, should it ignore everything about that indent, tab vs space, and length? Or should it use that indent as the indent style and length?
The first option would mean you could indent with a single tab, then for the template body could switch over to using two spaces. Each line of the template would need to start with a tab, then switch over to using spaces when nesting any elements.
The second option would require that the rest of the template body use the same character and length for the indents. Each line of the template would need to continue to use the same character and length for all nested elements.
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions