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:
Open the Pieces Sidebar
Click the Pieces icon
in the extensions section of your browser.
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
.
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.
Make Your Changes
Modify the snippet's content, name, or language as needed.
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:
| Instantly copy the snippet's content to your clipboard to use it in your notes or projects. |
---|---|
| Modifies the snippet's content or metadata. |
| Adds, updates, or removes annotations to give extra context or notes for the snippet. |
| 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.
| Change the snippet’s classification. |
---|---|
| Update the snippet’s title. |
| Create a copy of the snippet. |
| Add or manage related links in the snippet’s metadata. |
| 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.