Share a Code Snippet Using the Pieces for JupyterLab Extension
Code snippets saved to Pieces can be shared with others. When you share a code snippet, both the code and the annotations are shared.
Prerequisites
Before you begin, ensure you have:
- Pieces OS installed on your machine.
- Python installed on your machine.
- JupyterLab installed on your machine and running.
- A code snippet saved to Pieces. If you don't have a code snippet saved, check out our save a snippet guide.
Steps
1. Identify the code snippet you want to share
-
Open the Pieces View from the Ribbon Menu if it is not already open.
-
Find the snippet in the list of saved materials.
-
Expand the code using the View Code dropdown
2. Copy the snippets sharable link
In the code panel for the snippet is a button to copy the sharable link for the snippet. This will generate a sharable a link the first time it is selected. Select this button to generate the sharable link.
Once the link has been shared, you will see a toast notification that the link has been copied to the clipboard.
3. Share the link
You can now share this link. When this link is opened, it will take you to a web page with the code and the generated annotations. The recipient can then save this to Pieces from that page.