aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorArun Isaac2021-11-05 12:10:06 +0530
committerArun Isaac2021-11-05 16:20:27 +0530
commit4bea0b85e1992a01dd36d32c8b2c68a497c6d001 (patch)
tree94e81feea6d0ebe90e3b0069e188c9bf42c7c1d2 /doc
parentef62659838c6b5c0e7245aa434e07b89e3a603b9 (diff)
downloadccwl-4bea0b85e1992a01dd36d32c8b2c68a497c6d001.tar.gz
ccwl-4bea0b85e1992a01dd36d32c8b2c68a497c6d001.tar.lz
ccwl-4bea0b85e1992a01dd36d32c8b2c68a497c6d001.zip
doc: Document reuse of external CWL workflows.
* doc/ccwl.skb (Cookbook): New chapter. * doc/external-cwl-workflow.scm, doc/echo.cwl: New files. * .gitignore: Add !doc/echo.cwl.
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)))