Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Mar 24, 2017
0 parents commit cedc13b
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
@@ -0,0 +1,5 @@
[*]
spaces = 4

[*.json]
spaces = 2
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
out
node_modules
*.log
17 changes: 17 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,17 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}",
"preLaunchTask": "npm"
}
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,9 @@
// 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
}
}
30 changes: 30 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,30 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

// A task runner that calls a custom npm script that compiles the extension.
{
"version": "0.1.0",

// we want to run npm
"command": "npm",

// the command is a shell script
"isShellCommand": true,

// show the output window only if unrecognized errors occur.
"showOutput": "silent",

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,

// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch"
}
9 changes: 9 additions & 0 deletions .vscodeignore
@@ -0,0 +1,9 @@
.vscode/**
.vscode-test/**
out/test/**
test/**
src/**
**/*.map
.gitignore
tsconfig.json
vsc-extension-quickstart.md
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,4 @@
# Change Log

## [Unreleased]
- Initial release
17 changes: 17 additions & 0 deletions LICENSE
@@ -0,0 +1,17 @@
Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12 changes: 12 additions & 0 deletions README.md
@@ -0,0 +1,12 @@
# VSCode Markdown Mermaid

> **⚠️Warning⚠️** This extension depends on an experimental vscode API that is subject to change or removal.
Demonstrates how VSCode's builtin Markdown preview can be extended by other extensions. This extension adds mermaid diagram support

## Enabling

1. Using a VSCode insiders from March 24th+
1. Install the VSIX for this extension
1. Add the setting `"markdown.enableExperimentalExtensionApi": true` to your workspace.

17 changes: 17 additions & 0 deletions index.js
@@ -0,0 +1,17 @@
"use strict"


module.exports.activate = () => {
return {
extendMarkdownIt(md) {
const highlight = md.options.highlight;
md.options.highlight = (code, lang) => {
if (lang && lang.toLowerCase() === 'mermaid') {
return `<div class="mermaid">${code}</div>`;
}
return highlight(code, lang);
};
return md;
}
}
}
5 changes: 5 additions & 0 deletions jsconfig.json
@@ -0,0 +1,5 @@
{
"exclude": [
"node_modules"
]
}
Binary file added markdown-mermaid-0.0.1.vsix
Binary file not shown.
1 change: 1 addition & 0 deletions oceanaut.js
@@ -0,0 +1 @@
mermaid.initialize({startOnLoad:true});
38 changes: 38 additions & 0 deletions package.json
@@ -0,0 +1,38 @@
{
"name": "markdown-mermaid",
"displayName": "Markdown Preview Mermaid Support",
"description": "",
"version": "0.0.1",
"publisher": "bierner",
"license": "MIT",
"repository": {
"url": "https://github.com/mjbvz/vscode-markdown-mermaid.git"
},
"bugs": {
"url": "https://github.com/mjbvz/vscode-markdown-mermaid/issues"
},
"engines": {
"vscode": "^1.8.0"
},
"activationEvents": [],
"main": "./index.js",
"categories": [
"Other"
],
"contributes": {
"markdown.preview": {
"styles": [
"./node_modules/mermaid/dist/mermaid.css"
],
"scripts": [
"./node_modules/mermaid/dist/mermaid.js",
"./oceanaut.js"
]
},
"markdownit.plugins": true
},
"dependencies": {
"github-markdown-css": "^2.4.1",
"highlight.js": "^9.10.0"
}
}

0 comments on commit cedc13b

Please sign in to comment.