modal-labs / pytest-markdown-docs

Run pytest on markdown code fence blocks
MIT License
57 stars 7 forks source link

Add support for specifying metadata options via MDX comments #28

Closed bunchesofdonald closed 1 month ago

bunchesofdonald commented 2 months ago

I would like to use this project to add tests to our documentation, but we use Mintlify to render our docs. The issue is that it interprets options in the "lang" portion of the fence as a title of the code snippet. It would be great if we could add these options in an MDX comment (the only thing I've found that Mintlify won't render) above the code snippet, like:

{/* pmd-metadata: notest fixture:capsys */}
```python
print("hello")
captured = capsys.readouterr()
assert captured.out == "hello\n"
...