Skip to main content

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

  1. Open the Pieces View from the Ribbon Menu if it is not already open.

  2. Find the snippet in the list of saved materials.

  3. Expand the code using the View Code dropdown

    The view code button

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.

The copy sharable link button

Once the link has been shared, you will see a toast notification that the link has been copied to the clipboard.

Sharable link copied to clipboard notification

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.

The shared code snippet in a browser window

Next Steps