mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-03-28 17:42:40 +01:00
Added syntax highlighting
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.6.0] - 2020-09-23
|
||||||
|
|
||||||
|
- Syntax highlighting for Hugo shortcodes has been added
|
||||||
|
|
||||||
## [1.5.0] - 2020-09-10
|
## [1.5.0] - 2020-09-10
|
||||||
|
|
||||||
- [#17](https://github.com/estruyf/vscode-front-matter/issues/17): Make front matter be indentation `tabSize` aware
|
- [#17](https://github.com/estruyf/vscode-front-matter/issues/17): Make front matter be indentation `tabSize` aware
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ The extension will automatically verify if your title and description are SEO co
|
|||||||
|
|
||||||
> If you see something missing in your article creation flow, please feel free to reach out.
|
> If you see something missing in your article creation flow, please feel free to reach out.
|
||||||
|
|
||||||
|
## Syntax highlighting for Hugo Shortcodes
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Available commands:
|
## Available commands:
|
||||||
|
|
||||||
**Front Matter: Create <tag | category>**
|
**Front Matter: Create <tag | category>**
|
||||||
|
|||||||
BIN
assets/syntax-highlighting.png
Normal file
BIN
assets/syntax-highlighting.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -134,7 +134,14 @@
|
|||||||
"command": "frontMatter.generateSlug",
|
"command": "frontMatter.generateSlug",
|
||||||
"title": "Front Matter: Generate slug based on article title"
|
"title": "Front Matter: Generate slug based on article title"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"grammars": [
|
||||||
|
{
|
||||||
|
"path": "./syntaxes/hugo.tmLanguage.json",
|
||||||
|
"scopeName": "frontmatter.markdown.hugo",
|
||||||
|
"injectTo": [ "text.html.markdown" ]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"vscode:prepublish": "webpack --mode production",
|
"vscode:prepublish": "webpack --mode production",
|
||||||
|
|||||||
63
syntaxes/hugo.tmLanguage.json
Normal file
63
syntaxes/hugo.tmLanguage.json
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"scopeName": "frontmatter.markdown.hugo",
|
||||||
|
"injectionSelector": "L:text.html.markdown",
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#shortcodes"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"string-double-quoted": {
|
||||||
|
"begin": "\"",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": { "name": "punctuation.definition.string.begin.hugo" }
|
||||||
|
},
|
||||||
|
"end": "\"",
|
||||||
|
"endCaptures": {
|
||||||
|
"0": { "name": "punctuation.definition.string.end.hugo" }
|
||||||
|
},
|
||||||
|
"name": "string.quoted.double.hugo",
|
||||||
|
"patterns": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"unquoted-attribute": {
|
||||||
|
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
|
||||||
|
"name": "string.unquoted.hugo"
|
||||||
|
},
|
||||||
|
"tag-generic-attribute": {
|
||||||
|
"match": "(?<=[^=])\\b([a-zA-Z0-9:-]+)",
|
||||||
|
"name": "entity.other.attribute-name.hugo"
|
||||||
|
},
|
||||||
|
"shortcode-name": {
|
||||||
|
"match": "(\\s[\\w\\-\\_]+\\s)",
|
||||||
|
"name": "hugo.shortcode.name",
|
||||||
|
"captures": {
|
||||||
|
"1": { "name": "keyword.other.important.hugo" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shortcodes": {
|
||||||
|
"begin": "{{<|{{%",
|
||||||
|
"end": ">}}|%}}",
|
||||||
|
"beginCaptures": {
|
||||||
|
"0": { "name": "punctuation.definition.tag.begin.hugo" }
|
||||||
|
},
|
||||||
|
"endCaptures": {
|
||||||
|
"0": { "name": "punctuation.definition.tag.end.hugo" }
|
||||||
|
},
|
||||||
|
"patterns": [
|
||||||
|
{
|
||||||
|
"include": "#shortcode-name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#tag-generic-attribute"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#string-double-quoted"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"include": "#unquoted-attribute"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,3 +40,9 @@
|
|||||||
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/testing-extension).
|
* Reduce the extension size and improve the startup time by [bundling your extension](https://code.visualstudio.com/api/working-with-extensions/testing-extension).
|
||||||
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
|
* [Publish your extension](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) on the VSCode extension marketplace.
|
||||||
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
|
* Automate builds by setting up [Continuous Integration](https://code.visualstudio.com/api/working-with-extensions/continuous-integration).
|
||||||
|
|
||||||
|
|
||||||
|
## Usefull links
|
||||||
|
|
||||||
|
https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#injection-grammars
|
||||||
|
https://github.com/microsoft/vscode-textmate/blob/e8f439d613afa00674e83b3b3ae382fc774665e1/test-cases/themes/syntaxes/html.json
|
||||||
Reference in New Issue
Block a user