summaryrefslogtreecommitdiff
path: root/fnl/plugins/snippets/workflow.fnl
blob: 435cf9057cc60442631ec530fa16aed3b9006be9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(λ workflow-snippets []
  (let [ls (require :luasnip)
        fmt (require :luasnip.extras.fmt)]
    (let [s ls.s
          i ls.insert_node
          fmt fmt.fmt]
      [(s :wf (fmt "workflow \"{}\" =
  input: {}
  output (on success):
    {}  
  output (on error):
    {}

  // step {}
  do {}
  {}
    " [(i 1) (i 2) (i 3) (i 4) (i 5) (i 6) (i 7)]))
       (s :st (fmt "
// step {}
do {}
If {}:
  {}

                                     "
                   [(i 1) (i 2) (i 3) (i 4)]))
       (s :ss (fmt "
substep \"{}\" =
  input: {}
  output: {}
  dependencies: {}

  {}
                                     "
                   [(i 1) (i 2) (i 3) (i 4) (i 5)]))])))

(λ add-snippets []
  (let [ls (require :luasnip)
        snippets (workflow-snippets)]
    (ls.add_snippets :org snippets)
    (ls.add_snippets :markdown snippets)))

{: add-snippets}