Skip to content

Commit 9a2cbeb

Browse files
committed
Rewrite readme, update most dependencies, improve demo
1 parent d3e2416 commit 9a2cbeb

File tree

5 files changed

+2751
-4720
lines changed

5 files changed

+2751
-4720
lines changed

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
# Vue CWL
22
Vue CWL provides a Vue component for the visualization of CWL (Common Workflow Language) workflows.
33

4-
## Installation
5-
Install from `npm`:
4+
## Motivation
5+
6+
Vue CWL uses the fantastic [cwl-svg](https://github.com/rabix/cwl-svg) library behind the scenes, which you can also use directly.
7+
However, you might want to use Vue CWL because:
8+
9+
* You can use it directly in your HTML application, without setting up a compiler. You don't even need to use npm!
10+
* If you're using Vue elsewhere in your application, Vue CWL will be much easier to integrate.
11+
12+
## Installation (if using npm )
13+
Install from npm:
614

715
```bash
816
npm install vue-cwl --save-dev
@@ -14,11 +22,11 @@ Or, if you want the latest development version, install from github:
1422
npm install git+https://[email protected]/TMiguelT/vue-cwl.git --save-dev
1523
```
1624

17-
## Adding to Vue
25+
## Integration
1826
Vue CWL is exported as a UMD module, which means that you can either import it with a module loader,
1927
or import it directly in the browser.
2028

21-
If using webpack:
29+
If using webpack and npm:
2230

2331
```javascript
2432
import Vue from 'vue';
@@ -32,20 +40,30 @@ new Vue({
3240
})
3341
```
3442

35-
If using no bundler:
43+
You can now use the `<cwl>` tag in your template:
44+
```html
45+
<cwl
46+
cwl-url="https://unpkg.com/[email protected]/cwl-samples/fastqc.json"
47+
></cwl>
48+
```
49+
50+
If using no bundler, you can include Vue and Vue CWL using something like `unpkg`:
3651

3752
```html
38-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
39-
<script src="node_modules/vue-cwl/dist/index.js"></script>
53+
<div id="vue" style="width: 800px; height: 800px">
54+
<cwl
55+
cwl-url="https://unpkg.com/[email protected]/cwl-samples/fastqc.json"
56+
></cwl>
57+
</div>
58+
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
59+
<script src="https://unpkg.com/vue-cwl/dist/index.js"></script>
4060
<script>
41-
Vue.config.devtools = true;
42-
Vue.config.debug = true;
4361
new Vue({
4462
el: '#vue',
4563
components: {
4664
cwl: vueCwl.default
4765
}
48-
})
66+
});
4967
</script>
5068
```
5169

@@ -76,5 +94,5 @@ An online demo of Vue CWL is available at <https://tmiguelt.github.io/vue-cwl/in
7694
If you wish to build the demo yourself:
7795
* Clone the repo
7896
* Run `npm run demo`
79-
* Then browse to <http://localhost:8080/docs/> in your web browser (or whatever URL the command
97+
* Then browse to <http://localhost:8080/> in your web browser (or whatever URL the command
8098
prints out)

docs/index.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
<body>
44
<div id="vue" style="width: 800px; height: 800px">
55
<cwl
6-
cwl-url="https://rawgit.com/rabix/cwl-svg/master/cwl-samples/fastqc.json"
6+
cwl-url="https://unpkg.com/cwl-svg@2.1.5/cwl-samples/fastqc.json"
77
></cwl>
88
</div>
9-
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.13/dist/vue.js"></script>
10-
<script src="https://cdn.jsdelivr.net/npm/vue-cwl/dist/index.js"></script>
9+
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
10+
<script src="https://unpkg.com/vue-cwl/dist/index.js"></script>
1111
<script>
12-
Vue.config.devtools = true;
13-
Vue.config.debug = true;
1412
new Vue({
1513
el: '#vue',
1614
components: {
1715
cwl: vueCwl.default
1816
}
19-
})
17+
});
2018
</script>
2119
</body>
2220
</html>

0 commit comments

Comments
 (0)