Skip to content

Commit 75c6c45

Browse files
committed
Streamline UnitsNet.Modular documentation
1 parent eabb36d commit 75c6c45

3 files changed

Lines changed: 94 additions & 210 deletions

File tree

‎Docs/quantity-and-unit-definition-schema.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,23 @@ The following is a minimal definition of a linear quantity with one unit:
5050
By convention, the filename is `<Name>.json`, such as `Length.json`. Quantity and unit names use PascalCase and must
5151
be valid C# identifiers because they become generated type and member names.
5252

53+
## UnitsNet.Modular compatibility
54+
55+
UnitsNet.Modular adds the optional `Namespace` field. It defaults to `UnitsNet` and becomes part of the stable
56+
semantic ID `Namespace.Name`; use a namespace you own for custom and third-party definitions. Repository CodeGen
57+
ignores this field.
58+
59+
Add a custom definition to a Modular project as a Roslyn `AdditionalFiles` item. See
60+
[Add custom quantities](../UnitsNet.Modular/README.md#add-custom-quantities) for registration and selection.
61+
5362
## Quantity object
5463

5564
The root JSON object represents a quantity.
5665

5766
| Property | Type | Required/default | Description |
5867
|---|---|---|---|
5968
| `Name` | string | Required | PascalCase quantity name used for the generated quantity type and unit enum. Conventionally matches the filename. |
69+
| `Namespace` | string | `UnitsNet` | UnitsNet.Modular only. Namespace for generated types and part of the stable semantic ID `Namespace.Name`. Ignored by repository CodeGen. |
6070
| `BaseUnit` | string | Required | `SingularName` of the unit through which conversions are performed. It must identify exactly one entry in `Units`. |
6171
| `XmlDocSummary` | string | Required | XML documentation summary for the generated quantity type. XML documentation elements such as `<c>` may be used. |
6272
| `XmlDocRemarks` | string | Optional | Additional XML documentation remarks for the generated quantity type. Often contains a reference URL. |

0 commit comments

Comments
 (0)