diff --git a/docs/examples.typ b/docs/examples.typ index a37ab85..e328c13 100644 --- a/docs/examples.typ +++ b/docs/examples.typ @@ -1,5 +1,18 @@ #import "example.typ": example +#let seq-return = example(``` +_seq( + "Bob", "Alice", + comment: [hello], + enable-dst: true +) +_seq( + "Alice", "Alice", + comment: [some action] +) +_ret(comment: [bye]) +```) + #let seq-comm-align = example(``` _par("p1", display-name: "Start participant") _par("p2", display-name: "End participant") @@ -121,15 +134,58 @@ _sync({ }) ```) -#let gaps-seps = example(``` -_par("alice", display-name: "Alice") -_par("bob", display-name: "Bob") +#let gaps = example(``` +_par("a", display-name: "Alice") +_par("b", display-name: "Bob") -_seq("alice", "bob", comment: "Hello") -_gap(size: 10) -_seq("bob", "alice", comment: "Hi") -_sep("Another day") -_seq("alice", "bob", comment: "Hello again") +_seq("a", "b", comment: [message 1]) +_seq("b", "a", comment: [ok], dashed: true) +_gap() +_seq("a", "b", comment: [message 2]) +_seq("b", "a", comment: [ok], dashed: true) +_gap(size: 40) +_seq("a", "b", comment: [message 3]) +_seq("b", "a", comment: [ok], dashed: true) +```) + +#let seps = example(``` +_par("a", display-name: "Alice") +_par("b", display-name: "Bob") + +_sep[Initialization] +_seq("a", "b", comment: [Request 1]) +_seq( + "b", "a", + comment: [Response 1], + dashed: true +) + +_sep[Repetition] +_seq("a", "b", comment: [Request 2]) +_seq( + "b", "a", + comment: [Response 2], + dashed: true +) +```) + +#let delays = example(``` +_par("a", display-name: "Alice") +_par("b", display-name: "Bob") + +_seq("a", "b", comment: [Auth Request]) +_delay() +_seq( + "b", "a", + comment: [Auth Response], + dashed: true +) +_delay(name: [5 minutes later]) +_seq( + "b", "a", + comment: [Good Bye !], + dashed: true +) ```) #let notes-shapes = example(``` diff --git a/docs/gaps_seps.typ b/docs/gaps_seps.typ index d569ab9..678a6f3 100644 --- a/docs/gaps_seps.typ +++ b/docs/gaps_seps.typ @@ -1,8 +1,15 @@ -/// Creates a gap before the next element -/// - size (int): Size of the gap -#let _gap(size: 20) = {} - /// Creates a separator before the next element -/// #examples.gaps-seps +/// #examples.seps /// - name (content): Name to display in the middle of the separator -#let _sep(name) = {} \ No newline at end of file +#let _sep(name) = {} + +/// Creates a delay before the next element +/// #examples.delays +/// - name (content, none): Name to display in the middle of the delay area +/// - size (int): Size of the delay +#let _delay(name: none, size: 30) = {} + +/// Creates a gap before the next element +/// #examples.gaps +/// - size (int): Size of the gap +#let _gap(size: 20) = {} \ No newline at end of file diff --git a/docs/sequences.typ b/docs/sequences.typ index e9be9a6..cc5fc1d 100644 --- a/docs/sequences.typ +++ b/docs/sequences.typ @@ -42,6 +42,17 @@ slant: none ) = {} +/// Creates a return sequence +/// #examples.seq-return +/// - comment (none, content): Optional comment to display along the arrow +#let _ret(comment: none) = {} + +/// Accepted values for `comment-align` argument of @@_seq() +/// #examples.seq-comm-align +#let comment-align = ( + "start", "end", "left", "center", "right" +) + /// Accepted values for `event` argument of @@_evt() /// /// `EVENTS = ("create", "destroy", "enable", "disable")` @@ -51,10 +62,4 @@ /// #examples.seq-tips #let tips = ( "", ">", ">>", "\\", "\\\\", "/", "//", "x", "o", -) - -/// Accepted values for `comment-align` argument of @@_seq() -/// #examples.seq-comm-align -#let comment-align = ( - "start", "end", "left", "center", "right" ) \ No newline at end of file diff --git a/manual.pdf b/manual.pdf index dca8906..e960f9f 100644 Binary files a/manual.pdf and b/manual.pdf differ diff --git a/manual.typ b/manual.typ index 69e96c7..86a7303 100644 --- a/manual.typ +++ b/manual.typ @@ -197,7 +197,7 @@ chronos.diagram({ examples: examples ) ) -#tidy.show-module(gap-sep-docs, show-outline: false) +#tidy.show-module(gap-sep-docs, show-outline: false, sort-functions: none) #pagebreak(weak: true)