modal-labs / pytest-markdown-docs

Run pytest on markdown code fence blocks
MIT License
46 stars 6 forks source link

Add support for specifying metadata options via MDX comments #28

Open bunchesofdonald opened 2 weeks ago

bunchesofdonald commented 2 weeks 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"
...