diff --git a/doc/examples.typ b/doc/examples.typ index d968bf9..075c11c 100644 --- a/doc/examples.typ +++ b/doc/examples.typ @@ -147,4 +147,22 @@ wire.wire("w1", ((0, 0), (1, 1)), style: "zigzag") wire.wire("w2", ((0, 0), (1, -.5)), style: "zigzag", zigzag-ratio: 80%) wire.intersection("w1.zig") -```) \ No newline at end of file +```) + +#let capacitor = example(``` +electrical.capacitor( + x: 0, y: 0, w: 2, h: 1, id: "a", + scales: (100%, 80%), gap: 0.3 +) + +electrical.capacitor( + x: 4, y: -0.5, w: 1, h: 2, id: "b", + vertical: true, symbols: ([+], none) +) +```, vertical: true) + +#let resistor = example(``` +electrical.resistor(x: 0, y: 0, w: 2, h: 0.5, id: "a", zigzags: 8) +electrical.resistor(x: 4, y: -0.5, w: 0.5, h: 2, id: "b", vertical: true) +electrical.resistor(x: 6.5, y: 0, w: 2, h: 0.5, id: "c", zigzags: none) +```, vertical: true) \ No newline at end of file diff --git a/manual.pdf b/manual.pdf index 2750ae9..3479601 100644 Binary files a/manual.pdf and b/manual.pdf differ diff --git a/manual.typ b/manual.typ index 7d1ef53..0b3b58c 100644 --- a/manual.typ +++ b/manual.typ @@ -4,6 +4,7 @@ #import "doc/examples.typ" #import "src/circuit.typ": circuit #import "src/element.typ" +#import "src/electrical.typ" #import "src/gates.typ" #import "src/util.typ" #import "src/wire.typ" @@ -195,4 +196,24 @@ Simply import #link("src/lib.typ") and call the `circuit` function: ) ) -#tidy.show-module(gates-docs, sort-functions: false) \ No newline at end of file +#tidy.show-module(gates-docs, sort-functions: false) + +#pagebreak() + +#let electrical-docs = tidy.parse-module( + read("src/elements/electrical/capacitor.typ") + "\n" + + read("src/elements/electrical/resistor.typ") + "\n", + name: "electrical", + scope: ( + element: element, + circuit: circuit, + electrical: electrical, + draw: draw, + wire: wire, + tidy: tidy, + examples: examples, + doc-ref: doc-ref + ) +) + +#tidy.show-module(electrical-docs, sort-functions: false) \ No newline at end of file