-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Description
The executable plugins documentation for directives shows how you can return MyST AST by printing to stdout in order to generate different types of MyST outputs.
Users should be able to do the same thing via {code-cell} directives and Jupyter Notebook cells. This would allow users to more flexibly generate MyST AST without requiring any kernel-specific libraries (since you'd just be using stdout).
Implementation ideas
Doing it with tags
One approach could be to use cell tags to tell MyST when to capture a cell's output and treat it as MyST AST.
Here's an example of what this could look like:
```{code-cell} python
:tags: output-myst-ast
ast = {
"type": "list",
"ordered": false,
"spread": false,
"children": [
{
"type": "listItem",
"spread": True,
"children": [
{
"type": "strong",
"children": [
{
"type": "text",
"value": "Bolded"
}
]
},
{
"type": "text",
"value": " list item"
}
]
}
]
}
print(ast)
```
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels