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

Improve directive block parsing #79

Merged
merged 3 commits into from Feb 24, 2020
Merged

Improve directive block parsing #79

merged 3 commits into from Feb 24, 2020

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Feb 24, 2020

fixes #55

Firstly, the directive block text -> arguments, options, body parsing has been separated into to a standalone module.

Secondly, 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), and no <option block> is used, the <body> block can start at <arguments>. Example:

.. note:: This is body text

This PR allows MyST to implement that logic.

```{note} This is body text
```

Note the rST parser also allows for the options to start on the argument line.
But this PR does not implement that, because it doesn't integrate particularly well with the concept of YAML blocks.
Example:

.. content:: :depth: 2

@chrisjsewell chrisjsewell merged commit a171075 into develop Feb 24, 2020
@chrisjsewell chrisjsewell deleted the directive-parsing branch February 24, 2020 09:56
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

Successfully merging this pull request may close these issues.

Replicate directive parsing behaviour of RST parser(?)
1 participant