Skip to content

Commit ab0cc11

Browse files
committed
- copied builder from js snippets
1 parent c2c8171 commit ab0cc11

File tree

7 files changed

+1036
-3
lines changed

7 files changed

+1036
-3
lines changed

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "build",
9+
"group": "build",
10+
"problemMatcher": []
11+
}
12+
]
13+
}

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.vscode-test/**
33
.gitattributes
44
.gitignore
5+
src/**
56
tests/**

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22
All notable changes to the "L13 CSS Snippets" extension will be documented in this file.
33

4+
## [0.14.0] - 2019-09-22
5+
6+
### Added
7+
- Added complete snippet list as markdown.
8+
9+
## [0.13.1] - 2019-08-25
10+
11+
### Fixed
12+
- Fixed link in README
13+
414
## [0.13.0] - 2019-08-25
515
- Initial release

README.md

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

33
This extension contains property snippets for CSS and rule snippets for SCSS.
44

5+
This extension is part of the [L13 Extension Pack](https://marketplace.visualstudio.com/items?itemName=L13RARY.l13-extension-pack).
6+
57
## Index
68

79
1. [Introduction](#Introduction)
@@ -16,7 +18,7 @@ The idea of those snippets is to create a property instantly based on some simpl
1618

1719
Only a few prefixes are twice, because the rules are matching different properties like `fs1` -> `flex-shrink: 1;` and `font-size: 0;`. Then you have to pick the right one.
1820

19-
__The following prefixes are just examples to explain the rules.__ To see the complete list, please visit https://github.com/L13/vscode-css-snippets/tree/master/snippets . If a property or pattern might be missing, please open an issue on [Github](https://github.com/L13/vscode-css-snippets/issues) and make a suggestion.
21+
__The following prefixes are just examples to explain the rules.__ To see the complete list, please visit [SNIPPETS.md](https://github.com/L13/vscode-css-snippets/blob/master/SNIPPETS.md). If a property or pattern might be missing, please open an issue on [Github](https://github.com/L13/vscode-css-snippets/issues) and make a suggestion.
2022

2123
## Shortcut rules for CSS snippets
2224

SNIPPETS.md

Lines changed: 957 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "l13-css-snippets",
33
"displayName": "L13 CSS Snippets",
44
"description": "Snippets for CSS and SCSS",
5-
"version": "0.13.1",
5+
"version": "0.14.0",
66
"publisher": "L13RARY",
77
"preview": true,
88
"license": "SEE LICENCE IN LICENCE.md",
@@ -45,5 +45,8 @@
4545
"path": "./snippets/scss.json"
4646
}
4747
]
48-
}
48+
},
49+
"scripts": {
50+
"build": "node ./src/manual.js"
51+
}
4952
}

src/manual.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Imports ____________________________________________________________________
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
// Variables __________________________________________________________________
7+
8+
const paths = {
9+
CSS: '../snippets/css.json',
10+
SCSS: '../snippets/scss.json',
11+
};
12+
13+
const snippets = [`## CSS and SCSS Snippets
14+
15+
Complete list of all CSS and SCSS snippets for Visual Studio Code. The rules for all these snippets are explained in the [README.md](./README.md)
16+
`];
17+
18+
// Initialize _________________________________________________________________
19+
20+
for (const [headline, pathname] of Object.entries(paths)) {
21+
const json = JSON.parse(fs.readFileSync(path.join(__dirname, pathname), 'utf-8'));
22+
snippets.push(`### ${headline}
23+
24+
| Prefix | Snippet |
25+
| ------:| ------- |
26+
`);
27+
28+
for (const snippet of Object.values(json)) {
29+
if (snippet.prefix !== '___') snippets[snippets.length - 1] += formatSnippets(snippet);
30+
}
31+
}
32+
33+
fs.writeFileSync(path.join(__dirname, '..', 'SNIPPETS.md'), snippets.join('\n'), 'utf-8');
34+
35+
// Exports ____________________________________________________________________
36+
37+
38+
39+
// Functions __________________________________________________________________
40+
41+
function formatSnippets (snippet) {
42+
43+
const body = snippet.body.join(' ').replace(/\t/g, '').replace(/`/g, '\`');
44+
45+
return `| \`${snippet.prefix}\` | \`${body}\` |\n`;
46+
47+
}

0 commit comments

Comments
 (0)