Skip to content

[DOCUMENTATION] Add copy button/icon to code snippets in docs #3486

@clot27

Description

@clot27

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

It is inconvenient to have to manually scroll through and select the entire code in the documentation, as there is no copy button or icon available for the code snippets and examples.

Describe the solution you'd like

A copy button can be added to the code snippets to make it easier to access the code without needing to scroll through the text. This can be done using the sphinx-copybutton extension, which can be installed by running pip install sphinx-copybutton. Don't forget to add this to the requirements-docs.txt file. To enable the extension, edit the This list and add sphinx_copybutton to it.

Describe alternatives you've considered

Scrolling through the entire code, particularly through the examples, to copy them is very inconvenient.

Additional context

Please have a look at the Contrib guide for details on how to submit a PR and also how to build the documentation locally.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions