-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeature requestNew feature wantedNew feature wanted
Description
Description of the desired feature
The examples in the docstring have Python prompt likes >>> and ..., which makes it difficult to copy. For example, https://www.pygmt.org/dev/api/generated/pygmt.datasets.load_earth_relief.html#pygmt.datasets.load_earth_relief.
Directly copy the codes gives me the following codes:
>>> # load the default grid (pixel-registered 01d grid)
>>> grid = load_earth_relief()
>>> # load the 30m grid with "gridline" registration
>>> grid = load_earth_relief("30m", registration="gridline")
>>> # load high-resolution grid for a specific region
>>> grid = load_earth_relief(
... "05m", region=[120, 160, 30, 60], registration="gridline"
... )which is not ready for use.
The sphinx-copybutton extension can add a copy button to code blocks so readers can copy the codes by clicking the button. It can also strip the prompts.
I think the extension would make the documentation easier to use. What do you think @GenericMappingTools/python.
Are you willing to help implement and maintain this feature? Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeature requestNew feature wantedNew feature wanted