Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{:lang} as substitute for {lang="lang"} #5

Open
ousia opened this issue Jul 12, 2022 · 3 comments
Open

{:lang} as substitute for {lang="lang"} #5

ousia opened this issue Jul 12, 2022 · 3 comments

Comments

@ousia
Copy link

ousia commented Jul 12, 2022

@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.

@ousia ousia changed the title {:lang} as substitute for lang="lang" {:lang} as substitute for {lang="lang"} Jul 12, 2022
@marrus-sh
Copy link

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)

@ousia
Copy link
Author

ousia commented Aug 15, 2022

@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:

  1. Emojis are surrounded by normal text.
  2. Emojis have colons both right before and after them.
  3. Language tags would be inside braces (not in normal text).
  4. 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.

@bpj
Copy link

bpj commented Aug 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants