Skip to content

Commit

Permalink
Markdown Highlighting Support (#15)
Browse files Browse the repository at this point in the history
* feat: add markdown support

* fix: md highlighting token
  • Loading branch information
saurabhdaware authored Sep 3, 2023
1 parent f91ee1e commit 9eb597d
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 18 deletions.
Binary file modified images/logo-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "abell-language-features",
"displayName": "Abell Language Features",
"description": "Syntax Highlighting for .abell files to help you make static sites even faster",
"version": "1.0.0",
"description": "Syntax Highlighting for .abell files. Learn more about Abell at https://abelljs.org/",
"version": "1.1.1",
"publisher": "saurabh",
"author": {
"name": "saurabhdaware"
},
"icon": "images/logo-512.png",
"galleryBanner": {
"color": "#f9f9f9"
"color": "#E7EBFD"
},
"license": "MIT",
"repository": {
Expand Down
1 change: 0 additions & 1 deletion server/src/modes/jsMode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { LanguageService as TSLanguageService } from '@volar/typescript-language-service';

import { CompletionItemKind, TextDocument } from "vscode-languageserver"
import { Position } from "vscode-languageserver-textdocument"
Expand Down
4 changes: 3 additions & 1 deletion server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"sourceMap": true,
"strict": true,
"outDir": "out",
"rootDir": "src"
"rootDir": "src",
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", ".vscode-test"]
Expand Down
4 changes: 2 additions & 2 deletions syntaxes/abell.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"end": "}}",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
"name": "punctuation.definition.template-expression.begin.js"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
"name": "punctuation.definition.template-expression.end.js"
}
},
"contentName": "meta.embedded.block.javascript",
Expand Down
4 changes: 2 additions & 2 deletions syntaxes/html-injections.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
"end": "}",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
"name": "punctuation.definition.template-expression.begin.js"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
"name": "punctuation.definition.template-expression.end.js"
}
},
"patterns": [
Expand Down
85 changes: 76 additions & 9 deletions syntaxes/js-injections.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,101 @@
"patterns": [
{
"include": "#highlight-html-block"
}
},
{
"include": "#markdown-overrides"
}
],
"repository": {
"highlight-html-block": {
"begin": "/\\* *?html ?\\*/ *?`",
"markdown-overrides": {
"begin": "(md)(`)",
"end": "`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
"1": {
"name": "entity.name.function.js"
},
"2": {
"name": "punctuation.definition.string.template.begin.js"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
"0": {
"name": "punctuation.definition.string.template.end.js"
}
},
"name": "source.abell.markdown",
"patterns": [
{
"match": "(#+)\\s+(.*?)$",
"name": "abell.heading.markdown",
"captures": {
"1": {
"name": "punctuation.definition.heading.markdown"
},
"2": {
"name": "entity.name.section.markdown",
"patterns": [
{
"include": "text.html.markdown#inline"
},
{
"include": "text.html.derivative"
}
]
},
"3": {
"name": "punctuation.definition.heading.markdown"
}
}
},
{
"include": "text.html.markdown#inline"
},
{
"include": "text.html.markdown#fenced_code_block"
},
{
"include": "text.html.markdown#lists"
},
{
"include": "text.html.markdown#separator"
},
{
"include": "text.html.markdown#blockquote"
},
{
"include": "text.html.markdown#table"
}
]
},
"highlight-html-block": {
"begin": "(/\\* *?html ?\\*/ *?)(`)",
"end": "`",
"beginCaptures": {
"1": {
"name": "comment.block.documentation.js"
},
"2": {
"name": "punctuation.definition.string.template.begin.js"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.template.end.js"
}
},
"patterns": [
{
"begin": "\\$\\{",
"end": "}",
"beginCaptures": {
"0": {
"name": "punctuation.definition.tag.begin.html"
"name": "punctuation.definition.template-expression.begin.js"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.tag.end.html"
"name": "punctuation.definition.template-expression.end.js"
}
},
"patterns": [
Expand Down

0 comments on commit 9eb597d

Please sign in to comment.