Skip to content

Notes from first use of the CLI #11

@consideRatio

Description

@consideRatio

These are notes from converting the documentation of the https://github.com/jupyterhub/zero-to-jupyterhub-k8s project. I just wrote that came to mind along as I used it for the first time with no prior knowledge other than its a cli to help me transform rst to myst.

  • roles list command output line separated roles instead of a big string for better human readability.
  • roles show help string sais the same as list.
  • directives list/show same as above
  • --help could perhaps say something more relevant than CLI for rst-to-myst, such as the focus of its purpose.
    Usage: rst2myst [OPTIONS] COMMAND [ARGS]...
    
    CLI for rst-to-myst
    
  • parse --help or the help of the parse --conversion flag could perhaps provide some reference or be a bit more verbal about it maybe.
  • parse --extensions help text doesn't describe how to specify the extensions, comma separated list to load?
  • `parse --sphinx/--no-sphinx doesn't make it clear what is the default
  • Trailing blank lines.
    • The conversion of a .rst file with only hello world followed by a blank line leads to a .md output of hello world with 3 blank lines
    • The conversion of the following
      .. image:: ../_static/images/architecture.png
         :align: center
      
      Led to a blank new line in the image directive
      ```{image} ../_static/images/architecture.png
      :align: center
      
      ```
      
  • I noted that my generated myst directives was using colon-syntax for directives like note, and important, but not for code-block. I ended up with a mix of colon-syntax and backtick syntax for my myst directives. I had not enabled colon-syntax manually in any way or by configuration.
  • It would be nice to have a --validate flag or similar for a parsing, giving hints about the transform rather than just outputting the output without warnings etc.
  • I found myself using rst2myst parse -f myfile.rst > myfile.md a lot, it could be nice to have some flag to modify the file in place or similar perhaps. -i, --in-place for example.
  • I learned that it wasn't possible to do rst2myst parse -f test.md > test.md for some reason I don't get. I would guess this would be reasonable to have working in general though, for example cat test.md | sed replacesomething > test.md. Perhaps its because we started printing content before we had finished reading it?
  • Having used some double ticks in rst translated to doubleticks in md where I expected to have only one
  • I'm surprised to see this conversion of links...
    # rst
    `Google <https://cloud.google.com/>`_)
    
    # myst - why is there a <> remaining? It seems fine though.
    [Google](<https://cloud.google.com/>)
    
  • I failed to transform the glossary directive to myst, but the automated generated MyST content containing a eval-rst block worked.
  • Converting a .. toctree:: directive with a :titlesonly: argument worked in a way, but the generated MyST content was invalid. It became :titlesonly: None which made a difference to the toctree where nothing was shown instead of only the titles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions