Specify how shorthand directive options are parsed
See original GitHub issueIs your feature request related to a problem? Please describe.
The parameterizing directives section states that:
- Directives may have YAML frontmatter, parsed by the YAML formatter
- Directives may have shorthand
:options:
instead
It is never specified how the shorthand options are parsed. Is
```test
:a: |
yaml-formatted multiline text
```
correct?
A link to the documentation page where you see an issue.
https://myst-parser.readthedocs.io/en/latest/using/syntax.html#parameterizing-directives
Describe the solution you’d like
I would prefer it if the documentation specified how the values of the shorthand directive options are parsed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Roles and Directives - MyST-Parser - Read the Docs
Short-hand options with : characters. If you only need one or two options for your directive and wish to save lines, you may...
Read more >reStructuredText Directives - Docutils
The "code" directive constructs a literal block. If the code language is specified, the content is parsed by the Pygments syntax highlighter and...
Read more >Command-line syntax overview for System.CommandLine
A directive can include an argument, separated from the directive name by a colon. The following directives are built in: [parse] [suggest]
Read more >AngularJS won't parse ng-disabled in select - Stack Overflow
... following HTML snippets fail with parsing errors when in a directive template: 1. <select ng-model="model" ng-options="s.abbreviation as ...
Read more >vue/no-parsing-error
This rule tries to parse directives/mustaches in <template> by the parser which parses <script> . Then reports syntax errors if exist.
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
Ah, I see. so each line must start with a
:
, and not only those with the option name. I was confused by the similarity between the shorthand syntax and the rst options formatting.Ah yeah it’s the same parsing. The shorthand is just the : leading each line to detect the yaml ok the other side, but isn’t part of the yaml itself. Eg without the short hand there are some examples of raw multi line yaml.
Want to make a PR adding this context to the place(s) where you think it’d naturally be?
Here’s the code where it is parsed https://github.com/executablebooks/MyST-Parser/blob/4b7f571addbc03624a34df8d0e496253d343a7e0/myst_parser/parse_directives.py#L114