spread out a little more. this is more comfortable

This commit is contained in:
Kat Marchán 2021-08-30 17:37:14 -07:00
parent 0a804976a8
commit 2516d5ba19
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 134 additions and 48 deletions

View File

@ -4,60 +4,146 @@
```kdl ```kdl
document description="KDL Schema KDL schema in KDL" schema-url="https://github.com/zkat/kdl" { document description="KDL Schema KDL schema in KDL" schema-url="https://github.com/zkat/kdl" {
node "document" min=1 max=1 { node "document" {
prop "schema-url" type="url" \ min 1
description="URL where you can find this schema. Informational only." max 1
prop "description" type="string" \ prop "schema-url" description="URL where you can find this schema. Informational only." {
description="General purpose and description for this document schema." type "url"
}
prop "description" description="General purpose and description for this document schema." {
type "string"
}
children id="node-children" { children id="node-children" {
node "node" id="node" { node "node" description="A child node belonging either to `document` or to another `node`. Nodes may be anonymous." {
value min=1 max=1 type="string" \ value description="The name of the node. If a node name is not supplied, the node rules apply to _all_ nodes belonging to the parent." {
description="The name of the node." type "string"
prop "description" type="string" \ max 1
description="A description of this node's purpose." }
prop "id" type="string" \ prop "description" description="A description of this node's purpose." {
description="globally-unique ID of this node." type "string"
prop "ref" type="string" \ }
description="globally unique reference to this node." prop "id" description="globally-unique ID of this node." {
prop "min" type="number" \ type "string"
description="minimum number of instances of this node in its parent's children." }
prop "max" type="number" \ prop "ref" description="globally unique reference to this node." {
description="maximum number of instances of this node in its parent's children." type "string"
}
children { children {
node "enum" description="An enumeration of possible values" {
max 1
value description="Enumeration choices" {
min 1
}
}
node "min" description="minimum number of instances of this node in its parent's children." {
max 1
value {
min 1
max 1
type "number"
}
}
node "max" description="maximum number of instances of this node in its parent's children." {
max 1
value {
min 1
max 1
type "number"
}
}
node "prop" description="A node property key/value pair." { node "prop" description="A node property key/value pair." {
value type="string" min=1 max=1 \ value description="The property key." {
description="The property key." type "string"
prop "type" type="string" \ min 1
description="The type for this prop's value." max 1
prop "id" type="string" \ }
description="A globally-unique ID of this property." prop "id" description="A globally-unique ID of this property." {
prop "ref" type="string" \ type "string"
description="A globally unique reference to another property node." }
prop "description" type="string" \ prop "ref" description="A globally unique reference to another property node." {
description="A description of this property's purpose." type "string"
}
prop "description" description="A description of this property's purpose." {
type "string"
}
children description="Property node children. Only used for validation nodes, for now" {
node "type" description="The type for this prop's value." {
max 1
value {
min 1
type "string"
}
}
node "enum" description="An enumeration of possible values" {
max 1
value description="Enumeration choices" {
min 1
}
}
node "required" description="Whether this property is required if its parent is present." {
max 1
value {
min 1
max 1
type "boolean"
}
}
}
} }
node "value" description="one or more direct node values" { node "value" description="one or more direct node values" {
prop "id" type="string" \ prop "id" description="A globally-unique ID of this value." {
description="A globally-unique ID of this value." type "string"
prop "ref" type="string" \ }
description="A globally unique reference to another value node." prop "ref" description="A globally unique reference to another value node." {
prop "type" type="string" \ type "string"
description="The type for this value." }
prop "description" type="string" \ prop "description" description="A description of this property's purpose." {
description="A description of this property's purpose." type "string"
prop "min" type="number" \ }
description="Minimum number of this value to be provided to the node." children description="Value node children. Only used for validation nodes, for now" {
prop "max" type="number" \ node "type" description="The type for this/these value(s)." {
description="Maximum number of this value to be provided to the node." max 1
value {
min 1
type "string"
}
}
node "enum" description="An enumeration of possible values" {
max 1
value description="Enumeration choices" {
min 1
}
}
node "min" description="minimum number of values for this node." {
max 1
value {
min 1
max 1
type "number"
}
}
node "max" description="maximum number of values for this node." {
max 1
value {
min 1
max 1
type "number"
}
}
}
} }
node "children" max=1 { node "children" {
prop "id" type="string" \ max 1
description="A globally-unique ID of this children node." prop "id" description="A globally-unique ID of this children node." {
prop "ref" type="string" \ type "string"
description="A globally unique reference to another children node." }
prop "description" type="string" \ prop "ref" description="A globally unique reference to another children node." {
description="A description of this property's purpose." type "string"
children ref="node-children" }
prop "description" description="A description of this these children's purpose." {
type "string"
}
children ref="#node-children"
} }
} }
} }