8. Import, Export, and Publish

8.1. Import

To import, choose Library > Import, then select a source:

  • SnippetsLab: Merge another SnippetsLab library (.snippetslablibrary) into the current library, including its folders, smart groups, snippets, tags, and attachments.

  • Plain Text: Import plain text files and source code files. SnippetsLab detects the language of each file from its content and filename extension.

  • JSON: Import a JSON file in the SnippetsLab JSON format. To import from an app that SnippetsLab doesn’t support directly, convert its data to this format first. For the format specification, see JSON Import Format Specification.

  • Quiver: Import a Quiver library (.qvlibrary), notebook (.qvnotebook), or note (.qvnote). Notebooks are imported as folders, and tags are imported as is. Notes with only code cells in a single language are imported as snippets in the same language. Other notes are imported as Markdown snippets.

  • CodeBox: Import CodeBox files, which have the .cbxml extension. Folders, tags, and notes are kept. Lists are imported as folders, and tabs are imported as fragments.

  • GitHub Gist: Import public gists from any account. If you’re signed in to GitHub in Settings > Integrations, you can also import your private gists. Signing in also raises the GitHub rate limit from 60 to 5000 requests per hour, which is useful for importing a large number of gists at once.

8.2. Export

To export your library, choose Library > Export. The supported formats are SnippetsLab Library, JSON Document, XML Document, and Plain Text Files (Zip Archive). To move your library to another Mac or keep a complete copy, use SnippetsLab Library, because attachments are imported only from this format.

8.3. Publish Gist to GitHub

You can publish snippets to GitHub as gists.

  • To sign in to GitHub: In Settings > Integrations, click Authenticate GitHub and follow the steps to authorize SnippetsLab on GitHub.

    SnippetsLab requests only the gist scope, which covers your public and secret gists. It has no access to the rest of your GitHub account, such as repositories or profile information.

  • To publish a snippet: Control-click the snippet and choose GitHub > Create New Gist. The gist is public unless Create secret gist is selected. To publish later changes, choose GitHub > Update Existing Gist.

  • To unlink a snippet from its gist: Control-click the snippet and choose GitHub > Unlink with GitHub. This doesn’t delete the gist on GitHub.

Tip

To list all snippets published as gists, create a smart group with the rule Gist is Yes. You can also filter by gist author. For more about smart groups, see Smart Groups.