Skip to content

Commit

Permalink
Docs: Add diagram of processing pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-si committed Feb 3, 2024
1 parent 6ff0abf commit 0bf9fac
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 1 deletion.
6 changes: 5 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ help: makefile


.PHONY: build
build: cli-spec.json
build: cli-spec.json processing-pipeline.svg


cli-spec.json: oclis-contract.ncl oclis.ncl
echo '(import "oclis-contract.ncl") & (import "oclis.ncl")' \
| nickel export --format json > $@


processing-pipeline.svg: processing-pipeline.dot
dot -T svg -o $@ $<
55 changes: 55 additions & 0 deletions processing-pipeline.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
digraph ProcessingPipeline {
graph [size="6"];
splines=ortho;

edge[fontname="Sans-Serif"]
node[style=filled, fillcolor=gray90]

node[fontname="Monospace"]
tokens [label="[Token]", shape="parallelogram"]
args [label="[Argument]", shape="parallelogram"]

node[fontname="Sans-Serif"]
in [label="CLI Input", shape="parallelogram"]
refine [label="Refine", shape="rectangle"]
exec [label="Execute", shape="rectangle"]
out [label="Output", shape="parallelogram"]
clispec [
shape="cylinder",
label=<
<br/>
CLI Spec<br/>
<br/>
<font point-size="10"> Provided by the user </font>
>
]
mapping [
shape="cylinder",
label=<
<br/>
Argument<br/>
↓<br/>
Function<br/>
<br/>
<font point-size="10"> Provided by the user </font>
>
]

in -> tokens [label=" Tokenize "]
tokens -> refine
clispec -> refine
refine -> args
args -> exec
mapping -> exec
exec -> out

// Align clispec node to the right of refine and on the same level
refine -> clispec [style=invis]
clispec -> tokens [style=invis]
subgraph { rank=same; refine; clispec; }

// Align mapping node to the right of exec and on the same level
exec -> mapping [style=invis]
mapping -> args [style=invis]
subgraph { rank=same; exec; mapping; }
}
114 changes: 114 additions & 0 deletions processing-pipeline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ But fear not, Oclis is here to help you out!
4. Done 🎉


## How It Works

### Processing Pipeline

![Processing Pipeline](./processing-pipeline.svg)


## Related

### Tools
Expand Down

0 comments on commit 0bf9fac

Please sign in to comment.