Skip to content

Commit 09bdc60

Browse files
committed
Add sphinx, myst, and the theme used in pandas docs
1 parent d8d3fc0 commit 09bdc60

File tree

119 files changed

+902
-8772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+902
-8772
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ _site
1010
.Rhistory
1111
.RData
1212

13+
_build/

_episodes/01-introduction.md renamed to 01-introduction/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
title: "Introduction"
32
teaching: 0
43
exercises: 0
54
questions:
@@ -14,6 +13,8 @@ keypoints:
1413
- "Descriptions in CWL aid portability between environments"
1514
---
1615

16+
# Introduction
17+
1718
CWL is a way to describe command line tools and connect them together to create
1819
workflows. Because CWL is a specification and not a specific piece of
1920
software, tools and workflows described using CWL are portable across a variety
@@ -29,4 +30,5 @@ vendors. CWL is well suited for describing large-scale workflows in cluster,
2930
cloud and high performance computing environments where tasks are scheduled in
3031
parallel across many nodes.
3132

32-
{% include links.md %}
33+
```{include} ../_includes/links.md
34+
```
Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
title: "First Example"
32
teaching: 5
43
exercises: 0
54
questions:
@@ -13,35 +12,38 @@ keypoints:
1312
- "Input values are specified in a separate YAML file."
1413
- "The tool description and input files are provided as arguments to a CWL runner."
1514
---
15+
16+
# First Example
17+
1618
The simplest "hello world" program. This accepts one input parameter, writes a message to the terminal or job log, and produces
1719
no permanent output.
1820
CWL documents are written in [JSON][json] or [YAML][yaml], or a mix of the two.
1921
We will use YAML throughout this guide.
2022
If you are not familiar with YAML,
2123
you may find it helpful to refer to
22-
[this quick tutorial for the subset of YAML used in CWL]({{ page.root }}{% link _extras/yaml.md %}).
24+
[this quick tutorial for the subset of YAML used in CWL](/yaml/index.md).
2325

2426
First, create a file called `1st-tool.cwl`, containing the boxed text below. It will help you to use a text editor that can be
2527
specified to produce text in YAML or JSON. Whatever text editor you use, the indents you see should not be created using tabs.
2628

2729
*1st-tool.cwl*
28-
~~~
29-
{% include cwl/02-1st-example/1st-tool.cwl %}
30-
~~~
31-
{: .source}
30+
31+
```{literalinclude} /_includes/cwl/02-1st-example/1st-tool.cwl
32+
:language: yaml
33+
```
3234

3335
Next, create a file called `echo-job.yml`, containing the following boxed text, which will describe the input of a run:
3436

3537
*echo-job.yml*
36-
~~~
37-
{% include cwl/02-1st-example/echo-job.yml %}
38-
~~~
39-
{: .source}
38+
39+
```{literalinclude} /_includes/cwl/02-1st-example/echo-job.yml
40+
:language: yaml
41+
```
4042

4143
Now, invoke `cwl-runner` with the tool wrapper `1st-tool.cwl` and the input object echo-job.yml on the command line. The command
4244
is `cwl-runner 1st-tool.cwl echo-job.yml`. The boxed text below shows this command and the expected output.
4345

44-
~~~
46+
```bash
4547
$ cwl-runner 1st-tool.cwl echo-job.yml
4648
[job 1st-tool.cwl] /tmp/tmpmM5S_1$ echo \
4749
'Hello world!'
@@ -50,43 +52,39 @@ Hello world!
5052
{}
5153
Final process status is success
5254

53-
~~~
54-
{: .output}
55+
```
5556

5657
The command `cwl-runner 1st-tool.cwl echo-job.yml` is an example of a general form that you will often come across while using
5758
CWL. The general form is `cwl-runner [tool-or-workflow-description] [input-job-settings]`
5859

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

61-
~~~
62+
```yaml
6263
cwlVersion: v1.0
6364
class: CommandLineTool
64-
~~~
65-
{: .source}
65+
```
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-
~~~
70+
```yaml
7171
baseCommand: echo
72-
~~~
73-
{: .source}
72+
```
7473

7574
The `baseCommand` provides the name of program that will actually run (`echo`). `echo` is a built-in program in the bash and
7675
C shells.
7776

78-
~~~
77+
```yaml
7978
inputs:
8079
message:
8180
type: string
8281
inputBinding:
8382
position: 1
84-
~~~
85-
{: .source}
83+
```
8684

8785
The `inputs` section describes the inputs of the tool.
8886
This is a mapped list of input parameters
89-
(see the [YAML Guide]({{ page.root }}{% link _extras/yaml.md %}#maps) for more about the format)
87+
(see the [YAML Guide](/yaml/index.md) for more about the format)
9088
and each parameter includes an identifier,
9189
a data type,
9290
and optionally an `inputBinding`.
@@ -95,13 +93,13 @@ on the command line.
9593
In this example,
9694
the `position` field indicates where it should appear on the command line.
9795

98-
~~~
96+
```yaml
9997
outputs: []
100-
~~~
101-
{: .source}
98+
```
10299

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

105102
[echo]: http://www.linfo.org/echo.html
106103

107-
{% include links.md %}
104+
```{include} ../_includes/links.md
105+
```

_episodes/03-input.md renamed to 03-input/index.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
title: "Essential Input Parameters"
32
teaching: 10
43
exercises: 0
54
questions:
@@ -14,6 +13,8 @@ keypoints:
1413
appears in the command."
1514
---
1615

16+
# Essential Input Parameters
17+
1718
The `inputs` of a tool is a list of input parameters that control how to
1819
run the tool. Each parameter has an `id` for the name of parameter, and
1920
`type` describing what types of values are valid for that parameter.
@@ -30,19 +31,17 @@ First, create a file called inp.cwl, containing the following:
3031

3132
*inp.cwl*
3233

33-
~~~
34-
{% include cwl/03-input/inp.cwl %}
35-
~~~
36-
{: .source}
34+
```{literalinclude} /_includes/cwl/03-input/inp.cwl
35+
:language: yaml
36+
```
3737

3838
Create a file called inp-job.yml:
3939

4040
*inp-job.yml*
4141

42-
~~~
43-
{% include cwl/03-input/inp-job.yml %}
44-
~~~
45-
{: .source}
42+
```{literalinclude} /_includes/cwl/03-input/inp-job.yml
43+
:language: yaml
44+
```
4645

4746
Notice that "example_file", as a `File` type, must be provided as an
4847
object with the fields `class: File` and `path`.
@@ -63,14 +62,15 @@ $ cwl-runner inp.cwl inp-job.yml
6362
{}
6463
Final process status is success
6564
~~~
66-
{: .output}
67-
> ## Where did those `/tmp` paths come from?
65+
66+
```{note}
67+
> <p class="rubric">Where did those `/tmp` paths come from?</p>
6868
>
6969
> The CWL reference runner (cwltool) and other runners create temporary
7070
> directories with symbolic ("soft") links to your input files to ensure that
7171
> the tools aren't accidentally accessing files that were not explicitly
7272
> specified
73-
{: .callout}
73+
```
7474

7575
The field `inputBinding` is optional and indicates whether and how the
7676
input parameter should be appear on the tool's command line. If
@@ -84,7 +84,6 @@ example_flag:
8484
position: 1
8585
prefix: -f
8686
~~~
87-
{: .source}
8887

8988
Boolean types are treated as a flag. If the input parameter
9089
"example_flag" is "true", then `prefix` will be added to the
@@ -97,7 +96,6 @@ example_string:
9796
position: 3
9897
prefix: --example-string
9998
~~~
100-
{: .source}
10199

102100
String types appear on the command line as literal values. The `prefix`
103101
is optional, if provided, it appears as a separate argument on the
@@ -112,7 +110,6 @@ example_int:
112110
prefix: -i
113111
separate: false
114112
~~~
115-
{: .source}
116113

117114
Integer (and floating point) types appear on the command line with
118115
decimal text representation. When the option `separate` is false (the
@@ -128,7 +125,6 @@ example_file:
128125
separate: false
129126
position: 4
130127
~~~
131-
{: .source}
132128

133129
File types appear on the command line as the path to the file. When the
134130
parameter type ends with a question mark `?` it indicates that the
@@ -138,7 +134,7 @@ parameter were not provided in the input, nothing would appear on the
138134
command line.
139135

140136
Input files are read-only. If you wish to update an input file, you must
141-
[first copy it to the output directory]({{ page.root }}/15-staging/).
137+
[first copy it to the output directory](/15-staging/index.md).
142138

143139
The value of `position` is used to determine where parameter should
144140
appear on the command line. Positions are relative to one another, not
@@ -151,4 +147,5 @@ is optional. The default position is 0.
151147
The `baseCommand` field will always appear in the final command line before the parameters.
152148

153149
[touch]: http://www.linfo.org/touch.html
154-
{% include links.md %}
150+
```{include} ../_includes/links.md
151+
```

_episodes/04-output.md renamed to 04-output/index.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
title: "Returning Output Files"
32
teaching: 10
43
exercises: 0
54
questions:
@@ -13,6 +12,9 @@ keypoints:
1312
output parameter."
1413
- "Wildcards are allowed in the `glob` field."
1514
---
15+
16+
# Returning Output Files
17+
1618
The `outputs` of a tool is a list of output parameters that should be
1719
returned after running the tool. Each parameter has an `id` for the name
1820
of parameter, and `type` describing what types of values are valid for
@@ -26,26 +28,25 @@ themselves, or come from examining the content of those files.
2628

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

29-
> ## Passing mandatory arguments to the `baseCommand`
31+
```{note}
32+
> <p class="rubric">Passing mandatory arguments to the `baseCommand`</p>
3033
>
3134
> In previous examples, the `baseCommand` was just a string, with any arguments passed as CWL inputs.
3235
> Instead of a single string we can use an _array of strings_. The first element is the command to run, and
3336
> any subsequent elements are mandatory command line arguments
34-
{: .callout}
37+
```
3538

3639
*tar.cwl*
3740

38-
~~~
39-
{% include cwl/04-output/tar.cwl %}
40-
~~~
41-
{: .source}
41+
```{literalinclude} /_includes/cwl/04-output/tar.cwl
42+
:language: yaml
43+
```
4244

4345
*tar-job.yml*
4446

45-
~~~
46-
{% include cwl/04-output/tar-job.yml %}
47-
~~~
48-
{: .source}
47+
```{literalinclude} /_includes/cwl/04-output/tar-job.yml
48+
:language: yaml
49+
```
4950

5051
Next, create a tar file for the example and invoke `cwl-runner` with the tool
5152
wrapper and the input object on the command line:
@@ -69,7 +70,6 @@ $ cwl-runner tar.cwl tar-job.yml
6970
}
7071
Final process status is success
7172
~~~
72-
{: .output}
7373

7474
The field `outputBinding` describes how to set the value of each
7575
output parameter.
@@ -81,9 +81,9 @@ outputs:
8181
outputBinding:
8282
glob: hello.txt
8383
~~~
84-
{: .source}
8584

8685
The `glob` field consists of the name of a file in the output directory.
8786
If you don't know name of the file in advance, you can use a wildcard pattern like `glob: '*.txt'`.
8887

89-
{% include links.md %}
88+
```{include} ../_includes/links.md
89+
```

_episodes/05-stdout.md renamed to 05-stdout/index.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
title: "Capturing Standard Output"
32
teaching: 10
43
exercises: 0
54
questions:
@@ -10,23 +9,24 @@ keypoints:
109
- "Use the `stdout` field to specify a filename to capture streamed output."
1110
- "The corresponding output parameter must have `type: stdout`."
1211
---
12+
13+
# Capturing Standard Output
14+
1315
To capture a tool's standard output stream, add the `stdout` field with
1416
the name of the file where the output stream should go. Then add `type:
1517
stdout` on the corresponding output parameter.
1618

1719
*stdout.cwl*
1820

19-
~~~
20-
{% include cwl/05-stdout/stdout.cwl %}
21-
~~~
22-
{: .source}
21+
```{literalinclude} /_includes/cwl/05-stdout/stdout.cwl
22+
:language: yaml
23+
```
2324

2425
*echo-job.yml*
2526

26-
~~~
27-
{% include cwl/05-stdout/echo-job.yml %}
28-
~~~
29-
{: .source}
27+
```{literalinclude} /_includes/cwl/05-stdout/echo-job.yml
28+
:language: yaml
29+
```
3030

3131
Now invoke `cwl-runner` providing the tool wrapper and the input object
3232
on the command line:
@@ -49,5 +49,5 @@ $ cwl-runner stdout.cwl echo-job.yml
4949
Final process status is success
5050
5151
~~~
52-
{: .output}
53-
{% include links.md %}
52+
```{include} ../_includes/links.md
53+
```

0 commit comments

Comments
 (0)