Class names for spans similar to divs
dz4k opened this issue ยท 7 comments
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.
Many Markdown implementations support this syntax (...)
References?
- Here's a markdown-it plugin: https://github.com/hilookas/markdown-it-directive
- remark impl: https://github.com/remarkjs/remark-directive
- micromark (i never understood if this was separate from remark or not) https://github.com/micromark/micromark-extension-directive
- Discussion on CommonMark forum: https://talk.commonmark.org/t/generic-directives-plugins-syntax/444
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.
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.
@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? ๐
Fleshed out the idea in significantly more detail in
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.
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 :)