diff --git a/docs/README.md b/docs/README.md index 732f6714..1ba372bb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,17 +13,64 @@ WireViz is a tool for easily documenting cables, wiring harnesses and connector ## Features -* WireViz input files are fully text based +* WireViz input files contain fully text based [YAML syntax](syntax.md) * No special editor required * Human readable * Easy version control - * YAML syntax - * UTF-8 input and output files for special character support + * UTF-8 special character support * Understands and uses color abbreviations as per [IEC 60757](https://en.wikipedia.org/wiki/Electronic_color_code#Color_band_system) (black=BK, red=RD, ...) + + ![##000000](https://via.placeholder.com/15/000000/ffffff?text=BK) + ![##ffffff](https://via.placeholder.com/15/ffffff/000000?text=WH) + ![##999999](https://via.placeholder.com/15/999999/000000?text=GY) + ![##ff66cc](https://via.placeholder.com/15/ff66cc/000000?text=PK) + ![##ff0000](https://via.placeholder.com/15/ff0000/000000?text=RD) + ![##ff8000](https://via.placeholder.com/15/ff8000/000000?text=OG) + ![##ffff00](https://via.placeholder.com/15/ffff00/000000?text=YE) + ![##708000](https://via.placeholder.com/15/708000/000000?text=OL) + ![##00ff00](https://via.placeholder.com/15/00ff00/000000?text=GN) + ![##00ffff](https://via.placeholder.com/15/00ffff/000000?text=TQ) + ![##a0dfff](https://via.placeholder.com/15/a0dfff/000000?text=LB) + ![##0066ff](https://via.placeholder.com/15/0066ff/000000?text=BU) + ![##8000ff](https://via.placeholder.com/15/8000ff/000000?text=VT) + ![##895956](https://via.placeholder.com/15/895956/000000?text=BN) + ![##ceb673](https://via.placeholder.com/15/ceb673/000000?text=BG) + ![##f5f0d0](https://via.placeholder.com/15/f5f0d0/000000?text=IV) + ![##708090](https://via.placeholder.com/15/708090/000000?text=SL) + ![##d6775e](https://via.placeholder.com/15/d6775e/000000?text=CU) + ![##aaaaaa](https://via.placeholder.com/15/aaaaaa/000000?text=SN) + ![##84878c](https://via.placeholder.com/15/84878c/000000?text=SR) + ![##ffcf80](https://via.placeholder.com/15/ffcf80/000000?text=GD) + * Auto-generates standard wire color schemes and allows custom ones if needed * [DIN 47100](https://en.wikipedia.org/wiki/DIN_47100) (WT/BN/GN/YE/GY/PK/BU/RD/BK/VT/...) - * [IEC 60757](https://en.wikipedia.org/wiki/Electronic_color_code#Color_band_system) (BN/RD/OR/YE/GN/BU/VT/GY/WT/BK/...) + + ![##ffffff](https://via.placeholder.com/15/ffffff/000000?text=WT) + ![##895956](https://via.placeholder.com/15/895956/000000?text=BN) + ![##00ff00](https://via.placeholder.com/15/00ff00/000000?text=GN) + ![##ffff00](https://via.placeholder.com/15/ffff00/000000?text=YE) + ![##999999](https://via.placeholder.com/15/999999/000000?text=GY) + ![##ff66cc](https://via.placeholder.com/15/ff66cc/000000?text=PK) + ![##0066ff](https://via.placeholder.com/15/0066ff/000000?text=BU) + ![##ff0000](https://via.placeholder.com/15/ff0000/000000?text=RD) + ![##000000](https://via.placeholder.com/15/000000/ffffff?text=BK) + ![##8000ff](https://via.placeholder.com/15/8000ff/000000?text=VT) + + * [IEC 60757](https://en.wikipedia.org/wiki/Electronic_color_code#Color_band_system) + (BN/RD/OR/YE/GN/BU/VT/GY/WT/BK/...) + + ![##895956](https://via.placeholder.com/15/895956/000000?text=BN) + ![##ff0000](https://via.placeholder.com/15/ff0000/000000?text=RD) + ![##ff8000](https://via.placeholder.com/15/ff8000/000000?text=OR) + ![##ffff00](https://via.placeholder.com/15/ffff00/000000?text=YE) + ![##00ff00](https://via.placeholder.com/15/00ff00/000000?text=GN) + ![##0066ff](https://via.placeholder.com/15/0066ff/000000?text=BU) + ![##8000ff](https://via.placeholder.com/15/8000ff/000000?text=VT) + ![##999999](https://via.placeholder.com/15/999999/000000?text=GY) + ![##ffffff](https://via.placeholder.com/15/ffffff/000000?text=WT) + ![##000000](https://via.placeholder.com/15/000000/ffffff?text=BK) + * [25 Pair Color Code](https://en.wikipedia.org/wiki/25-pair_color_code#Color_coding) (BUWH/WHBU/OGWH/WHOG/GNWH/WHGN/BNWH/...) * [TIA/EIA 568 A/B](https://en.wikipedia.org/wiki/TIA/EIA-568#Wiring) (Subset of 25-Pair, used in CAT-5/6/...) * Understands wire gauge in mm² or AWG diff --git a/docs/syntax.md b/docs/syntax.md index 2c92fd34..eacb9674 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -1,152 +1,183 @@ # WireViz Syntax +WireViz input files are created as plain text based on YAML, which does not require any special editor. International character sets and technical symbols are also supported through UTF-8. +See the following sections of this document about further details: + + - **[Main sections](#main-sections)** + - [Colors](#colors) + - [Cable color codes](#cable-color-codes) + - [Images](#images) + - [Multiline Strings](#multiline-strings) + - [Inheritance](#inheritance) + +The YAML syntax is human readable and supports version control because of its hierarchical structure. +The input files would normally be saved using a text editor to the file extension `.yml` or `.yaml`. + +See the [tutorial page](../tutorial/readme.md) for sample code, as well as the [example gallery](../examples/readme.md) to see more of what WireViz can do. + ## Main sections +The main sections at the highest hierarchical level of the document may contain any of the following: + + - [Connectors](#connector-attributes) + - [Cables](#cable-attributes) + - [Connections](#connection-sets) + - [Metadata](#metadata-entries) + - [Options](#options) + - [BOM items and additional components](#bom-items-and-additional-components) + - [GraphViz tweaking](#graphviz-tweaking-experimental) + +Their respective attribute assignments need to be indented using space characters on every line. +Make sure they are aligned correctly in the document hierarchy, i.e. by two spaces for each level! + ```yaml -connectors: # dictionary of all used connectors - : # unique connector designator/name - ... # connector attributes (see below) - : - ... - ... - -cables: # dictionary of all used cables and wires - : # unique cable designator/name - ... # cable attributes (see below) - : - ... - ... - -connections: # list of all connections to be made - # between cables and connectors +connectors: # dictionary of all used connectors + : # unique connector designator/name + : <...> # connector attributes (see below) + : + : <...> + <...> + +cables: # dictionary of all used cables and wires + : # unique cable designator/name + : <...> # cable attributes (see below) + : + : <...> + <...> + +connections: # list of all connection sets (see below) - - ... # connection set (see below) + - <...> # or + - <...> # or - - ... - ... + - <...> + <...> additional_bom_items: # custom items to add to BOM - - # BOM item (see below) - ... + - # BOM item (see below) + : <...> -metadata: # dictionary of meta-information describing the harness - : # any number of key value pairs (see below) - ... +metadata: # dictionary of meta-information describing the harness + : # any number of key value pairs (see below) + <...> -options: # dictionary of common attributes for the whole harness - : # optional harness attributes (see below) - ... +options: # dictionary of common attributes for the whole harness + : # optional harness attributes (see below) + <...> -tweak: # optional tweaking of .gv output - ... +tweak: # optional tweaking of .gv output + <...> ``` + ## Connector attributes ```yaml - : # unique connector designator/name - # general information about a connector (all optional) - type: - subtype: - color: # see below - image: # see below - notes: - - # product information (all optional) - ignore_in_bom: # if set to true the connector is not added to the BOM - pn: # [internal] part number - manufacturer: # manufacturer name - mpn: # manufacturer part number - supplier: # supplier name - spn: # supplier part number - additional_components: # additional components - - # additional component (see below) - - # pinout information - # at least one of the following must be specified - pincount: # if omitted, is set to length of specified list(s) - pins: # if omitted, is autofilled with [1, 2, ..., pincount] - pinlabels: # if omitted, is autofilled with blanks - - # pin color marks (optional) - pincolors: # list of colors to be assigned to the respective pins; - # if list length is lower than connector pinout, - # no color marks will be added to remaining pins - - # rendering information (all optional) - bgcolor: # Background color of diagram connector box - bgcolor_title: # Background color of title in diagram connector box - style: