Add a helper function to inspect MyST AST objects in JavaScript (e.g. in utils
)
#1652
Labels
enhancement
New feature or request
utils
)
#1652
It's useful to be able to print log statements about the contents of AST, JavaScript objects, etc during a MyST build.
However, for print AST objects, using
console.log
isn't that useful.If you do
It only generates the top layer of AST so you can't see what's in the children etc.
There are two other ways to print the full AST, but both are a pain to remember:
and
Suggestion: make this a utility function
We should provide developers a utility function inside of
utils
orctx
that shows the contents of AST in a user-friendly way.For example:
The text was updated successfully, but these errors were encountered: