diff --git a/manual.pdf b/manual.pdf index 8ba1aa8..14a0033 100644 Binary files a/manual.pdf and b/manual.pdf differ diff --git a/manual.typ b/manual.typ index 4c5fb76..11ae7d2 100644 --- a/manual.typ +++ b/manual.typ @@ -14,7 +14,7 @@ #{ outline(indent: true, depth: 3) } -#set page(numbering: "1/1", header: align(right)[circuiteria #sym.dash.em v#lib.version]) + #show link: set text(blue) #show heading.where(level: 3): it => context { let cnt = counter(heading) @@ -45,6 +45,44 @@ ] } +#set page(numbering: "1/1", header: align(right)[circuiteria #sym.dash.em v#lib.version]) +#set page( + header: locate(loc => { + let txt = [circuiteria #sym.dash.em v#lib.version] + let cnt = counter(heading) + let cnt-val = cnt.get() + if cnt-val.len() < 2 { + align(left, txt) + return + } + let i = cnt-val.at(1) - 1 + grid( + columns: (auto, 1fr), + column-gutter: 1em, + align: horizon, + txt, + place(horizon + left)[ + #rect(width: 100%, height: .5em, radius: .25em, stroke: none, fill: util.colors.values().at(i)) + ] + ) + }), + footer: locate(loc => { + let cnt = counter(heading) + let cnt-val = cnt.get() + if cnt-val.len() < 2 { return } + let i = cnt-val.at(1) - 1 + grid( + columns: (1fr, auto), + column-gutter: 1em, + align: horizon, + place(horizon + left)[ + #rect(width: 100%, height: .5em, radius: .25em, stroke: none, fill: util.colors.values().at(i)) + ], + counter(page).display("1/1", both: true) + ) + }) +) + #let doc-ref(target, full: false, var: false) = { let (module, func) = target.split(".") let label-name = module + func @@ -122,7 +160,6 @@ Simply import #link("src/lib.typ") and call the `circuit` function: read("src/elements/extender.typ") + "\n" + read("src/elements/multiplexer.typ"), name: "element", - require-all-parameters: true, scope: ( element: element, circuit: circuit, @@ -136,6 +173,8 @@ Simply import #link("src/lib.typ") and call the `circuit` function: #tidy.show-module(element-docs, sort-functions: false) +#pagebreak() + #let gates-docs = tidy.parse-module( read("src/elements/logic/gate.typ") + "\n" + read("src/elements/logic/and.typ") + "\n" + @@ -143,7 +182,6 @@ Simply import #link("src/lib.typ") and call the `circuit` function: read("src/elements/logic/or.typ") + "\n" + read("src/elements/logic/xor.typ"), name: "gates", - require-all-parameters: false, scope: ( element: element, circuit: circuit, diff --git a/src/elements/alu.typ b/src/elements/alu.typ index 1c09ce9..1c1ddd8 100644 --- a/src/elements/alu.typ +++ b/src/elements/alu.typ @@ -40,16 +40,7 @@ /// Draws an ALU with two inputs /// /// #examples.alu -/// - x (number, dictionary): see #doc-ref("element.elmt") -/// - y (number, dictionary): see #doc-ref("element.elmt") -/// - w (number): see #doc-ref("element.elmt") -/// - h (number): see #doc-ref("element.elmt") -/// - name (none, str): see #doc-ref("element.elmt") -/// - name-anchor (str): see #doc-ref("element.elmt") -/// - fill (none, color): see #doc-ref("element.elmt") -/// - stroke (stroke): see #doc-ref("element.elmt") -/// - id (str): see #doc-ref("element.elmt") -/// - debug (dictionary): see #doc-ref("element.elmt") +/// For parameters description, see #doc-ref("element.elmt") #let alu( x: none, y: none, diff --git a/src/elements/block.typ b/src/elements/block.typ index 31bda9e..90f81d4 100644 --- a/src/elements/block.typ +++ b/src/elements/block.typ @@ -16,18 +16,7 @@ /// Draws a block element /// /// #examples.block -/// - x (number, dictionary): see #doc-ref("element.elmt") -/// - y (number, dictionary): see #doc-ref("element.elmt") -/// - w (number): see #doc-ref("element.elmt") -/// - h (number): see #doc-ref("element.elmt") -/// - name (none, str): see #doc-ref("element.elmt") -/// - name-anchor (str): see #doc-ref("element.elmt") -/// - ports (dictionary): see #doc-ref("element.elmt") -/// - ports-margins (dictionary): see #doc-ref("element.elmt") -/// - fill (none, color): see #doc-ref("element.elmt") -/// - stroke (stroke): see #doc-ref("element.elmt") -/// - id (str): see #doc-ref("element.elmt") -/// - debug (dictionary): see #doc-ref("element.elmt") +/// For parameters description, see #doc-ref("element.elmt") #let block( x: none, y: none, diff --git a/src/elements/extender.typ b/src/elements/extender.typ index 86a86c9..3c66061 100644 --- a/src/elements/extender.typ +++ b/src/elements/extender.typ @@ -28,16 +28,7 @@ /// Draws a bit extender /// /// #examples.extender -/// - x (number, dictionary): see #doc-ref("element.elmt") -/// - y (number, dictionary): see #doc-ref("element.elmt") -/// - w (number): see #doc-ref("element.elmt") -/// - h (number): see #doc-ref("element.elmt") -/// - name (none, str): see #doc-ref("element.elmt") -/// - name-anchor (str): see #doc-ref("element.elmt") -/// - fill (none, color): see #doc-ref("element.elmt") -/// - stroke (stroke): see #doc-ref("element.elmt") -/// - id (str): see #doc-ref("element.elmt") -/// - debug (dictionary): see #doc-ref("element.elmt") +/// For parameters description, see #doc-ref("element.elmt") #let extender( x: none, y: none, diff --git a/src/elements/multiplexer.typ b/src/elements/multiplexer.typ index c0da305..a01e9cb 100644 --- a/src/elements/multiplexer.typ +++ b/src/elements/multiplexer.typ @@ -24,17 +24,8 @@ /// Draws a multiplexer /// /// #examples.multiplexer -/// - x (number, dictionary): see #doc-ref("element.elmt") -/// - y (number, dictionary): see #doc-ref("element.elmt") -/// - w (number): see #doc-ref("element.elmt") -/// - h (number): see #doc-ref("element.elmt") -/// - name (none, str): see #doc-ref("element.elmt") -/// - name-anchor (str): see #doc-ref("element.elmt") +/// For other parameters description, see #doc-ref("element.elmt") /// - entries (int, array): If it is an integer, it defines the number of input ports (automatically named with their binary index). If it is an array of strings, it defines the name of each input. -/// - fill (none, color): see #doc-ref("element.elmt") -/// - stroke (stroke): see #doc-ref("element.elmt") -/// - id (str): see #doc-ref("element.elmt") -/// - debug (dictionary): see #doc-ref("element.elmt") #let multiplexer( x: none, y: none,