Closed bunchesofdonald closed 1 month ago
@freider or @mwaskom could I get a review of this? I'd really love to use this module, but this is a big blocker for that.
An alternative to having the mdx
context propagate in would be to have another pytest marker/arg "--markdown-docs-syntax=mdx-comments" (I just suggested something similar for the superfences syntax that #26 is adding)
An alternative to having the
mdx
context propagate in would be to have another pytest marker/arg "--markdown-docs-syntax=mdx-comments" (I just suggested something similar for the superfences syntax that #26 is adding)
Do you have a preference? I think having it pick up this style from the fact it's parsing an .mdx
file makes sense, but if you feel strongly that having an arg is the way to go that also works for me.
Since I think the context would be just a bit friendlier I'll start on that version, but should be easy-ish to change.
An alternative to having the
mdx
context propagate in would be to have another pytest marker/arg "--markdown-docs-syntax=mdx-comments" (I just suggested something similar for the superfences syntax that #26 is adding)Do you have a preference? I think having it pick up this style from the fact it's parsing an
.mdx
file makes sense, but if you feel strongly that having an arg is the way to go that also works for me.Since I think the context would be just a bit friendlier I'll start on that version, but should be easy-ish to change.
The argument for an arg rather than context is that it's more Mintlify-specific than .mdx
-specific, but I can see the point for having it as an always-on-thing for .mdx files anyways, just in case there are other renderers than Mintlify that use code fence info blocks for rendered content. Also could be quite useful to have file extension context available in the block extractor anyways, so go for it :)
@freider I've addressed your comments, please have a look at the updated code when you have a moment. Let me know if there are any further adjustments or improvements you'd like me to make.
Thanks again for your guidance!
@bunchesofdonald release v0.6.0 includes this patch and is up on pypi now FYI
Amazing, thank you so much @freider!
Summary
This PR adds support for specifying test metadata in
.mdx
files using MDX-style comments ({/* pmd-metadata: */}
) placed above code blocks. This should support all existing options and allow for easily adding more without having to alter the MDX parsing logic.Example:
Issue: https://github.com/modal-labs/pytest-markdown-docs/issues/28