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

Class names for spans similar to divs #239

Open
dz4k opened this issue Aug 19, 2023 · 7 comments
Open

Class names for spans similar to divs #239

dz4k opened this issue Aug 19, 2023 · 7 comments

Comments

@dz4k
Copy link

dz4k commented Aug 19, 2023

Many Markdown implementations support this syntax:

A :dfn[hypermedia control] is an element in a hypermedia that describes (or controls) some sort of interaction, often with a remote server, by encoding information about that interaction directly and completely within itself.

which would presumably be transformed by a filter into an HTML <dfn> element.

The current syntax for such a thing would be

a [hypermedia control]{.dfn}

which is more verbose.

I think this should be supported for links as well:

Let us consider these two defining hypermedia elements (that is the two defining :ref[hypermedia controls][hypermedia control]) of HTML, the anchor tag and the form tag, in a bit of detail.
@Omikhleia
Copy link

Many Markdown implementations support this syntax (...)

References?

@dz4k
Copy link
Author

dz4k commented Aug 19, 2023

@Omikhleia

@jgm
Copy link
Owner

jgm commented Aug 19, 2023

You'd save two characters of typing, at the cost of a new construct, less uniformity, and more complex parsing. Not sure it's worth it.

@matklad
Copy link
Contributor

matklad commented Aug 20, 2023

Yeah, I use []{.dfn} syntax for my blog, and it works quite OK.

You'd save two characters of typing

I would say that another aspect here is the position of dfn: if "tag name" comes first, its a bit more natural for this use-case. The distinction between "tag name" and "attribute" is very fuzzy of course, but I do feel certain friction in practice here. Leading tag would also be a bit more autocompletion / snippet friendly.

I actually came to this comment here to concur with "not needed", but now I am thinking, wouldn't it be cool if both of these:

inline :kbd[ctrl+c]

::: details
block
:::

produced a <kbd></kbd> / <details></details> in the HTML output without any custom readers/writers? See also #146.

@Omikhleia
Copy link

@matklad Regarding your new idea above, I am not sure what it would then mean for non-HTML renderers...
Also, the implication now is the :em[doe] would give <em>doe</em> -- isn't it just reinventing a syntax for HTML? 🐈

@matklad
Copy link
Contributor

matklad commented Aug 20, 2023

Fleshed out the idea in significantly more detail in

#240

Also, the implication now is the :em[doe] would give doe -- isn't it just reinventing a syntax for HTML?

Yup, that's the point. The XML model with tag-name,attributes,children is great for markup, and a lot of formats support that (DocBook XML, SILE XML, LaTeX environments). If the target format doesn't have a direct support for tag names, it could be rendered exactly as it is today, as a class.

@Omikhleia
Copy link

The XML model with tag-name,attributes,children is great for markup

But what this does it have to do with Djot markup then?
Honestly I am lost now :)

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

4 participants