summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/ccwl.skb16
-rw-r--r--doc/echo.cwl12
-rw-r--r--doc/external-cwl-workflow.scm12
3 files changed, 40 insertions, 0 deletions
diff --git a/doc/ccwl.skb b/doc/ccwl.skb
index 57fa225..c460ab4 100644
--- a/doc/ccwl.skb
+++ b/doc/ccwl.skb
@@ -249,6 +249,22 @@ following output.])
,(file "d2f19c786fcd3feb329004c8747803fba581a02d") and
,(file "0d2eaa5619c14b43326101200d0f27b0d8a1a4b1") respectively.]))))
+ (chapter :title [Cookbook]
+ (section :title [Reuse external CWL workflows]
+ (p [Even though you may be a ccwl convert (hurrah!), others may
+not be. And, you might have to work with CWL workflows written by
+others. ccwl permits easy reuse of external CWL workflows, and free
+mixing with ccwl commands. Here is a workflow to find the string
+length of a message, where one of the commands, ,(code "echo"), is
+defined as an external CWL workflow. External CWL workflows are
+referenced in ccwl using ,(code "cwl-workflow"). The identifiers and
+types of the inputs/outputs are read from the YAML specification of
+the external CWL workflow.]
+ (scheme-source "doc/external-cwl-workflow.scm")
+ [,(file "echo.cwl") is defined as]
+ ;; TODO: Syntax highlight doc/external-cwl-workflow.cwl.
+ (prog :line #f (source :file "doc/echo.cwl")))))
+
(chapter :title [Contributing]
(p [ccwl is developed on GitHub at ,(ref
:url "https://github.com/arunisaac/ccwl"). Feedback, suggestions,
diff --git a/doc/echo.cwl b/doc/echo.cwl
new file mode 100644
index 0000000..6ecd530
--- /dev/null
+++ b/doc/echo.cwl
@@ -0,0 +1,12 @@
+cwlVersion: v1.2
+class: CommandLineTool
+baseCommand: echo
+arguments: ["-n"]
+inputs:
+ message:
+ type: string
+ inputBinding:
+ position: 1
+outputs:
+ output:
+ type: stdout
diff --git a/doc/external-cwl-workflow.scm b/doc/external-cwl-workflow.scm
new file mode 100644
index 0000000..36c3172
--- /dev/null
+++ b/doc/external-cwl-workflow.scm
@@ -0,0 +1,12 @@
+(define echo
+ (cwl-workflow "echo.cwl"))
+
+(define string-length
+ (command #:inputs file
+ #:run "wc" "--chars"
+ #:outputs (length #:type stdout)
+ #:stdin file))
+
+(workflow ((message #:type string))
+ (pipe (echo #:message message)
+ (string-length #:file output)))