Reference examples#

This is a page to show off some examples of this tool in use, and as a reference to test visual changes over time.

Code Cells#

To make sure that the images / svg still works!

e = mc^2

Copytext with line numbers!

print(1)
print(2)
print(3)
print(4)
1
2
3
4

Copy text with literalincludes!

1# This will be included as python in the reference page
2print(1)
3print(1)
4print(1)
5print(1)

Tables#

cell one
cell two
cell three
cell four

MyST Notebook Cells#

Sphinx Copybutton works with MyST Notebooks as well. See below for the code inputs and outputs:

Regular cells#

A regular cell:

print("hi")

Notebook cells#

Next we’ll demo notebook cells to see if these are rendered correctly.

print("hi")
hi

Rough edges#

This section displays UI behavior that we know is incorrect. Consider this a wish-list for contributions if somebody knows how to fix these issues!

Float-right content doesn’t move the copy button#

If there is content floated to the right, the code block will shrink, but not the copy button. For example. hover over the code block below, the copy button will float to the right, over the sidebar.

print("hi")