Correct indentation and <...> brackets

This commit is contained in:
Martin Rieder 2024-07-02 01:56:12 +02:00
parent f5e4c061c1
commit a6504fd6c9

View File

@ -32,46 +32,48 @@ Make sure they are aligned correctly in the document hierarchy, i.e. by two spac
```yaml
connectors: # dictionary of all used connectors
<str> : # unique connector designator/name
... # connector attributes (see below)
<str> :
...
...
<str>: # unique connector designator/name
<str>: <...> # connector attributes (see below)
<str>:
<str>: <...>
<...>
cables: # dictionary of all used cables and wires
<str> : # unique cable designator/name
... # cable attributes (see below)
<str> :
...
...
<str>: # unique cable designator/name
<str>: <...> # cable attributes (see below)
<str>:
<str>: <...>
<...>
connections: # list of all connections to be made
# between cables and connectors
connections: # list of all connection sets (see below)
-
... # connection set (see below)
- <...> # <connector> or <cable>
- <...> # <cable> or <connector>
-
...
...
- <...>
<...>
additional_bom_items: # custom items to add to BOM
- <bom-item> # BOM item (see below)
...
<str>: <...>
metadata: # dictionary of meta-information describing the harness
<key> : <value> # any number of key value pairs (see below)
...
<key>: <value> # any number of key value pairs (see below)
<...>
options: # dictionary of common attributes for the whole harness
<str> : <value> # optional harness attributes (see below)
...
<str>: <value> # optional harness attributes (see below)
<...>
tweak: # optional tweaking of .gv output
...
<...>
```
## Connector attributes
```yaml
<str> : # unique connector designator/name
connectors:
<str>: # unique connector designator/name
# general information about a connector (all optional)
type: <str>
subtype: <str>
@ -118,7 +120,8 @@ tweak: # optional tweaking of .gv output
## Cable attributes
```yaml
<str> : # unique cable designator/name
cables:
<str>: # unique cable designator/name
# general information about a connector (all optional)
category: <category> # may be set to bundle;
# generates one BOM item for every wire in the bundle
@ -197,7 +200,7 @@ connections:
- <component> # Each connection set is itself a list of items
- <component> # Items must alternatingly belong to the connectors and cables sections
# Arrows may be used instead of cables
-...
- <...>
- # example (single connection)
- <connector>: <pin> # attach one pin of the connector
@ -225,7 +228,7 @@ connections:
# use double line arrow (==, <==, <==>, ==>)
- <connector>
...
<...>
```
### Single connections
@ -293,7 +296,7 @@ connections:
- <arrow> # ==, <==, <==> or ==>
- <connector>
-
- ...
- <...>
- <connector>: [<pin>, ...] # designator and pinlist (pinlist is ignored)
# useful when combining arrows and wires
- <arrow> # ==, <==, <==> or ==>
@ -359,7 +362,7 @@ Even if a component is not connected to any other components, it must be mention
```yaml
connectors:
X1: # this connector will not be connected to any other components
...
<...>
connections:
-
@ -373,7 +376,7 @@ If any component is defined in the `connectors` or `cables` sections but not ref
## Metadata entries
```yaml
# Meta-information describing the harness
metadata: # Meta-information describing the harness
# Each key/value pair replaces all key references in
# the HTML output template with the belonging value.
@ -388,7 +391,7 @@ See [HTML Output Templates](../src/wireviz/templates/) for how metadata entries
## Options
```yaml
# Common attributes for the whole harness.
options: # Common attributes for the whole harness.
# All entries are optional and have default values.
# Background color of diagram and HTML output
@ -426,14 +429,14 @@ See [HTML Output Templates](../src/wireviz/templates/) for how metadata entries
## BOM items and additional components
Connectors (both regular, and auto-generated), cables, and wires of a bundle are automatically added to the BOM,
unless the `ignore_in_bom` attribute is set to `true`.
Connectors (both regular, and auto-generated), cables, and wires of a bundle are automatically added to the BOM, unless the `ignore_in_bom` attribute is set to `true`.
Additional items can be added to the BOM as either part of a connector or cable or on their own.
Parts can be added to a connector or cable in the section `<additional-component>` which will also list them in the graph.
```yaml
-
additional_components:
-
type: <str> # type of additional component
# all the following are optional:
subtype: <str> # additional description (only shown in bom)
@ -460,7 +463,8 @@ Parts can be added to a connector or cable in the section `<additional-component
Alternatively items can be added to just the BOM by putting them in the section `<bom-item>` above.
```yaml
-
additional_bom_items:
-
description: <str>
# all the following are optional:
qty: <int/float> # qty to add to the bom (defaults to 1)
@ -479,23 +483,17 @@ This feature is experimental and might change or be removed in future versions.
```yaml
# Optional tweaking of the .gv output.
# This feature is experimental and might change
# or be removed in future versions.
tweak: # Optional tweaking of the .gv output.
override: # dict of .gv entries to override
# Each entry is identified by its leading string
# in lines beginning with a TAB character.
# The leading string might be in "quotes" in
# the .gv output. This leading string must be
# Each entry is identified by its leading string in lines beginning with a TAB character.
# The leading string might be in "quotes" in the .gv output. This leading string must be
# followed by attributes in [square brackets].
# Entries with an attribute containing HTML are
# not supported.
# Entries with an attribute containing HTML are not supported.
<str>: # leading string of .gv entry
<str> : <str/null> # attribute and its new value
# Any number of attributes can be overridden
# for each entry. Attributes not already existing
# in the entry will be appended to the entry.
<str>: <str/null> # attribute and its new value
# Any number of attributes can be overridden for each entry.
# Attributes not already existing in the entry will be appended to the entry.
# Use null as new value to delete an attribute.
append: <str/list> # string or list of strings to append to the .gv output
@ -630,4 +628,4 @@ See [yaml-multiline.info](https://yaml-multiline.info/) for more information.
## Inheritance
[YAML anchors and references](https://blog.daemonl.com/2016/02/yaml.html) are useful for defining and referencing information that is used more than once in a file, e.g. when using defining multiple connectors of the same type or family. See [Demo 02](../examples/demo02.yml) for an example.
[YAML anchors and references](https://blog.daemonl.com/2016/02/yaml.html) are useful for defining and referencing information that is used more than once in a file, e.g. when using multiple connectors of the same type or family. See [Demo 02](../examples/demo02.yml) for an example.