Closed angelikatyborska closed 11 months ago
/format
This PR converted admonitions from 4 tildes to 3 backticks. Was this intended?
According to the Exercism markdown spec, they're supposed to use tildes when possible.
Previously: https://github.com/exercism/problem-specifications/pull/2255
Yes, it was intended. Customizing prettier is not possible, so keeping tildes would require writing an extra script that undoes prettier's formatting. @ErikSchierboom said it's not necessary and everything will work with triple backticks too.
I think this topic is very scattered across the community, the usage of tildas and backticks really depends on the track. I think there would be the benefit of actually standardizing across tracks. I dont have any direct leaning on which way to go since both have their advantages and disadvantages, but I think some confusion and inconsistency across the tracks could be fixed if we said this is the way to do it instead of having 2 ways which just makes things confusing.
Yes, it was intended.
Ah, okay. Thanks. I looked through all the comments/commits in this PR, but I hadn't seen the discussion in #2321.
I assume this means that we should consider changing the markdown spec. I've opened https://github.com/exercism/docs/issues/457.
but I think some confusion and inconsistency across the tracks could be fixed if we said this is the way to do it instead of having 2 ways which just makes things confusing.
To fully clear in case there was ambiguity: I was only talking about the Exercism-specific admonitions, rather than syntax for code blocks. But the Exercism markdown spec previously said tildes, so tracks should have been using tildes. But I don't know if it ever made a difference.
Currently there are more with tildes. In a directory that contains every Exercism track repo:
$ rg --files-with-matches '~~~exercism/' | wc -l
88
$ rg --files-with-matches '```exercism/' | wc -l
39
yes I am aware this is only the exercism specific admonitions.
But the Exercism markdown spec previously said tildes, so tracks should have been using tildes. But I don't know if it ever made a difference.
Yes but various tracks have chosen one over the other, and at least in my view, it creates a weird situation.
it creates a weird situation.
I don't disagree.
But the markdown spec has said "All blocks are written using 4 tildes" for the last 2.5 years. The problem isn't that Exercism didn't pick a side :)
The wording of the below part is bad, though:
(Note: You may also use backticks or other levels of tildes in exceptional circumstances)
My understanding was that this meant "in exceptional circumstances, you may use backticks or other levels of tildes", rather than "use backticks if you want, or other levels of tildes in exceptional circumstances".
But if we cared enough, we could probably make configlet lint
complain about whatever syntax is deemed incorrect.
The problem isn't that Exercism didn't pick a side :)
I think there is a divide across the community, I would even like to drag it so far that it is a divide in the exercism team itself.
What has happened is that both methods have been seen as "acceptable" and thereby they have both spread and have both got grounds in their usage areas.
I don't think it may be that simple. And if 39 repos use the "unofficial" way and 88 use the official way those 88 likely mostly come from practice exercises. Does that hint at least to me that there is at least a decent amount of maintainers who use backticks instead of tildas.
And if 39 repos use the "unofficial" way and 88 use the official way those 88 likely mostly come from practice exercises.
Just as a clarification, rather than trying to make a point: the command was counting files, not repos.
Here's the output without piping to wc -l
:
But note that the above commands didn't include most hidden files/directories, so it was mostly docs for concepts.
If we include all hidden files, by adding -uu
, the counts are:
$ rg -uu --files-with-matches '~~~exercism/' | wc -l
562
$ rg -uu --files-with-matches '```exercism/' | wc -l
257
So yes, there's widespread usage of both.
A few late night thoughts:
There is still another option: we could do some post-processing after prettier is done to convert from 3 backticks to 4 tildes.
edit: in fact I think I even suggested this somewhere, but then forgot about it 🤦
If someone is interested in working on this, we don't need to change anything.
BTW we do something similar when formatting JSON using prettier, where we run this script as post-processing: https://github.com/exercism/problem-specifications/blob/main/bin/format-array.rb
I think there is a divide across the community, I would even like to drag it so far that it is a divide in the exercism team itself.
I'd rather we'd not engage in speculation about "divisions" in the Exercism team please.
There is still another option: we could do some post-processing after prettier is done to convert from 3 backticks to 4 tildes.
Erik and I are discussing this btw. @ee7 hold fire for now on changing the docs.
Resolves #2321
Sorry for the notifications spam by pushing single commits, but I needed to see CI results 😇
I see there's supposed to be a workflow reacting to
/format
comments, but it didn't work for me.I see no suspicious reformatting happening by prettier's hands. I think this PR should be safe to merge.