-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgenerate_hierarchy_examples.sh
More file actions
executable file
·63 lines (53 loc) · 2.06 KB
/
generate_hierarchy_examples.sh
File metadata and controls
executable file
·63 lines (53 loc) · 2.06 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/zsh
print_variants() {
echo "\n## $1"
ENVELOPE=`eval $2`
echo "\n**Envelope CLI Command Line**\n"
echo "~~~"
echo $2
echo "~~~"
echo "\n**Envelope Notation**\n"
echo "~~~"
envelope --envelope $ENVELOPE
echo "~~~"
echo "\n**Tree**\n"
echo "~~~"
envelope --tree $ENVELOPE
echo "~~~"
# echo "\n**Mermaid**\n"
# MERMAID=`envelope --mermaid --theme monochrome $ENVELOPE`
# FILENAME=${1:l}
# FILENAME=${FILENAME// /_}
# MERMAID_FILENAME=images/mermaid/$FILENAME.mermaid
# echo ${MERMAID} > ${MERMAID_FILENAME}
# PDF_FILENAME=images/pdf/$FILENAME.pdf
# mmdc --input ${MERMAID_FILENAME} \
# --output ${PDF_FILENAME} \
# --outputFormat pdf \
# --configFile mermaid_config.json \
# > /dev/null
# echo "~~~"
# echo $MERMAID
# echo "~~~"
# echo "<artwork type=\"svg\" src=\"images/svg-validated/$FILENAME.svg\"/>"
echo "\n**CBOR Diagnostic Notation**\n"
echo "~~~"
envelope --diag $ENVELOPE
echo "~~~"
echo "\n**CBOR Hex**\n"
echo "~~~"
envelope --cbor $ENVELOPE
echo "~~~"
}
# print_variants "Example" 'envelope subject "Alice" | envelope assertion "knows" "Bob" | envelope assertion "knows" "Carol" | envelope assertion "knows" "Edward"'
print_variants "Leaf Case" 'envelope subject "Alice"'
# print_variants "Known Value Case" 'envelope subject --known isA'
# print_variants "Encrypted Case" 'envelope subject "Alice" | envelope encrypt --key `envelope generate key`'
# print_variants "Compressed Case" 'envelope subject "Alice" | envelope compress'
print_variants "Elided Case" 'envelope subject "Alice" | envelope elide'
print_variants "Node Case" 'envelope subject "Alice" | envelope assertion "knows" "Bob"'
print_variants "Assertion Case" 'envelope subject assertion "knows" "Bob"'
print_variants "Wrapped Case" 'envelope subject "Alice" | envelope subject --wrapped'
# The next steps to prepare the Mermaid files need to be performed in Illustrator.
# See `preparing_mermaid.md`.
# After that's done, run `postprocess_mermaid.sh`