-
Notifications
You must be signed in to change notification settings - Fork 10
Extend mktestdocs beyond python blocks #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm happy to hear that this library has been useful! While I am interested in this feature, my recommendation is to first ask if such a feature is appreciated on GitHub issues. It's fine now, but for another time and another project, it's best to check in with the maintainer first. I'll try to give a quick review now. |
|
I noticed the tests didn't run on this PR, but that's due to a bad config on my end. Made a PR to fix it #9. Could you pull main such that the tests run here as well? |
koaning
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, this was a nice PR! I really like the registry that you've added there 👍 it'll allow folks to even implement their own checkers/linters.
I left some minor comments for now. I just realised that the tests weren't running, and I'd like to give it another glance once those look green.
| This will print the python version to the terminal | ||
|
|
||
| ```bash | ||
| python --version | ||
| ``` | ||
|
|
||
| This will print the exact same version string | ||
|
|
||
| ```python | ||
| import sys | ||
|
|
||
| print(f"Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}") | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't help but notice you using an extra tab here, presumably to display the ticks. I figured I'd share a trick, because there is an alternative syntax for moments like this. No need to change anything here, but I typically share this trick because many folks seem unaware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually just copying the md examples from elsewhere in the README. But no, I did not know that other way of including backtics; it will certainly be useful in the future.
I do find it interesting that I am finding out about this markdown formatting while working on mktestdocs. I believe the current mktestdocs would not execute these valid quadruple or pentuple, etc, code blocks. Perhaps that would be a valuable addition in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa. This is indeed getting meta 😅 I'm the maintainer of mktestdocs and I did not even realise that the extra-ticks-markdown-formatting is related to the project.
I think I prefer to see it as an advanced use case that might be best to skip for now. I'd be interested in understanding the use-case a bit better before actually thinking about the feature. It should be easy for folks to build their own implementation in the meantime.
koaning
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking great! I just added one comment on invalid JSON. It might be good to add a test case for it. The readme file right now shows the declaration of a test using a custom JSON checker, but not an actual run.
|
There was supposed to already be a test case for the json, which is that when test_mktestdocs runs the README, the example json parser is actually executed. It was an oversight that the example was not actually run. |
koaning
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
It's my turn to cook tonight, so I'll merge now and I'll whip up the next release later tonight. But I'm super excited to merge this one in. It'll make the project so much more flexible. Thanks for the PR! 😄 |
First off I think this library is great and I use it to test all my markdown readmes. However, I also write a lot of bash examples in these readmes and would like a way to also test those. I hope you will consider this increased scope to the tool so it can grow to cover all code examples in markdown.