For one of my projects, I tried something similar where I had code blocks in README.md like:
Usage
-----
`pip install bar` and import `foo`:
```python
import foo from bar
```
Run `foo.alice` with default arguments:
```python
foo.alice()
```
Run `foo.bob` while specifying `baz`:
```python
foo.bob(baz=0)
```
For one of my projects, I tried something similar where I had code blocks in README.md like:
And a Makefile like: So you could run all those README.md code blocks with: