djot
djot copied to clipboard
`{:lang}` as substitute for `{lang="lang"}`
@jgm,
after having to tag languages in many documents, I think this would be handy:
This is [French]{:fr}.
And this is [ancient Greek]{:grc}.
It is consistent with the syntax for {#id}
and {.class}
.
Would it be possible to have this handle in djot?
Many thanks for your help and your excellent work.
as :
is already being used for emoji, i might prefer @
as a sigil ([My English text]{@en}
)
@
has some precedent as a language indicator on the web (it is the symbol used by RDF Turtle for language‐tagged strings, e.g. "My English Text"@en
, so you see it often in Linked Data‐adjacent spaces)
@marrus-sh,
many thanks for your comment.
as
:
is already being used for emoji, i might prefer@
as a sigil ([My English text]{@en}
)
I don’t think this is exactly the same.
According to https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#emoji:
- Emojis are surrounded by normal text.
- Emojis have colons both right before and after them.
- Language tags would be inside braces (not in normal text).
- Language tags would have colons only before them.
@
has some precedent as a language indicator on the web (it is the symbol used by RDF Turtle for language‐tagged strings, e.g."My English Text"@en
, so you see it often in Linked Data‐adjacent spaces)
Colons are used for language pseudo-class in CSS selection:
p:lang(grc) {
background: yellow;
}
This is consistent with having the CSS selectors for #id
and .class
.
That being said, having proper syntax for languages (as in {lang="lang"}
) would be great. Either your proposal, mine or another one.
Many thanks for your reply again.
Having thought more about #44 I now think that {:text:}
and {:number:}
should be syntaxes for emoji/charnames and character references, and since per #10 @jgm thinks that {.dots.}
would be too close for comfort to {.class}
there is a potential clash. I can't say that I really see a problem here; the absence of a :}
or .}
in attributes should be enough to disambiguate.