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

Commit 6775d9f

Browse files
committed
Merge branch 'dev'
2 parents e83b652 + 77c995f commit 6775d9f

File tree

4 files changed

+80
-10
lines changed

4 files changed

+80
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- .MD ~ Markdown file `unimportable`
1313
#### Improvements
1414
- Quick Start Guide enhanced
15-
- `README.md`
15+
- `README.md` / `HOWTO.md`
1616
- IMEX module configuration
1717
- Auto-set Editor grammar when inserting into new file
1818
#### Patches

HOWTO.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
---
44

5-
## Examples
5+
## Using the snippet-injector
6+
67
### Create
78
(_[Reference](README.md#commands)_)
89

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

5960

6061
---
62+
63+
## Using the IMEX module
64+
65+
The IMEX (shorthand for 'IMport and EXport') module provides import and export
66+
functionalities. It ships with several format configurations and parsing methods.
67+
To access it, open the `Packages` menu and navigate down to the submenu
68+
`Snippet Injector`. There you should find the options `Import Snippets` and
69+
`Export Snippets` (which is a submenu).
70+
71+
### Exporting
72+
(_[Reference](README.md#commands)_)
73+
74+
To export your snippets, open the named submenu `Export Snippets` and
75+
select a format of your choise. (All available formatting options can be found [here](README.md#snippet-injectorexport-to-)).
76+
Afterwards you will be prompted for a saving location and the file will be stored there.
77+
78+
### Importing
79+
(_[Reference](README.md#commands)_)
80+
81+
To import previously exported data, select the `Import Snippets` option in the menu.
82+
You will be prompted for a file to import from. The format is recognized automatically,
83+
the file contents get parsed accordingly and are stored as new snippets.
84+
85+
86+
### Please notice!
87+
If you want to import data back later on, make sure you choose a format
88+
that is stated as "importable" and **_not for a moment_ touch the file contents!**
89+
The IMEX module does not recognize invalid data and will parse everything within
90+
the given file. This may result in Fatal Errors or broken snippets.
91+
> *Don't complain later, I told you so...*

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
# Atom Snippet Injector
22
**An easy but powerful snippet management tool for Atom editor.**
3+
34
This atom package provides a JSON based snippet management.
45

56
*But why use this package* you ask?
67

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

910
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.
10-
Check out the [Quick Start Guide](HOWTO.md#examples) for more instructions on how to use this package.
11+
Check out the [Quick Start Guide](HOWTO.md#using-the-snippet-injector) for short instructions on how to use this package.
1112
Happy Coding :)
1213

1314
---
1415

1516
## Reference
1617

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

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

@@ -30,7 +31,7 @@ You will be prompted for a snippet title.
3031
3132
---
3233

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

@@ -39,7 +40,7 @@ You will be prompted for choosing an existing snippet.
3940
4041
---
4142

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

@@ -51,7 +52,7 @@ You will be prompted to choose a snippet from a list.
5152
5253
---
5354

54-
##### **snippet-injector:delete**
55+
#### **snippet-injector:delete**
5556
This command deletes a snippet from the local storage.
5657
You will be prompted for the snippet name to delete.
5758

@@ -60,12 +61,44 @@ You will be prompted for the snippet name to delete.
6061
6162
---
6263

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

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

70+
---
71+
72+
#### **snippet-injector:import**
73+
This command imports previously exported data from an importable file format.
74+
The format is recognized automatically, the contained data gets parsed
75+
and the resulting snippets will be stored simultaneously.
76+
77+
Since this command is part of the [IMEX module](HOWTO.md#using-the-imex-module), I recommend usage via main menu.
78+
79+
*Name in menus:*
80+
> "Import Snippets"
81+
82+
---
83+
84+
#### **snippet-injector:export-to-...**
85+
This command exports the local storage in the given file format.
86+
All snippets get parsed, based on the specific configuration and then are written into a user chosen file.
87+
88+
Since this command is part of the [IMEX module](HOWTO.md#using-the-imex-module), I recommend usage via main menu.
89+
90+
###### available formats:
91+
92+
| Format | Extension | Command | Importable | additional Infos |
93+
|---------:|-----------|--------------------------------|:----------:|--------------------------------------------|
94+
| CSV | .csv | snippet-injector:export-to-csv | yes | Files may look untidy, use it as recovery |
95+
| Markdown | .md | snippet-injector:export-to-md | no | Human-readable, beautified |
96+
97+
*Name in menus:*
98+
> "Export Snippets -> ..."
99+
100+
101+
---
69102

70103
---
71104

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
"main": "./lib/snippet-injector",
44
"version": "1.2.6",
55
"description": "An easy but powerful snippet management tool for Atom editor.",
6-
"keywords": [],
6+
"keywords": [
7+
"snippets",
8+
"snippet-injector",
9+
"snippet-manager",
10+
"atom",
11+
"atom-editor"
12+
],
713
"repository": "https://github.com/MCStreetguy/atom-snippet-injector",
814
"license": "MIT",
915
"engines": {

0 commit comments

Comments
 (0)