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

Anonymous directives (fenced divs and bracketed spans) #28

Open
4 tasks done
gregdan3 opened this issue Oct 16, 2024 · 1 comment
Open
4 tasks done

Anonymous directives (fenced divs and bracketed spans) #28

gregdan3 opened this issue Oct 16, 2024 · 1 comment
Labels
🤞 phase/open Post is being triaged manually

Comments

@gregdan3
Copy link

gregdan3 commented Oct 16, 2024

Initial checklist

Problem

In the original proposal for generic directives, there is a specification for container directives and inline directives which have no name. An example of their syntax:

:::{.container-class #container-id key="val"}
The content of this container block.
:::

[selling lobbies 200ea @@@@@@@]{.glow2 .wave}

See the above on try pandoc

Larger set of examples

In addition to the names being possible to omit, the bracketed span also lacks the single colon of the inline directive.

Support for these directives would provide near1 complete support for pandoc's fenced divs and bracketed spans, which are enabled in its default markdown parser.

For reference, the equivalent syntax in the current implementation would be the following:

:::div{.container-class #container-id key="val"}
The content of this container block.
:::


:span[selling lobbies 200ea @@@@@@@]{.glow2 .wave}

Solution

micromark-extension-directive should support inline and container directives that lack a name to better support pandoc's fenced divs and bracketed spans. Preferably, inline directives should also be able to lack the initial colon when they lack the name.

Alternatives

As this is a request to support a specific syntax feature, there probably is not any alternative possible.

Footnotes

  1. pandoc's fenced divs are allowed to have whitespace between the opening fence and the name (which in pandoc is either an attribute that becomes a class or curly braces that specify any attributes). I am not asking to support this.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Oct 16, 2024
@wooorm
Copy link
Member

wooorm commented Oct 17, 2024

In addition to the names being possible to omit, the bracketed span also lacks the single colon of the inline directive.

I am sorry. I do not understand this sentence. Can you please explain again?

near […] I am not asking to support this.

There are problems with supporting “near” but not “exactly”. You ask for a buggy implementation that is not specified and cannot be reasoned about. At some point someone will ask different things. Likely, breaking things. Which will not be what you want.

See also #25.

which are enabled in its default markdown parser.

Pandoc’s default markdown parser is explicitly old and from before CommonMark and it will not be changed to support CommonMark.
I do not recommend using that non-standard version of markdown.
It is not a goal of micromark to support old non-standard versions of markdown.

Preferably, inline directives should also be able to lack the initial colon when they lack the name.

How do you mean? Are you saying that `` (as in, nothing, no colon and no name) should be a directive?!

As this is a request to support a specific syntax feature, there probably is not any alternative possible.

You came up with a very good alternative yourself: “For reference, the equivalent syntax in the current implementation would be the following”, :::div, :span.

One more alternative solution is for you to write an extension that supports Pandoc’s fenced divs and bracketed spans.

to better support pandoc's fenced divs and bracketed spans

I am sorry. It is not a goal of this project to support pandoc’s extensions of markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤞 phase/open Post is being triaged manually
Development

No branches or pull requests

2 participants