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.

Specify how shorthand directive options are parsed

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akhmerovcommented, Jan 3, 2021

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.

1reaction
choldgrafcommented, Jan 3, 2021

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

Read more comments on GitHub >

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

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