-
Notifications
You must be signed in to change notification settings - Fork 11
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
Notes from first use of the CLI #11
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks @consideRatio
Can you expand on this a bit further, what directives are you referring to? |
@chrisjsewell I updated the issue! I'm still adding to it btw, just didn't dare keep it in browser-memory without pressing send in between as a save mechanism :p
|
related to #6 |
Ha yeh no problem |
As talked about at https://github.com/executablebooks/rst-to-myst#advanced-usage, the conversion of directives is dictated by https://github.com/executablebooks/rst-to-myst/blob/main/rst_to_myst/data/directives.yml. The idea though is that for directives that contain content that itself is Markdown, it is more helpful in standard renderers (like here on GitHub or viewing Jupyter Notebooks) to see: :::{note}
::: rather than
for code-blocks, the content is not Markdown, so then we want In fact, while I'm thinking it now, it would be ideal to have a special case for code/code-block directives, with no options, to convert them to standard language fences, i.e. .. code-block:: python
a = "text" to: ```python
a = "text"
``` rather than ```{code-block} python
a = "text"
``` |
See hukkin/mdformat#38 (comment), i.e. its "safer", but could be removed with some extra code to check for unsafe links: hukkin/mdformat@a3b4de3 |
Probably to do with the use of https://click.palletsprojects.com/en/7.x/api/#click.File, i.e. the file is still open |
as of v0.1.2, flags (i.e. options with no value) are converted to |
no at present it would be |
A lot of this is now fixed in v0.2.0, see https://rst-to-myst.readthedocs.io/ whenever you have time, if you want to check it out and note any outstanding issues |
This is a common shell gotcha. The shell truncates the output file when opening for writing, before the command has a chance to open it for reading. |
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.parse --help
or the help of theparse --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?hello world
followed by a blank line leads to a .md output ofhello world
with 3 blank linesnote
, andimportant
, but not forcode-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.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.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 examplecat test.md | sed replacesomething > test.md
. Perhaps its because we started printing content before we had finished reading it?glossary
directive to myst, but the automated generated MyST content containing a eval-rst block worked... 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.The text was updated successfully, but these errors were encountered: