Skip to content

Commit 991559e

Browse files
authored
Merge pull request #6 from geeklearningio/feature/update-version
Feature/update version
2 parents 1cdc76b + 5a9066e commit 991559e

File tree

3 files changed

+227
-1426
lines changed

3 files changed

+227
-1426
lines changed

graphviz-render.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
function contentLoaded() {
2+
var viz = new Viz();
23
var graphvizElements = document.getElementsByClassName('graphviz');
34

45
var changes = [];
@@ -9,13 +10,15 @@ function contentLoaded() {
910

1011
changes.push({
1112
placeholder: element.parentElement.parentElement,
12-
svg: Viz(source)
13+
svg: viz.renderString(source, {engine: 'dot', format:'svg'})
1314
});
1415
}
1516

1617
for (let index = 0; index < changes.length; index++) {
17-
const element = changes[index];
18-
element.placeholder.outerHTML = element.svg;
18+
const change = changes[index];
19+
change.svg.then(svg=> {
20+
change.placeholder.outerHTML = svg;
21+
});
1922
}
2023

2124
// use to debug rendered code.

package.json

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,50 @@
11
{
2-
"name": "graphviz-markdown-preview",
3-
"displayName": "Graphviz Markdown Preview",
4-
"description": "Adds Graphviz support to VSCode's builtin markdown preview",
5-
"version": "0.0.6",
6-
"publisher": "geeklearningio",
7-
"engines": {
8-
"vscode": "^1.20.0"
9-
},
10-
"preview": true,
11-
"categories": [
12-
"Other"
2+
"name": "graphviz-markdown-preview",
3+
"displayName": "Graphviz Markdown Preview",
4+
"description": "Adds Graphviz support to VSCode's builtin markdown preview",
5+
"version": "0.0.6",
6+
"publisher": "geeklearningio",
7+
"engines": {
8+
"vscode": "^1.20.0"
9+
},
10+
"preview": true,
11+
"categories": [
12+
"Other"
13+
],
14+
"activationEvents": [
15+
"onCommand:extension.sayHello"
16+
],
17+
"main": "./out/extension",
18+
"contributes": {
19+
"markdown.previewStyles": [
20+
"./graphviz.css"
1321
],
14-
"activationEvents": [
15-
"onCommand:extension.sayHello"
22+
"markdown.previewScripts": [
23+
"./node_modules/viz.js/viz.js",
24+
"./node_modules/viz.js/full.render.js",
25+
"./graphviz-render.js"
1626
],
17-
"main": "./out/extension",
18-
"contributes": {
19-
"markdown.previewStyles": [
20-
"./graphviz.css"
21-
],
22-
"markdown.previewScripts": [
23-
"./node_modules/viz.js/viz.js",
24-
"./graphviz-render.js"
25-
],
26-
"markdown.markdownItPlugins": true
27-
},
28-
"scripts": {
29-
"vscode:prepublish": "npm run compile",
30-
"compile": "tsc -p ./",
31-
"watch": "tsc -watch -p ./",
32-
"postinstall": "node ./node_modules/vscode/bin/install",
33-
"test": "npm run compile && node ./node_modules/vscode/bin/test"
34-
},
35-
"devDependencies": {
36-
"@types/mocha": "^2.2.42",
37-
"@types/node": "^7.0.43",
38-
"typescript": "^2.6.1",
39-
"vscode": "^1.1.6"
40-
},
41-
"dependencies": {
42-
"viz.js": "^1.8.0"
43-
},
44-
"repository": {
45-
"type": "git",
46-
"url": "https://github.com/geeklearningio/graphviz-markdown-preview.git"
47-
},
48-
"icon": "graphviz-logo.png"
27+
"markdown.markdownItPlugins": true
28+
},
29+
"scripts": {
30+
"vscode:prepublish": "npm run compile",
31+
"compile": "tsc -p ./",
32+
"watch": "tsc -watch -p ./",
33+
"postinstall": "node ./node_modules/vscode/bin/install",
34+
"test": "npm run compile && node ./node_modules/vscode/bin/test"
35+
},
36+
"devDependencies": {
37+
"@types/mocha": "^2.2.42",
38+
"@types/node": "^7.0.43",
39+
"typescript": "^3.5.2",
40+
"vscode": "^1.1.35"
41+
},
42+
"dependencies": {
43+
"viz.js": "^2.1.2"
44+
},
45+
"repository": {
46+
"type": "git",
47+
"url": "https://github.com/geeklearningio/graphviz-markdown-preview.git"
48+
},
49+
"icon": "graphviz-logo.png"
4950
}

0 commit comments

Comments
 (0)