Skip to content
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

Being able to switch from >>> (doctest) to "normal" code representation. #2

Open
thorwhalen opened this issue Sep 3, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@thorwhalen
Copy link
Member

I've seen some html documentation have a "toggle >>>" button that allows the reader to switch from

>>> t = 3 + 2
>>> t
5

view to a

t = 3 + 2
t

view that's easier to copy/paste/try.

How do we integrate this option in epythet's doc gen?

@thorwhalen thorwhalen added the enhancement New feature or request label Sep 3, 2021
@sylvainbonnot
Copy link
Collaborator

sylvainbonnot commented Sep 7, 2021

This issue for sphinx is discussed at toggle python prompts in sphinx
One way to do it with sphinx is by using sphinx-copybutton: copy-button
(the copy button can be configured so that copying automatically removes the prompts).
Another way is by using sphinx-toggleprompt

@sylvainbonnot
Copy link
Collaborator

The sphinx toggle button seems to work only for rst code blocks (not for markdown codeblocks), i.e things prefixed by ".. code-block:: python"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants