Dash Snippet Builder
$ git clone https://github.com/tbpgr/dash_snippets_builder.git
java1.toml, java2.toml, ruby1.toml are sample snippets.
.├── Gemfile├── Gemfile.lock├── LICENSE.txt├── README.md├── Rakefile└── snippets : you save snippets here ├── java │ ├── java1.toml │ └── java2.toml └── ruby └── ruby1.toml
$ cd %git%/dash_snippets_builder# check rake task$ rake -Trake dash:build # build snippets
DASH_SNIPPET_PATH=/Users/your user name/Library/Application Support/Dash/library.dashLOG_LEVEL=DEBUG
[snippet]title = "javatitle;;"body = "line1\nline1\nline2\n"syntax = "Java"tag = "Java"
[snippet]title = "javatitle2;;"body = "line1\nline1\nline2\n"syntax = "Java"tag = "Java"
[snippet]title = "title;;"body = "line1\nline1\nline2\n"syntax = "Ruby"tag = "Ruby"
$ rake dash:build2015/12/15 22:35:40 - DEBUG - start build snippets2015/12/15 22:35:40 - DEBUG - start delete snippets2015/12/15 22:35:40 - DEBUG - success delete snippets2015/12/15 22:35:40 - DEBUG - success delete tagsIndex2015/12/15 22:35:40 - DEBUG - success delete tags2015/12/15 22:35:40 - DEBUG - finish delete snippets2015/12/15 22:35:40 - DEBUG - create javatitle;;2015/12/15 22:35:40 - DEBUG - insert tagsIndexfor title:javatitle;; tag: Java2015/12/15 22:35:40 - DEBUG - create tag Java2015/12/15 22:35:40 - DEBUG - create snippet javatitle;;2015/12/15 22:35:40 - DEBUG - create javatitle2;;2015/12/15 22:35:40 - DEBUG - insert tagsIndexfor title:javatitle2;; tag: Java2015/12/15 22:35:40 - DEBUG - create snippet javatitle2;;2015/12/15 22:35:40 - DEBUG - create title;;2015/12/15 22:35:40 - DEBUG - insert tagsIndexfor title:title;; tag: Ruby2015/12/15 22:35:40 - DEBUG - create tag Ruby2015/12/15 22:35:40 - DEBUG - create snippet ti
$cd~/Library/Application Support/Dash$ sqlite3 library.dashsqlite>select* from snippets;1|javatitle;;|line1line1line2|Java|02|javatitle2;;|line1line1line2|Java|03|title;;|line1line1line2|Ruby|0sqlite>select* from tags;1|Java2|Rubysqlite>select* from tagsIndex;1|11|2
$ rake dash:dump2015/12/15 23:32:38 - DEBUG - start dump snippets2015/12/15 23:32:38 - DEBUG - snippet count = 32015/12/15 23:32:38 - DEBUG -complete output ./snippets/dump/javatitle.toml2015/12/15 23:32:38 - DEBUG -complete output ./snippets/dump/javatitle2.toml2015/12/15 23:32:38 - DEBUG -complete output ./snippets/dump/title.toml2015/12/15 23:32:38 - DEBUG - finish dump snippets
$cd snippets/dump$ cat*.toml[snippet]body ="line1\nline1\nline2\n"syntax ="Java"tag ="Java"title ="javatitle;;"[snippet]body ="line1\nline1\nline2\n"syntax ="Java"tag ="Java"title ="javatitle2;;"[snippet]body ="line1\nline1\nline2\n"syntax ="Ruby"tag ="Ruby"
