You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Contribution Guidelines
2
2
3
-
When contributing to this repository, please [submit a new issue](https://github.com/formatc1702/WireViz/issues) first to discuss the proposed change, before submitting a pull request.
3
+
When contributing to this repository, please [submit a new issue](https://github.com/wireviz/WireViz/issues) first to discuss the proposed change, before submitting a pull request.
4
4
5
5
## Submitting a new Issue
6
6
@@ -27,7 +27,7 @@ When contributing to this repository, please [submit a new issue](https://github
27
27
1. Push the changes to your fork.
28
28
1. Please format your code using [`isort`](https://pycqa.github.io/isort/) and [`black`](https://black.readthedocs.io) before submitting.
29
29
1. Submit a new pull request, using `dev` as the base branch.
30
-
- If your code changes or extends the WireViz YAML syntax, be sure to update the [syntax description document](https://github.com/formatc1702/WireViz/blob/dev/docs/syntax.md) in your PR.
30
+
- If your code changes or extends the WireViz YAML syntax, be sure to update the [syntax description document](https://github.com/wireviz/WireViz/blob/dev/docs/syntax.md) in your PR.
31
31
1. Please include in the PR description (and optionally also in the commit message body) a reference (# followed by issue number) to the issue where the suggested changes are discussed.
Copy file name to clipboardExpand all lines: docs/syntax.md
+30-8Lines changed: 30 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -192,7 +192,7 @@ connections:
192
192
```
193
193
194
194
- Each connection set is a list of components.
195
-
- The minimum number of items is two.
195
+
- The minimum number of items is one.
196
196
- The maximum number of items is unlimited.
197
197
- Items must alternatingly belong to the `connectors` and the `cables` sections.
198
198
- When a connection set defines multiple parallel connections, the number of specified `<pin>`s and `<wire>`s for each component in the set must match. When specifying only one designator, one is auto-generated for each connection of the set.
@@ -207,7 +207,6 @@ connections:
207
207
-`- <designator>: <int/str>` attaches a pin of the connector, referring to a pin number (from the connector's `pins` attribute) or a pin label (from its `pinlabels` attribute), provided the label is unique.
208
208
209
209
-`- <designator>` is allowed for simple connectors, since they have only one pin to connect.
210
-
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created.
211
210
212
211
#### Cables
213
212
@@ -230,14 +229,10 @@ For connectors with `autogenerate: true`, a new instance, with auto-generated de
230
229
-`- [<designator>, ..., <designator>]`
231
230
232
231
Attaches multiple different single pin connectors, one per connection in the set.
233
-
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created with every mention.
234
-
Auto-generated and non-autogenerated connectors may be mixed.
235
232
236
233
-`- <designator>`
237
234
238
235
Attaches multiple instances of the same single pin connector, one per connectioin in the set.
239
-
For connectors with `autogenerate: true`, a new instance, with auto-generated designator, is created for every connection in the set.
240
-
Since only connectors with `pincount: 1` can be auto-generated, pin number 1 is implicit.
241
236
242
237
#### Cables
243
238
@@ -280,7 +275,9 @@ connections:
280
275
281
276
### Autogeneration of items
282
277
283
-
For very simple, recurring connectors such as crimp ferrules, splices and others, where it would be a hassle to individually assign unique designators for every instance, autogeneration may be used. Both connectors and cables can be autogenerated.
278
+
If multiple identical copies of a connector or cable are needed, it is possible to define them once as a template, and then generate multiple instances as needed. This is called autogeneration. Both connectors and cables can be autogenerated.
279
+
280
+
Autogenerated instances of components can be explicitly assigned a designator; this way, they can be referenced in multiple connection sets. However, it is also possible to generate unnamed instances of components. This is especially useful for components that do not need to be referenced in more than one connection set, and where naming each individual instance is an unnecessary complication.
284
281
285
282
Example (see `connections` section):
286
283
@@ -322,9 +319,29 @@ connections:
322
319
Since the internally assigned designator of an unnamed component is not known to the user, one instance of the connector can not be referenced again outside the point of creation (i.e. in other connection sets, or later in the same set). Autogeneration of unnamed instances is therefore only useful for terminals with only one wire attached, or splices with exactly one wire going in, and one wire going out.
323
320
If a component is to be used in other connection sets (e.g. for a three-way splice, or a crimp where multiple wires are joined), a named instance needs to be used.
324
321
322
+
The default character to trigger autogeneration of components is `.`. A different character can be specified using the `template_separator` option (see below).
323
+
325
324
Names of autogenerated components are hidden by default. While they can be shown in the graphical output using the `show_name: true` option, it is not recommended to manually use the internally assigned designator (starting with a double underscore `__`), since it might change in future WireViz versions, or when the order of items in connection sets changes.
326
325
327
326
327
+
### Unconnected components
328
+
329
+
Even if a component is not connected to any other components, it must be mentioned in a connection set for it to be displayed.
330
+
331
+
```yaml
332
+
connectors:
333
+
X1: # this connector will not be connected to any other components
334
+
...
335
+
336
+
connections:
337
+
-
338
+
- X1 # minimal connection set to include connector in the diagram
339
+
340
+
```
341
+
342
+
If any component is defined in the `connectors` or `cables` sections but not referenced in `connections`, a warning is printed in the console.
343
+
344
+
328
345
## Metadata entries
329
346
330
347
```yaml
@@ -338,6 +355,7 @@ Names of autogenerated components are hidden by default. While they can be shown
338
355
# If no value is specified for 'title', then the
339
356
# output filename without extension is used.
340
357
```
358
+
See [HTML Output Templates](../src/wireviz/templates/) for how metadata entries can be inserted into the HTML output.
341
359
342
360
## Options
343
361
@@ -372,6 +390,9 @@ Names of autogenerated components are hidden by default. While they can be shown
372
390
# about additional components inside the diagram node (connector/cable box).
373
391
# If False, show all info about additional components inside the diagram node.
374
392
mini_bom_mode: <bool> # Default = True
393
+
394
+
# Character to split template and designator for autogenerated components
395
+
template_separator: <str> # Default = '.'
375
396
```
376
397
377
398
@@ -393,6 +414,7 @@ Parts can be added to a connector or cable in the section `<additional-component
393
414
# when used in a connector:
394
415
# pincount number of pins of connector
395
416
# populated number of populated positions in a connector
417
+
# unpopulated number of unpopulated positions
396
418
# when used in a cable:
397
419
# wirecount number of wires of cable/bundle
398
420
# terminations number of terminations on a cable/bundle
@@ -478,7 +500,7 @@ The following colors are understood:
0 commit comments