MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

directives do not allow arguments without values (booleans)

Open ssbarnea opened this issue 2 years ago • 4 comments

Describe the bug

context

I observed that boolean arguments that do not require a value on directives do not work with myst-parser, even if they do work well with rst.

expectation

```{command-output} bash --version
   :cwd: ..
   :returncode: 2
   :nostderr:
```

workaround

Apparently adding a true as value appears to be working, but I am not 100% sure.

```{command-output} bash --version
   :cwd: ..
   :returncode: 2
   :nostderr: true
```

problem

This is problematic, especially for people doing rst2myst conversions.

Reproduce the bug

```{command-output} bash --version
   :cwd: ..
   :returncode: 2
   :nostderr:
```

List your environment

To my surprise this issue appears to happen only on Linux. On MacOS it did work as expected.

ssbarnea avatar May 17 '22 11:05 ssbarnea

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

welcome[bot] avatar May 17 '22 11:05 welcome[bot]

@ssbarnea I noticed you have indented the options (similar to rst)

Could you try:

```{command-output} bash --version
:cwd: ..
:returncode: 2
:nostderr:
```

or using the alternative syntax for listing groups of options

```{command-output} bash --version
---  
cwd: ..
returncode: 2
nostderr:
----
```

mmcky avatar May 17 '22 23:05 mmcky

In fact that was likely the result of conversion script. If that proves to work we should file a bug with it as I bet others will face similar confusions when migrating from rst.

ssbarnea avatar May 18 '22 06:05 ssbarnea

@ssbarnea I mainly want to rule that out as a source of possible issue.

mmcky avatar May 18 '22 07:05 mmcky

Closing this, since it does work, see e.g.

test.md

```{contents}
:local:
```

# Heading
$ myst-docutils-pseudoxml test.md
<document source="test.md">
    <topic classes="contents local" ids="contents" names="contents">
        <bullet_list>
            <list_item>
                <paragraph>
                    <reference ids="toc-entry-1" refid="heading">
                        Heading
    <section ids="heading" names="heading">
        <title refid="toc-entry-1">
            Heading

In fact that was likely the result of conversion script. If that proves to work we should file a bug with it as I bet others will face similar confusions when migrating from rst.

FYI, there is https://github.com/executablebooks/rst-to-myst for that

chrisjsewell avatar Jan 12 '23 01:01 chrisjsewell