Editing

Keep your code snippets up-to-date in the Pieces Web Extension with easy editing.


How to Edit Saved Materials

Editing saved materials is a great way to make sure that your most-used code or reference text stays as evergreen as possible.

The more you curate your library of saved code snippets to your specific workflow and use cases, the more useful and “dialed in” your personal repository will be over time

To modify an existing snippet, follow these steps:

1

Open the Pieces Sidebar

Click the Pieces icon in the extensions section of your browser.

2

Locate and Open the Snippet

Go to the Pieces Drive section of the browser by clicking the dropdown in the top left of the extension and selecting Pieces Drive.

3

Navigate to the Edit Button

At the bottom of the quick view section, click the Edit Selected Material button (pencil icon) to enter editing mode.

4

Make Your Changes

Modify the snippet's content, name, or language as needed.

5

Save Your Edits

Click the Save Changes button on the bottom left of the extension.

Within the editing view, you will also have options to 4 new options:

  • Templatize Selected Material: This will convert the material into a template for future usage inside your IDEs.

  • Optimize Selected Material for Performance: This option refactors the code for performance and future usage.

  • Optimize Select Material for Readability: Selecting this option will improve variable names and add helpful comments to make the code easier to understand in the future.

  • Convert Selected Material to New Language: This option converts the selected material to a new programming language and allows you to add custom descriptors to help improve the translation.

Your changes are automatically saved in real-time and reflected across the Pieces Sidebar.

Material Management Actions

There are several material management options available when editing code snippets in the Pieces Web Extension:


Copy Code to Clipboard

Instantly copy the snippet's content to your clipboard to use it in your notes or projects.

Edit Snippet

Modifies the snippet's content or metadata.

Edit Annotations

Adds, updates, or removes annotations to give extra context or notes for the snippet.

Share via Pieces

Creates a shareable link to the snippet for collaboration or external use.


Actions from the Quick Preview Mode

When viewing a snippet in Quick Preview Mode in the Pieces Web Extension, you can use quick actions to manage snippets and enhance your workflow.

Access these actions from the toolbar or the Captured Context section below the snippet.

Quick Menu Actions

The Pieces Web Extension lets you easily manage your snippets by clicking the three dots inside the Pieces Drive section.

From there, you can choose from a variety of options listed in the table below.


Reclassify

Change the snippet’s classification.

Rename

Update the snippet’s title.

Duplicate

Create a copy of the snippet.

Related Links

Add or manage related links in the snippet’s metadata.

Tags

Add, update, or remove tags.


Quickly Access Snippets

Layers upon layers of functionality—that’s the goal of all Pieces for Developers plugins and extensions.

Right from within the Pieces Drive tab, select a saved material to open it in markdown as a preview—then click the Edit icon to edit & save your code.

Updated on