Skip to content

Commit

Permalink
Add vega cdn source of local.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuix committed Dec 1, 2019
1 parent 212742f commit 215b368
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ A function to add or update extensions of showdown.convertor.
Type: (cdnname: string, defSheme: string, distScheme: string) => void

A function to set cdn source when dynamically load js lib files related to more showdown diagrams extension.
- Parameter cdnname can be selected 'local' or 'cdnjs' source.

- Parameter cdnname can be selected 'local' or 'cdnjs' or 'jsdelivr' source.
- Parameter defSheme is default prefix scheme string of source url.
- Parameter distScheme is dist prefix scheme string of source url that has prefix string is '../dist/'.

Expand All @@ -232,9 +233,10 @@ A function to set cdn source when dynamically load js lib files related to more
Type: (mermaidTheme: string, vegaTheme: string) => showdonws

A function to init that be created showdown.convertor instance for showdowns.

- Parameter mermaidTheme is mermaid theme name be selected in ['default', 'forest', 'dark', 'neutral'];When mermaidTheme set empty, mermaidTheme is set to 'default' theme name.
- Parameter vegaTheme is vega theme name be selected in ['excel', 'ggplot2', 'quartz', 'vox', 'dark'];
When vegaTheme set empty, vegaTheme is set to 'vox' theme name.
When vegaTheme set empty, vegaTheme is set to 'vox' theme name.

#### makeHtml

Expand Down
2 changes: 1 addition & 1 deletion docs/dist/showdowns.br.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/showdowns.br.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/showdowns.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/showdowns.min.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/showdowns-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,16 @@ The \<theme name> of json "theme" field value in syntax language attribute is "h

#### Network Sequence example

Sequence example with hand theme:

```sequence {"theme":"hand"}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
```

Sequence example with simple theme:

```sequence {"theme":"simple"}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Expand All @@ -262,6 +266,8 @@ The \<engine name> of json "engine" field value in syntax language attribute is

#### Graphviz's dot example

Dot example with dot engine:

```dot {"engine":"dot"}
digraph G {
main -> parse -> execute;
Expand All @@ -275,6 +281,8 @@ digraph G {
}
```

Dot example with circo engine:

```dot {"engine":"circo"}
digraph G {
main -> parse -> execute;
Expand Down Expand Up @@ -367,6 +375,8 @@ OR

#### Vega and Vega-Lite example

Vega example:

```vega
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
Expand Down Expand Up @@ -457,6 +467,8 @@ OR
}
```

Vega-Lite example:

```vega-lite
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
Expand Down
12 changes: 12 additions & 0 deletions public/showdowns-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,16 @@ The \<theme name> of json "theme" field value in syntax language attribute is "h

#### Network Sequence example

Sequence example with hand theme:

```sequence {"theme":"hand"}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
```

Sequence example with simple theme:

```sequence {"theme":"simple"}
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Expand All @@ -262,6 +266,8 @@ The \<engine name> of json "engine" field value in syntax language attribute is

#### Graphviz's dot example

Dot example with dot engine:

```dot {"engine":"dot"}
digraph G {
main -> parse -> execute;
Expand All @@ -275,6 +281,8 @@ digraph G {
}
```

Dot example with circo engine:

```dot {"engine":"circo"}
digraph G {
main -> parse -> execute;
Expand Down Expand Up @@ -367,6 +375,8 @@ OR

#### Vega and Vega-Lite example

Vega example:

```vega
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
Expand Down Expand Up @@ -457,6 +467,8 @@ OR
}
```

Vega-Lite example:

```vega-lite
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
Expand Down
5 changes: 4 additions & 1 deletion src/extensions/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const cdnSrc = {
default: '../node_modules/wavedrom/skins/default.js',
lowkey: '../node_modules/wavedrom/skins/lowkey.js',
narrow: '../node_modules/wavedrom/skins/narrow.js'
}
},
vega: '../node_modules/vega/build/vega.min.js',
vegaLite: '../node_modules/vega-lite/build/vega-lite.min.js',
vegaEmbed: '../node_modules/vega-embed/build/vega-embed.min.js'
},
cdnjs: {
Viz: scheme + 'cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/viz.js',
Expand Down

0 comments on commit 215b368

Please sign in to comment.