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.

Add an `eval-myst` directive

See original GitHub issue

maintainer note: you can use https://rst-to-myst.readthedocs.io/ to convert one or more files from RST files -> MyST


I was just looking through the Sphinx issues, and saw that one of the top-rated issues included asking how to include a markdown file in an rST file.

In the myst-parser, to accomplish the opposite, we suggest users use eval-rst to include rST files in their markdown files (https://myst-parser.readthedocs.io/en/latest/using/howto.html#include-rst-files-into-a-markdown-file).

So they can do:

# My title

```{eval-rst}
.. include:: myfile.rst
```

So perhaps it would also be useful if MyST Parser defined an eval-myst directive that could be used within rST documents, and could do things like:

My title
========

.. eval-myst::

   ```{include} myfile.md
   ```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisjsewellcommented, Aug 22, 2021

With docutils>=0.17 you can now do:

.. include::
   :parser: myst_parser.docutils_

.. include::
   :parser: myst_parser.sphinx_

Although, I want to stress I don’t consider this “officially” supported in myst-parser, since it is not an intended use case and completely untested. So I won’t be accepting any bug reports regarding it failing for any reason

1reaction
chrisjsewellcommented, Jun 20, 2021

but I needed an RST table and hit #391 when using eval-rst

Obviously here I would rather spend the time to fix the issue, than introduce an eval-myst

rst-to-myst is excellent.

Good to hear 😄 I was just trying to “finalise” it, then promote it more in the docs here

gave me tables, rst-to-myst would render those in :::{eval-rst}

This should only be the case for RST tables that are not “compliant” with Markdown tables, e.g. ones with cells spanning multiple columns/rows, otherwise they are converted. If you could provide an example of a table that you think should have been converted but was not, that would be helpful thanks.

It’d also render codeblocks in :::{code-block} bash … as ```bash

yep that makes sense and can be added 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating an Advance Directive: A Step-By-Step Guide
Good news: such a document exists. It's called an advance directive, and completing it is one of the best ways to ensure your...
Read more >
Core Syntax - MyST-Parser - Read the Docs
MyST is a strict superset of the CommonMark syntax specification. It adds features focussed on scientific and technical documentation authoring, as detailed ...
Read more >
PREPARE Advance Directive
An advance directive is a legal form that lets you have a say about how you want to be cared for if you...
Read more >
Creating a Custom Directive • Angular - codecraft.tv
We create a directive by decorating a class with the @Directive decorator. The convention is to associate a directive to an element via...
Read more >
How to set up an advance healthcare directive - Dr. Neil Wanger
It always seems too early, until it's too late. We celebrate National Healthcare Decisions Day with advice from Dr. Neil Wanger about how...
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