Hi all,
As the subject suggests, I am toying around with the idea of removing ‘>’
from GSP. For those unaware, you can use it like so:
outer {
>inner{}
}
It then instructs the transpiler to insert a newline after the prefixed
tag. Normally the transpiler would produce the following HTML as a
result of it’s auto-minification:
<outer><inner></outer>
But with the prefix ‘>’ tag we get this:
<outer><inner>
</outer>
The original rationale behind this was that <pre> tags *are* whitespace
sensitive, unlike most things in HTML (since whitespace gets squashed
down), and so this offered an easier way to display code in a <pre> tag
without having all the lines compressed into one.
I never really liked it though, it looks ugly (imo), the behavior is a
bit… weird, and existing features render it (mostly) useless. What I
mean by this is that if I wanted to display the following code block…:
int
main(int argc, char *argv[])
{
return EXIT_SUCCESS;
}
…one option would be to do this:
pre {
>code{-int}
>code{-main(int argc, char *argv[])}
>code{-{}
>code{- return EXIT_SUCCESS;}
code{-\}}
}
But at the same time, this is also possible:
pre {=
@code{-int}
@code{-main(int argc, char *argv[])}
@code{-{}
@code{- return EXIT_SUCCESS;}
@code{-\}}
}
(The reason for putting a <code> tag on each line is because it’s helpful
for adding line numbers and stuff in CSS).
The end result is about equally as readable. It is not very pretty, but
I imagine few people will be literally writing code like this and instead
be using ‘include()’ from m4 or some other kind of macro system for
including codeblocks into their site.
For these reasons I very well may remove ‘>’ from the language in the
near future in a v3 release of the GSP transpiler (and a release of the
tree-sitter parser). I do know that a few people do use this tool
though, so if anyone has any opinions they’d like to voice, better ideas,
or objections, do feel free to respond. If not, expect to see this
feature removed soon™.
— Thomas