Based on the Sphinx documentation, to specify various index entries (single
entry, for example) in reStructuredText, like this:
.. index::
single: execution; context
The execution context
---------------------
...
When using Myst to do the same in Markdown (and according to its documentation), this should be its equivalent:
```{index}
single: execution; context
```
sphinx-build
reports an error: Directive 'index': No content permitted
.
Since adding content to other Sphinx directives (like toctree
) works, my assumption is there is some hard-coded logic in the myst_parser
Sphinx extension preventing adding the content for the index
directive. Is my assumption correct or is there actually a way to add entries to the index in Markdown?
UPDATE: as per Steve's answer, it is possible to put one of the entries directly in the first line, like this:
```{index} single: execution; context
```
But then the new question is how to add multiple entries into the same index item, which reStructuredText supports (an example from Sphinx docs):
.. index::
single: execution; context
module: __main__
module: sys
triple: module; search; path