Skip to content

Commit b329bb0

Browse files
committed
Fix reference links, use CWL syntax, use bash/yaml syntax too for pygments (syntax highlight)
1 parent 5b1af90 commit b329bb0

File tree

37 files changed

+271
-414
lines changed

37 files changed

+271
-414
lines changed

01-introduction/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ software, tools and workflows described using CWL are portable across a variety
2121
of platforms that support the CWL standard.
2222

2323
CWL has roots in "make" and many similar tools that determine order of
24-
execution based on dependencies between tasks. However unlike "make", CWL
24+
execution based on dependencies between tasks. However, unlike "make", CWL
2525
tasks are isolated and you must be explicit about your inputs and outputs. The
2626
benefit of explicitness and isolation are flexibility, portability, and
2727
scalability: tools and workflows described with CWL can transparently leverage
2828
technologies such as Docker and be used with CWL implementations from different
2929
vendors. CWL is well suited for describing large-scale workflows in cluster,
3030
cloud and high performance computing environments where tasks are scheduled in
3131
parallel across many nodes.
32-
33-
```{include} ../_includes/links.md
34-
```

02-1st-example/index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ specified to produce text in YAML or JSON. Whatever text editor you use, the ind
2929
*1st-tool.cwl*
3030

3131
```{literalinclude} /_includes/cwl/02-1st-example/1st-tool.cwl
32-
:language: yaml
32+
:language: cwl
3333
```
3434

3535
Next, create a file called `echo-job.yml`, containing the following boxed text, which will describe the input of a run:
@@ -59,15 +59,15 @@ CWL. The general form is `cwl-runner [tool-or-workflow-description] [input-job-s
5959

6060
What's going on here? Let's break down the contents of `1st-tool.cwl`:
6161

62-
```yaml
62+
```cwl
6363
cwlVersion: v1.0
6464
class: CommandLineTool
6565
```
6666

6767
The `cwlVersion` field indicates the version of the CWL spec used by the document. The `class` field indicates this document
6868
describes a command line tool.
6969

70-
```yaml
70+
```cwl
7171
baseCommand: echo
7272
```
7373

@@ -93,13 +93,12 @@ on the command line.
9393
In this example,
9494
the `position` field indicates where it should appear on the command line.
9595

96-
```yaml
96+
```cwl
9797
outputs: []
9898
```
9999

100100
This tool has no formal output, so the `outputs` section is an empty list.
101101

102102
[echo]: http://www.linfo.org/echo.html
103-
104-
```{include} ../_includes/links.md
105-
```
103+
[json]: http://json.org/
104+
[yaml]: http://yaml.org/

03-input/index.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ First, create a file called inp.cwl, containing the following:
3232
*inp.cwl*
3333

3434
```{literalinclude} /_includes/cwl/03-input/inp.cwl
35-
:language: yaml
35+
:language: cwl
3636
```
3737

3838
Create a file called inp-job.yml:
@@ -48,7 +48,7 @@ object with the fields `class: File` and `path`.
4848

4949
Next, create a whale.txt using [touch] by typing `touch whale.txt` on the command line and then invoke `cwl-runner` with the tool wrapper and the input object on the command line, using the command `cwl-runner inp.cwl inp-job.yml`. The following boxed text describes these two commands and the expected output from the command line:
5050

51-
~~~
51+
```bash
5252
$ touch whale.txt
5353
$ cwl-runner inp.cwl inp-job.yml
5454
[job inp.cwl] /tmp/tmpzrSnfX$ echo \
@@ -61,70 +61,70 @@ $ cwl-runner inp.cwl inp-job.yml
6161
[job inp.cwl] completed success
6262
{}
6363
Final process status is success
64-
~~~
65-
66-
```{note}
67-
> <p class="rubric">Where did those `/tmp` paths come from?</p>
68-
>
69-
> The CWL reference runner (cwltool) and other runners create temporary
70-
> directories with symbolic ("soft") links to your input files to ensure that
71-
> the tools aren't accidentally accessing files that were not explicitly
72-
> specified
64+
````
65+
66+
```{tip}
67+
## Where did those `/tmp` paths come from?
68+
69+
The CWL reference runner (cwltool) and other runners create temporary
70+
directories with symbolic ("soft") links to your input files to ensure that
71+
the tools aren't accidentally accessing files that were not explicitly
72+
specified
7373
```
7474
7575
The field `inputBinding` is optional and indicates whether and how the
76-
input parameter should be appear on the tool's command line. If
76+
input parameter should appear on the tool's command line. If
7777
`inputBinding` is missing, the parameter does not appear on the command
7878
line. Let's look at each example in detail.
7979
80-
~~~
80+
```cwl
8181
example_flag:
8282
type: boolean
8383
inputBinding:
8484
position: 1
8585
prefix: -f
86-
~~~
86+
```
8787
8888
Boolean types are treated as a flag. If the input parameter
8989
"example_flag" is "true", then `prefix` will be added to the
9090
command line. If false, no flag is added.
9191
92-
~~~
92+
```cwl
9393
example_string:
9494
type: string
9595
inputBinding:
9696
position: 3
9797
prefix: --example-string
98-
~~~
98+
```
9999
100100
String types appear on the command line as literal values. The `prefix`
101101
is optional, if provided, it appears as a separate argument on the
102102
command line before the parameter . In the example above, this is
103103
rendered as `--example-string hello`.
104104
105-
~~~
105+
```cwl
106106
example_int:
107107
type: int
108108
inputBinding:
109109
position: 2
110110
prefix: -i
111111
separate: false
112-
~~~
112+
```
113113
114114
Integer (and floating point) types appear on the command line with
115115
decimal text representation. When the option `separate` is false (the
116116
default value is true), the prefix and value are combined into a single
117117
argument. In the example above, this is rendered as `-i42`.
118118
119119
120-
~~~
120+
```cwl
121121
example_file:
122122
type: File?
123123
inputBinding:
124124
prefix: --file=
125125
separate: false
126126
position: 4
127-
~~~
127+
```
128128
129129
File types appear on the command line as the path to the file. When the
130130
parameter type ends with a question mark `?` it indicates that the
@@ -147,5 +147,3 @@ is optional. The default position is 0.
147147
The `baseCommand` field will always appear in the final command line before the parameters.
148148
149149
[touch]: http://www.linfo.org/touch.html
150-
```{include} ../_includes/links.md
151-
```

04-output/index.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ objectives:
88
- "Learn how to describe and handle outputs from a tool."
99
keypoints:
1010
- "Outputs are described in the `outputs` section of a CWL description."
11-
- "The field `outputBinding` describes how to to set the value of each
11+
- "The field `outputBinding` describes how to set the value of each
1212
output parameter."
1313
- "Wildcards are allowed in the `glob` field."
1414
---
@@ -28,18 +28,18 @@ themselves, or come from examining the content of those files.
2828

2929
The following example demonstrates how to return a file that has been extracted from a tar file.
3030

31-
```{note}
32-
> <p class="rubric">Passing mandatory arguments to the `baseCommand`</p>
33-
>
34-
> In previous examples, the `baseCommand` was just a string, with any arguments passed as CWL inputs.
35-
> Instead of a single string we can use an _array of strings_. The first element is the command to run, and
36-
> any subsequent elements are mandatory command line arguments
31+
```{tip}
32+
Passing mandatory arguments to the `baseCommand`
33+
34+
In previous examples, the `baseCommand` was just a string, with any arguments passed as CWL inputs.
35+
Instead of a single string we can use an _array of strings_. The first element is the command to run, and
36+
any subsequent elements are mandatory command line arguments
3737
```
3838

3939
*tar.cwl*
4040

4141
```{literalinclude} /_includes/cwl/04-output/tar.cwl
42-
:language: yaml
42+
:language: cwl
4343
```
4444

4545
*tar-job.yml*
@@ -51,7 +51,7 @@ The following example demonstrates how to return a file that has been extracted
5151
Next, create a tar file for the example and invoke `cwl-runner` with the tool
5252
wrapper and the input object on the command line:
5353

54-
~~~
54+
```bash
5555
$ touch hello.txt && tar -cvf hello.tar hello.txt
5656
$ cwl-runner tar.cwl tar-job.yml
5757
[job tar.cwl] /tmp/tmpqOeawQ$ tar \
@@ -69,21 +69,18 @@ $ cwl-runner tar.cwl tar-job.yml
6969
}
7070
}
7171
Final process status is success
72-
~~~
72+
```
7373

7474
The field `outputBinding` describes how to set the value of each
7575
output parameter.
7676

77-
~~~
77+
```cwl
7878
outputs:
7979
example_out:
8080
type: File
8181
outputBinding:
8282
glob: hello.txt
83-
~~~
83+
```
8484

8585
The `glob` field consists of the name of a file in the output directory.
8686
If you don't know name of the file in advance, you can use a wildcard pattern like `glob: '*.txt'`.
87-
88-
```{include} ../_includes/links.md
89-
```

05-stdout/index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stdout` on the corresponding output parameter.
1919
*stdout.cwl*
2020

2121
```{literalinclude} /_includes/cwl/05-stdout/stdout.cwl
22-
:language: yaml
22+
:language: cwl
2323
```
2424

2525
*echo-job.yml*
@@ -31,7 +31,7 @@ stdout` on the corresponding output parameter.
3131
Now invoke `cwl-runner` providing the tool wrapper and the input object
3232
on the command line:
3333

34-
~~~
34+
```bash
3535
$ cwl-runner stdout.cwl echo-job.yml
3636
[job stdout.cwl] /tmp/tmpE0gTz7$ echo \
3737
'Hello world!' > /tmp/tmpE0gTz7/output.txt
@@ -47,7 +47,4 @@ $ cwl-runner stdout.cwl echo-job.yml
4747
}
4848
}
4949
Final process status is success
50-
51-
~~~
52-
```{include} ../_includes/links.md
5350
```

0 commit comments

Comments
 (0)