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

Inline & block attributes #11

Open
rowanc1 opened this issue Feb 23, 2023 · 1 comment
Open

Inline & block attributes #11

rowanc1 opened this issue Feb 23, 2023 · 1 comment

Comments

@rowanc1
Copy link
Collaborator

rowanc1 commented Feb 23, 2023

There has been a lot of discussion dating back to 2019/2020 on how to add options to roles, and easier/faster ways to add options to directives.

For example:

There is recent work in the python parser on bringing in djot/pandoc style inline & block attributes. Which is a really helpful and standardized concept.

I think that we should aim to discuss how we adopt this in the myst-spec and across all myst projects. There is some initial work at implementations here:

I think from a MEP perspective we could aim to add block & inline attributes, address the conflict with (targets)=. I think a future MEP could aim to resolve how directives and roles integrate with this feature. For example, after the inclusion of block syntax, we would support something like:

{.dropdown}
:::{admonition} Title
Body
:::

However, there are many different ways we could combine these as we modify MyST syntax to resolve some of the redundancy that this allows.

Suggested MEPs:

  1. add block syntax (e.g. above any element, how they combine, etc.)
  2. add inline role attributes syntax (e.g. only on images, spans, code etc, not any words), builds on (1)
  3. discuss how to rationalize the new syntax with directives, engaging the djot community (ideally) along the way

@chrisjsewell can you add any other context/pointers please?!

@chrisjsewell
Copy link
Contributor

chrisjsewell commented Feb 23, 2023

address the conflict with (targets)=

A very quick thing I noted recently, since attributes only recognize (\W_:-) (https://github.com/jgm/djot.js/blob/8544a3646add6640ef647c61d629c5d4978207a7/src/attributes.ts#L97)

(target/forwardslash)=
# This works

{#target/forwardslash}
# This does not

which is a bit of an issue, at least for back-compatibility, because I at least have used / in a lot of target names 😅

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

2 participants