Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
MCStreetguy committed Jul 30, 2017
2 parents e83b652 + 77c995f commit 6775d9f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- .MD ~ Markdown file `unimportable`
#### Improvements
- Quick Start Guide enhanced
- `README.md`
- `README.md` / `HOWTO.md`
- IMEX module configuration
- Auto-set Editor grammar when inserting into new file
#### Patches
Expand Down
33 changes: 32 additions & 1 deletion HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

---

## Examples
## Using the snippet-injector

### Create
(_[Reference](README.md#commands)_)

Expand Down Expand Up @@ -58,3 +59,33 @@ The snippet is now deleted from the local Atom storage.


---

## Using the IMEX module

The IMEX (shorthand for 'IMport and EXport') module provides import and export
functionalities. It ships with several format configurations and parsing methods.
To access it, open the `Packages` menu and navigate down to the submenu
`Snippet Injector`. There you should find the options `Import Snippets` and
`Export Snippets` (which is a submenu).

### Exporting
(_[Reference](README.md#commands)_)

To export your snippets, open the named submenu `Export Snippets` and
select a format of your choise. (All available formatting options can be found [here](README.md#snippet-injectorexport-to-)).
Afterwards you will be prompted for a saving location and the file will be stored there.

### Importing
(_[Reference](README.md#commands)_)

To import previously exported data, select the `Import Snippets` option in the menu.
You will be prompted for a file to import from. The format is recognized automatically,
the file contents get parsed accordingly and are stored as new snippets.


### Please notice!
If you want to import data back later on, make sure you choose a format
that is stated as "importable" and **_not for a moment_ touch the file contents!**
The IMEX module does not recognize invalid data and will parse everything within
the given file. This may result in Fatal Errors or broken snippets.
> *Don't complain later, I told you so...*
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Atom Snippet Injector
**An easy but powerful snippet management tool for Atom editor.**

This atom package provides a JSON based snippet management.

*But why use this package* you ask?

Because you can reach every feature in more or less three steps.

It's easy and fast so you don't have to struggle with difficult UI's or file syntaxes or even worse, writing the snippets manually.
Check out the [Quick Start Guide](HOWTO.md#examples) for more instructions on how to use this package.
Check out the [Quick Start Guide](HOWTO.md#using-the-snippet-injector) for short instructions on how to use this package.
Happy Coding :)

---

## Reference

#### Commands
### Commands
The following commands are registered by Snippet Injector and can be accessed via the command palette.
If stated, the commands can also be called through menus or via hotkey.

##### **snippet-injector:create**
#### **snippet-injector:create**
This command creates a new snippet from the current selection in the current editor.
You will be prompted for a snippet title.

Expand All @@ -30,7 +31,7 @@ You will be prompted for a snippet title.
---

##### **snippet-injector:update**
#### **snippet-injector:update**
This command updates an existing snippet's content to the current selection in the current editor.
You will be prompted for choosing an existing snippet.

Expand All @@ -39,7 +40,7 @@ You will be prompted for choosing an existing snippet.
---

##### **snippet-injector:insert**
#### **snippet-injector:insert**
This command injects a snippet to the current marker position(s).
You will be prompted to choose a snippet from a list.

Expand All @@ -51,7 +52,7 @@ You will be prompted to choose a snippet from a list.
---

##### **snippet-injector:delete**
#### **snippet-injector:delete**
This command deletes a snippet from the local storage.
You will be prompted for the snippet name to delete.

Expand All @@ -60,12 +61,44 @@ You will be prompted for the snippet name to delete.
---

##### **snippet-injector:toggledebug**
#### **snippet-injector:toggledebug**
This command toggles all debugging options for the package.
Debug informations are logged in Atom's console.

*Please notice that this command is just available through command palette!*

---

#### **snippet-injector:import**
This command imports previously exported data from an importable file format.
The format is recognized automatically, the contained data gets parsed
and the resulting snippets will be stored simultaneously.

Since this command is part of the [IMEX module](HOWTO.md#using-the-imex-module), I recommend usage via main menu.

*Name in menus:*
> "Import Snippets"
---

#### **snippet-injector:export-to-...**
This command exports the local storage in the given file format.
All snippets get parsed, based on the specific configuration and then are written into a user chosen file.

Since this command is part of the [IMEX module](HOWTO.md#using-the-imex-module), I recommend usage via main menu.

###### available formats:

| Format | Extension | Command | Importable | additional Infos |
|---------:|-----------|--------------------------------|:----------:|--------------------------------------------|
| CSV | .csv | snippet-injector:export-to-csv | yes | Files may look untidy, use it as recovery |
| Markdown | .md | snippet-injector:export-to-md | no | Human-readable, beautified |

*Name in menus:*
> "Export Snippets -> ..."

---

---

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
"main": "./lib/snippet-injector",
"version": "1.2.6",
"description": "An easy but powerful snippet management tool for Atom editor.",
"keywords": [],
"keywords": [
"snippets",
"snippet-injector",
"snippet-manager",
"atom",
"atom-editor"
],
"repository": "https://github.com/MCStreetguy/atom-snippet-injector",
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 6775d9f

Please sign in to comment.