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

@ -33,44 +33,46 @@ Make sure they are aligned correctly in the document hierarchy, i.e. by two spac
```yaml ```yaml
connectors: # dictionary of all used connectors connectors: # dictionary of all used connectors
<str>: # unique connector designator/name <str>: # unique connector designator/name
... # connector attributes (see below) <str>: <...> # connector attributes (see below)
<str>: <str>:
... <str>: <...>
... <...>
cables: # dictionary of all used cables and wires cables: # dictionary of all used cables and wires
<str>: # unique cable designator/name <str>: # unique cable designator/name
... # cable attributes (see below) <str>: <...> # cable attributes (see below)
<str>: <str>:
... <str>: <...>
... <...>
connections: # list of all connections to be made connections: # list of all connection sets (see below)
# between cables and connectors
- -
... # connection set (see below) - <...> # <connector> or <cable>
- <...> # <cable> or <connector>
- -
... - <...>
... <...>
additional_bom_items: # custom items to add to BOM additional_bom_items: # custom items to add to BOM
- <bom-item> # BOM item (see below) - <bom-item> # BOM item (see below)
... <str>: <...>
metadata: # dictionary of meta-information describing the harness 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 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 tweak: # optional tweaking of .gv output
... <...>
``` ```
## Connector attributes ## Connector attributes
```yaml ```yaml
connectors:
<str>: # unique connector designator/name <str>: # unique connector designator/name
# general information about a connector (all optional) # general information about a connector (all optional)
type: <str> type: <str>
@ -118,6 +120,7 @@ tweak: # optional tweaking of .gv output
## Cable attributes ## Cable attributes
```yaml ```yaml
cables:
<str>: # unique cable designator/name <str>: # unique cable designator/name
# general information about a connector (all optional) # general information about a connector (all optional)
category: <category> # may be set to bundle; category: <category> # may be set to bundle;
@ -197,7 +200,7 @@ connections:
- <component> # Each connection set is itself a list of items - <component> # Each connection set is itself a list of items
- <component> # Items must alternatingly belong to the connectors and cables sections - <component> # Items must alternatingly belong to the connectors and cables sections
# Arrows may be used instead of cables # Arrows may be used instead of cables
-... - <...>
- # example (single connection) - # example (single connection)
- <connector>: <pin> # attach one pin of the connector - <connector>: <pin> # attach one pin of the connector
@ -225,7 +228,7 @@ connections:
# use double line arrow (==, <==, <==>, ==>) # use double line arrow (==, <==, <==>, ==>)
- <connector> - <connector>
... <...>
``` ```
### Single connections ### Single connections
@ -293,7 +296,7 @@ connections:
- <arrow> # ==, <==, <==> or ==> - <arrow> # ==, <==, <==> or ==>
- <connector> - <connector>
- -
- ... - <...>
- <connector>: [<pin>, ...] # designator and pinlist (pinlist is ignored) - <connector>: [<pin>, ...] # designator and pinlist (pinlist is ignored)
# useful when combining arrows and wires # useful when combining arrows and wires
- <arrow> # ==, <==, <==> or ==> - <arrow> # ==, <==, <==> or ==>
@ -359,7 +362,7 @@ Even if a component is not connected to any other components, it must be mention
```yaml ```yaml
connectors: connectors:
X1: # this connector will not be connected to any other components X1: # this connector will not be connected to any other components
... <...>
connections: connections:
- -
@ -373,7 +376,7 @@ If any component is defined in the `connectors` or `cables` sections but not ref
## Metadata entries ## Metadata entries
```yaml ```yaml
# Meta-information describing the harness metadata: # Meta-information describing the harness
# Each key/value pair replaces all key references in # Each key/value pair replaces all key references in
# the HTML output template with the belonging value. # the HTML output template with the belonging value.
@ -388,7 +391,7 @@ See [HTML Output Templates](../src/wireviz/templates/) for how metadata entries
## Options ## Options
```yaml ```yaml
# Common attributes for the whole harness. options: # Common attributes for the whole harness.
# All entries are optional and have default values. # All entries are optional and have default values.
# Background color of diagram and HTML output # Background color of diagram and HTML output
@ -426,13 +429,13 @@ See [HTML Output Templates](../src/wireviz/templates/) for how metadata entries
## BOM items and additional components ## BOM items and additional components
Connectors (both regular, and auto-generated), cables, and wires of a bundle are automatically added to the BOM, 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`.
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. 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. Parts can be added to a connector or cable in the section `<additional-component>` which will also list them in the graph.
```yaml ```yaml
additional_components:
- -
type: <str> # type of additional component type: <str> # type of additional component
# all the following are optional: # all the following are optional:
@ -460,6 +463,7 @@ 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. Alternatively items can be added to just the BOM by putting them in the section `<bom-item>` above.
```yaml ```yaml
additional_bom_items:
- -
description: <str> description: <str>
# all the following are optional: # all the following are optional:
@ -479,23 +483,17 @@ This feature is experimental and might change or be removed in future versions.
```yaml ```yaml
# Optional tweaking of the .gv output. tweak: # Optional tweaking of the .gv output.
# This feature is experimental and might change
# or be removed in future versions.
override: # dict of .gv entries to override override: # dict of .gv entries to override
# Each entry is identified by its leading string # Each entry is identified by its leading string in lines beginning with a TAB character.
# in lines beginning with a TAB character. # The leading string might be in "quotes" in the .gv output. This leading string must be
# The leading string might be in "quotes" in
# the .gv output. This leading string must be
# followed by attributes in [square brackets]. # followed by attributes in [square brackets].
# Entries with an attribute containing HTML are # Entries with an attribute containing HTML are not supported.
# not supported.
<str>: # leading string of .gv entry <str>: # leading string of .gv entry
<str>: <str/null> # attribute and its new value <str>: <str/null> # attribute and its new value
# Any number of attributes can be overridden # Any number of attributes can be overridden for each entry.
# for each entry. Attributes not already existing # Attributes not already existing in the entry will be appended to the entry.
# in the entry will be appended to the entry.
# Use null as new value to delete an attribute. # Use null as new value to delete an attribute.
append: <str/list> # string or list of strings to append to the .gv output 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 ## 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.