Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
colinfang committed Apr 26, 2020
0 parents commit d860d36
Show file tree
Hide file tree
Showing 10 changed files with 329 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on:
push:
release:
types:
- created

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: actions/checkout@v2
- run: npm install
- uses: docker://colinfang/vsce
with:
args: package
- uses: actions/upload-artifact@v2-preview
with:
name: vsix
path: "*.vsix"

release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
needs: package
steps:
- uses: actions/download-artifact@v2-preview
with:
name: vsix
- id: find_file_name
run: echo "::set-output name=file::$(ls *.vsix)"
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.find_file_name.outputs.file }}
asset_name: ${{ steps.find_file_name.outputs.file }}
asset_content_type: application/zip
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
out
node_modules
.vscode-test/
*.vsix
36 changes: 36 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
10 changes: 10 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vscode/**
.vscode-test/**
out/test/**
src/**
.gitignore
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# My Markdown Grammar Plugin for VS Code


This extension provides additional Markdown grammar scopes for syntax highlighting for myself.


![snapshot](snapshot.png)
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "my-markdown-plugin",
"displayName": "My Markdown Plugin",
"description": "Additional grammar scopes in Markdown",
"version": "0.0.1",
"publisher": "colinfang",
"engines": {
"vscode": "^1.44.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"grammars": [
{
"scopeName": "markdown.my_plugin",
"path": "./syntaxes/plugin.json",
"injectTo": [
"text.html.markdown"
]
}
]
},
"repository": {
"type": "git",
"url": "https://github.com/colinfang/my-markdown-plugin.git"
}
}
Binary file added snapshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 171 additions & 0 deletions syntaxes/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"injectionSelector": "L:markup.list.unnumbered.markdown meta.paragraph.markdown - inline-dollars",
"patterns": [
{
"include": "#reference"
},
{
"include": "#tip"
},
{
"include": "#workaround"
},
{
"include": "#todo"
},
{
"include": "#fixed"
},
{
"include": "#issue"
},
{
"include": "#index"
},
{
"include": "#feature"
},
{
"include": "#convention"
}
],
"repository": {
"reference": {
"match": "(\\{)(.+?)(\\})",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "meta.reference.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.reference.plugin"
},
"tip": {
"match": "(?<=- )(\\[)(Tip)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.tip.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.tip.plugin"
},
"workaround": {
"match": "(?<=- )(\\[)(Workaround)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.workaround.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.workaround.plugin"
},
"todo": {
"match": "(?<=- )(\\[)(TODO)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.todo.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.todo.plugin"
},
"fixed": {
"match": "(?<=- )(\\[)(Fixed)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.fixed.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.fixed.plugin"
},
"issue": {
"match": "(?<=- )(\\[)(Issue)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.issue.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.issue.plugin"
},
"feature": {
"match": "(?<=- )(\\[)(Feature request)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.feature.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.feature.plugin"
},
"index": {
"match": "(?<=- )(\\[)(Index)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.index.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.index.plugin"
},
"convention": {
"match": "(?<=- )(\\[)(Convention)(\\])(?= )",
"captures": {
"1": {
"name": "punctuation.definition.plugin"
},
"2": {
"name": "value.tag.convention.plugin"
},
"3": {
"name": "punctuation.definition.plugin"
}
},
"name": "markup.tag.convention.plugin"
}
},
"scopeName": "markdown.my_plugin"
}

0 comments on commit d860d36

Please sign in to comment.