Skip to content

Commit

Permalink
Add Visual Studio Code Snippet Template
Browse files Browse the repository at this point in the history
  • Loading branch information
k15a committed Jun 2, 2020
1 parent 742ccfc commit 94771b7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compile-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ templatedBuilder.build('open-color.sketchpalette',
templatedBuilder.build('open-color.inkscape',
[path.join(__dirname, 'docs', 'asset', 'download', `open-color_${pkg.version}.gpl`)]);

templatedBuilder.build('open-color.code-snippets',
[path.join(__dirname, 'docs', 'asset', 'download', `open-color_${pkg.version}.code-snippets`)]);

aseBuilder.build('ase',
[path.join(__dirname, 'docs', 'asset', 'download', `open-color_${pkg.version}.ase`)]);

Expand All @@ -52,4 +55,4 @@ templatedBuilder.build('open-color.rcpx',
[path.join(__dirname, 'open-color.rcpx')]);

templatedBuilder.build('open-color.d.ts',
[path.join(__dirname, 'open-color.d.ts')]);
[path.join(__dirname, 'open-color.d.ts')]);
28 changes: 28 additions & 0 deletions templates/open-color.code-snippets.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
//
// 𝗖 𝗒 π—Ÿ 𝗒 π—₯
// v {{version}}
//
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

{
// General

{{#each general as |color|}}
"{{capitalize color.name}}": {
"prefix": ["oc-{{color.name}}"],
"body": ["{{color.hex}}"]
},
{{/each}}
{{#each colors as |color|}}

// {{capitalize color.name}}

{{#each color.hex as |hex index|}}
"{{capitalize color.name}} {{index}}": {
"prefix": ["oc-{{color.name}}-{{index}}"],
"body": ["{{hex}}"]
},
{{/each}}
{{/each}}
}

0 comments on commit 94771b7

Please sign in to comment.