Snippets vs Packages

Hi friends, I was through the popclip documentation and figured out that there are two ways of automating things with it, snippets and extensions. Snippets are basically schema + code and is installed right away. Extensions are much more complex to create and we have to set up code files, icons and configs. How do I decide if I should make a snippet or an extension if I want a functionality out of popclip. Do extensions have an advantage over snippets, or can both features to the same thing? (since snippets do allow to insert code/scripts within them)

1 Like

The distinction is between Snippets and Packages. Both are types of extensions.

There is no difference in capabilities between the two. The only difference is the way you write them.

If you just want to make a simple extension for yourself I recommend making a snippet. (That’s what I do.)

They each have advantages and disadvantages, so I made a table to summarise:


Snippets and Packages

A PopClip extension can be either a snippet or a package. The following table summarizes the differences:

Snippet Package
What is it? Plain text in YAML format. A folder containing a config file plus other files such as icons, source files, and a readme file.
Install method PopClip can load it directly from a text selection. Double-clicking it will open it in PopClip.
Distribution Can be shared as text, e.g. on forums, pastebins, etc. Can be downloaded as a file.
Signing Not signed. Can be signed.
Advantages Easy to create and share informally. No need for separate files. Suitable for formal publishing. Easy for end user to install. Allows modular source code with complex functionality.
Disadvantages Limited to what can be done with a single text file. More complex to create. Steeper learning curve.

(the table copied and pasted from https://www.popclip.app/dev/#snippets-and-packages)

2 Likes

Blazing fast responses to all my questions lol. Thank you @nick!

1 Like

Have fun trying things out!

1 Like