mkdocstrings / python

A Python handler for mkdocstrings.
https://mkdocstrings.github.io/python
ISC License
190 stars 35 forks source link

feature: example code block copy without prompt #179

Closed shenxiangzhuang closed 3 months ago

shenxiangzhuang commented 3 months ago

Is your feature request related to a problem? Please describe.

https://mkdocstrings.github.io/python/usage/configuration/docstrings/?h=example#show_docstring_examples

The example code shows here is:

>>> print("hello")
hello

When I copy the code by the click button, I copy all the code in it(with >>>).

Describe the solution you'd like

After copy, we get print("hello") only, without the prompt >>> and the output, just as sklearn docs in here

Describe alternatives you've considered

Additional context

pawamoy commented 3 months ago

Hi @shenxiangzhuang, thanks for the request :slightly_smiling_face: We already track it here: https://github.com/mkdocstrings/mkdocstrings/issues/668. Closing!