When a notebook is added to Curvenote, each of the cells are considered blocks and have a unique oxa link. These links correspond to a specific version number of the block and allow you to reuse your content throughout Curvenote. All copies of a block are linked so you can easily view, edit, and access all previous versions of the block from any copy. Reusing Jupyter cells is a convenient and simple way to integrate your static or interactive code outputs directly into your writing, use prewritten code as a template for new projects, and more!
Import a Block/Cell¶
Blocks can be copied and pasted/imported on both Curvenote and Jupyter using the Curvenote Jupyter extension. Only saved versions of blocks can be imported; unsaved drafts and changes are not included when you copy a link.
Curvenote Jupyter Extension¶
To copy a link to the current saved version of a cell:
- Open the Curvenote Options menu for the cell.
- Select Copy Link.
- A black box will appear in the bottom left of your screen saying your link is copied.
To copy a link to a specific version of cell:
- Select a cell.
- Access the Selected Cell section of the Curvenote Jupyter Extension Panel.
- Open the version Options menu.
- Select Copy Link
- A black box will appear in the bottom left of your screen saying your link is copied.
To import a cell:
- Add a new cell with Jupyter where you want to import the cell.
- This cell cannot be already linked to Curvenote!
- Any content in the cell will be overwritten upon import.
- Access the Selected Cell section of the Curvenote Jupyter Extension Panel.
- Paste the oxa link into the Import Cell section.
- Click IMPORT CELL.
Curvenote¶
To copy a link to the current saved version of a block you can either use keyboard shortcuts or the Curvenote menus. You can also copy a link to a specific version of a cell using the Block Details Panel.
To copy a link via keyboard shortcuts:
- Select a block.
- When your block is in Draft Mode you will need to either click on the block selection tab or hit
ESC
until you have selected the block, not the content within it. - Selecting a block will slightly darken the blue of the block selection tab.
- When your block is in Draft Mode you will need to either click on the block selection tab or hit
- Use the appropriate copy keyboard shortcut:
CTRL-C
,⌘-C
To copy a link via the Curvenote menus:
- Open the Options menu for the block.
- Select Copy Link.
To copy a link to a specific version of cell:
- Select a block.
- Expand the Block Details Panel.
- Open the version Options menu.
- Select Copy Link.
When you have copied the link a black box will appear in the bottom left of your screen saying your link is copied!
To import a block you must be in Draft Mode (if not, click EDIT in the app bar at the top of the page). Blocks can also be imported using either the paste keyboard shortcut or the Curvenote menus.
To import a block via keyboard shortcuts:
- Select the block above where you want to import your block.
- When your block is in Draft Mode you will need to either click on the block selection tab or hit
ESC
until you have selected the block, not the content within it. - Selecting a block will slightly darken the blue of the block selection tab.
- When your block is in Draft Mode you will need to either click on the block selection tab or hit
- Use the appropriate paste keyboard shortcut:
CTRL-V
,⌘-V
To import a block via the Curvenote menus:
- Select the block you want to add a block above or below.
- Open the More Options menu to the right of the ➕ corresponding to the location you want to import the block.
- Select Import Block.
- Paste the oxa link in the pop-up window.
- Click INSERT BLOCK
Interactive Outputs¶
Most interactive output cells from Jupyter will remain interactive when viewed on Curvenote. Plots and displays created using libraries and packages such as Altair, Bokeh, Bokeh-Holoviews, Bokeh-Panel, Leaflet, Matplotlib, Pandas, Plotly, Seaborn maintain a local state and therefore you can continue to interact with them outside of Jupyter. Curvenote cannot currently run code cells, thus features such as ipywidgets are not interactive on Curvenote.
Learn more and explore examples of interactive plotting on Curvenote ➡️ Example Notebooks
Reuse Code as a Template¶
Often you may want to reuse or start from code you or someone else has already written. Curvenote makes this process easy!
- To reuse content you have already written that is saved on Curvenote:
- Simply import the cells you want to use following the instructions above. The cells are linked to communicate changes across all copies.
- To use content you or someone else has written as a template for a new notebook, and remove the communication of changes between cells:
- You will need to import and unlink the cell. Unlinking the imported cell from the original copy, will leave the current content within the cell but remove the previous versions. Versioning will restart when you save your notebook. Learn more Unlinking Notebooks
- To use content someone else has written that is not saved on Curvenote:
- Add their notebook to Curvenote then import! Learn more Add & Link Notebooks
- Learn more about how Curvenote works with notebooks available on Binder Curvenote & Binder