Skip to content

Commit c46b53b

Browse files
user-guide: examples
* Document the major design patters for implementing Cylc workflows. * Along with cylc/cylc-flow#5773, this closes #627 * Add some functional examples for users to play with. * The aim is to help assist workflow writers by providing them with minimal templates to flush out.
1 parent 7f6a81f commit c46b53b

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ src/plugins/main-loop/built-in
2626
src/plugins/install/built-in
2727
src/user-guide/task-implementation/job-runner-handlers
2828
src/dictionaries/sentence_case
29+
src/user-guide/examples/*

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ cleanall:
5656
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
5757
# NOTE: EXPORT_ALL_VARIABLES exports make vars as env vars
5858
%: Makefile .EXPORT_ALL_VARIABLES
59+
bin/link-examples
5960
# build documentation
6061
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
6162
# write out dict of available versions and formats

bin/link-examples

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
# rm cylc-flow-examples || true
6+
examples="$(python -c 'import cylc.flow; from pathlib import Path; print(Path(cylc.flow.__file__).parent)')/etc/examples"
7+
for example in $(echo "${examples}/"*); do
8+
if [[ -d "${example}" ]]; then
9+
target="src/user-guide/examples/$(basename "${example}")"
10+
rm "${target}" || true
11+
ln -s "${example}" "${target}"
12+
fi
13+
done
14+

src/user-guide/examples/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Examples
2+
========
3+
4+
These examples cover some of the main patterns for implementing Cylc workflows.
5+
6+
.. toctree::
7+
:glob:
8+
9+
*/index

src/user-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ User Guide
66
:maxdepth: 2
77

88
introduction
9+
examples/index
910
writing-workflows/index
1011
installing-workflows
1112
running-workflows/index

0 commit comments

Comments
 (0)