Replicate directive parsing behaviour of RST parser(?)
See original GitHub issueI was looking into using this sphinx extension to handle the MyST vs. rST comparison:
https://github.com/djungelorm/sphinx-tabs
It uses a top-level directive .. tabs::
that should take no arguments. However, I found that when I use this directive in MyST with:
```{tabs}
```
I am getting an error that arguments are passed to the tabs
directive. The error shows because the directive says it takes zero arguments.
I am wondering if we are passing an empty argument, or something like this?
Here’s a PR that shows off this behavior: https://github.com/ExecutableBookProject/myst_parser/pull/60
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
reStructuredText Directives - Docutils
Common Options. This document describes the directives implemented in the reference reStructuredText parser. Directives have the following syntax:
Read more >Source code for myst_parser.mdit_to_docutils.base
This mimics the behaviour of the `code-block` directive. In docutils, this directive directly parses the text with the pygments lexer, whereas in sphinx, ......
Read more >How to parse Sphinx custom directive content to docutil nodes
So i need to parse it as-is and return the resulting nodes to return them along with my own nodes from LicenceDirective::run() ....
Read more >RST - PHP library to parse reStructuredText documents - GitHub
Step 1: Extends the Directive class. Write your own class that extends the Gregwar\RST\Directive class, and define the method getName() that return the ......
Read more >Source code for docutils.parsers.rst - Sphinx documentation
Parser() Several optional arguments may be passed to modify the ... Run the parser, populating the document tree:: parser.parse(input, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t worry I’ve already taken care of it in https://github.com/ExecutableBookProject/myst_parser/tree/restructure-testing, PR to come soon
To clarify this issue: the docutils parser here does not rigidly specify the structure of the directive block:
Instead, if no required/optional arguments are specified (by the directive class); the
<option block>
can start at<arguments>
or, if no required/optional arguments are specified and no options are specified; the<body>
block can start at<arguments>
. Examples: