Skip to content

add feature: vs code intellisense to devicon.json #1487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 221 additions & 0 deletions .vscode/devicon-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"IconVersions": {
"type": "string",
"enum": [
"original",
"plain",
"line",
"original-wordmark",
"plain-wordmark",
"line-wordmark"
]
},
"IconVersionsArray": {
"type": "array",
"items": {
"$ref": "#/definitions/IconVersions"
}
}
},
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"title": "The official name of the technology.",
"description": "Pattern: Only lower-case letters and digits.",
"pattern": "^(dot-net|[0-9a-z]+)$"
},
"altnames": {
"type": "array",
"title": "List of alternative names for this technology.",
"description": "Used for the searchbar on the Devicon website. https://devicon.dev",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"title": "List of tags relating to the technology for categorization/search purpose.",
"$ref": "./tags-enum.json/#/definitions/Tags"
},
"versions": {
"title": "Keep tracks of the different versions that you have.",
"type": "object",
"additionalProperties": false,
"properties": {
"svg": {
"title": "List all the SVGs that you have.",
"contains": {
"$ref": "#/definitions/IconVersions"
},
"minItems": 1,
"uniqueItems": true,
"$ref": "#/definitions/IconVersionsArray"
},
"font": {
"title": "List only the SVGs that can be converted to fonts. Usually refers to \"plain\" and \"line\" versions but \"original\" can be accepted.",
"description": "DO NOT list aliases here! In this case use \"aliases\" property!",
"contains": {
"$ref": "#/definitions/IconVersions"
},
"minItems": 1,
"uniqueItems": true,
"$ref": "#/definitions/IconVersionsArray"
}
}
},
"color": {
"title": "The official/main hexadecimal color of the logo. [Case insensitive]",
"description": "Pattern example: #FFFFFF",
"type": "string",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$"
},
"aliases": {
"title": "Keeps track of the aliases for the font versions ONLY.",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"base": {
"title": "The SVG file you are using as source for the alias.",
"$ref": "#/definitions/IconVersions"
},
"alias": {
"title": "The new name (alias) that you want to generate.",
"$ref": "#/definitions/IconVersions"
}
},
"required": [
"base",
"alias"
],
"allOf": [
{
"if": {
"properties": {
"base": {
"const": "original"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "original"
}
}
}
}
},
{
"if": {
"properties": {
"base": {
"const": "plain"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "plain"
}
}
}
}
},
{
"if": {
"properties": {
"base": {
"const": "line"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "line"
}
}
}
}
},
{
"if": {
"properties": {
"base": {
"const": "original-wordmark"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "original-wordmark"
}
}
}
}
},
{
"if": {
"properties": {
"base": {
"const": "plain-wordmark"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "plain-wordmark"
}
}
}
}
},
{
"if": {
"properties": {
"base": {
"const": "line-wordmark"
}
}
},
"then": {
"not": {
"properties": {
"alias": {
"const": "line-wordmark"
}
}
}
}
}
]
}
}
},
"required": [
"name",
"altnames",
"tags",
"versions",
"color",
"aliases"
]
}
}
24 changes: 24 additions & 0 deletions .vscode/devicon.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"new entry": {
"scope": "json",
"prefix": "new",
"description": "Inserts the new entry template object. Use it ONLY in \"devicon.json\"!",
"body": [
"{",
" \"name\": \"\",",
" \"altnames\": [],",
" \"tags\": [],",
" \"versions\": {",
" \"svg\": [",
" ",
" ],",
" \"font\": [",
" ",
" ]",
" },",
" \"color\": \"\",",
" \"aliases\": []",
"},"
]
}
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"json.schemas": [
{
"fileMatch": [
"devicon.json"
],
"url": "/.vscode/devicon-schema.json"
}
]
}
Loading