When adding doctests to my markdown, I have to write something like
```python >>>import numpy >>>np.sum([1, 2]) 3 ```
This works fine with doctest. However, when I render the markdown page on Github, it’s difficult to copy/paste the example, as the interactive Python parts (such as >>>
) are still there.
For instance, on the Python documentation for doctest itself: https://docs.python.org/3/library/doctest.html#how-are-docstring-examples-recognized one can click the button ‘Hide the prompts and output’, which makes copying easy. Can the same be achieved in Github markdown rendering?