-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
MyST directives CodeBlock
nodes normalized to Code
nodes
#7622
Comments
For context, the style of attribute-based MyST directives have been proposed there: executablebooks/MyST-Parser#63 (comment) |
I just solved the conversion from
This is much better:
The only issue is that all parameters after the curly braces are stripped out. |
This isn't really a bug, because we don't claim to support MyST. I wish they had used syntax constructions that would be understood by standard parsers, rather than inventing their own syntax, and so I advised them. But alas. For example, they could have easily made the syntax:
which would have built on an existing, established syntax, and would be handled without problems by pandoc (indeed, the include could even be implemented as a simple pandoc filter). The behavior of pandoc (with |
I just solved my MyST formatting issue by switching from Pandoc to I guess my expectations of Pandoc being able to recognize MyST edge-cases are unfounded, so I'll close this issue. |
Thanks @jgm for the answer. Everything makes sense now. And sorry for the noise. 🙇 Indeed, the all-encompassing curly-braces syntax seems like a strong proposition. Anyway, I should have checked with the MyST community first about the current state of the ecosystem instead of going with Pandoc (which I'll keep as my go-to tool for anything Markdown related! 😉). |
Maybe you could put in a plug for a more compatible syntax! |
I'm trying to use Pandoc to lint and normalized my documentation that is written in MyST. So far so good, but I stumbled upon some edge-cases with MyST directives specified as back-ticked code-blocks. Here are my use-cases:
This is the way pandoc normalize these blocks:
What's funny is that the
{toctree}
directive seems to be recognized as aCodeBlock
node and normalized as such (see the extra space introduced, as per #7616). All others are normalized back asCode
nodes.I'm not sure how to interpret these discrepancies.
{admonition}
be interpreted asCodeBlock
too because of the:class:
attribute?{sidebar}
not aCodeBlock
if it has a non-empty body?For reference I use the latest pandoc on macOS Big Sur:
The text was updated successfully, but these errors were encountered: