question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replicate directive parsing behaviour of RST parser(?)

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjsewellcommented, Feb 19, 2020

Don’t worry I’ve already taken care of it in https://github.com/ExecutableBookProject/myst_parser/tree/restructure-testing, PR to come soon

0reactions
chrisjsewellcommented, Feb 20, 2020

To clarify this issue: the docutils parser here does not rigidly specify the structure of the directive block:

.. <name>:: <arguments>
    <option block>

   <body>

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:

.. content:: :depth: 2
.. note:: This is body text
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found