mktestdocs
mktestdocs copied to clipboard
Add `ignore` feature
It might be nice to indicate that you want to ignore a specific codeblock. Maybe via something like:
```python ignore
```
I'd actually recommend the opposite - most code-blocks in docs probably aren't meant to be tested, so explicitly marking certain blocks as being tests would be preferable to the inverse of marking all those you don't want to test.
Unfortunately, without the ability to do this I won't be able to use mktestdocs in my projects.
That's not an unreasonable idea, although it does feel a bit like an anti-pattern.
Got a good name for a tag in that case?
Note: I have a newborn now so I likely won't have any time to work on this ticket in the super short term.
This feature would actually be really useful for me, especially in code blocks that make use of snippets. Would you be open to a PR?
I think adding anything after the language will make check_code_block deem the codeblock as invalid and filter it out in grab_code_blocks. I.e
``` python asdfIGNORE
There are things that are reasonable to put behind the tickets besides the language. Some markdown providers will allow for line highlighting via things like:
```python highlight=12-14
So I wouldn't assume it's immediately invalid if there's anything after.