-
Notifications
You must be signed in to change notification settings - Fork 3
/
toc.schema.json
124 lines (124 loc) · 3.88 KB
/
toc.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"$schema": "http://json-schema.org/schema#",
"version": "1.0.0",
"id": "https://github.com/dotnet/docfx/test/schemas/toc.schema.json",
"title": "TOC",
"description": "The schema for table of contents (TOC) in Yaml or JSON format",
"oneOf": [
{
"$ref": "#/definitions/tocItemsWithMetadata"
},
{
"items": {
"$ref": "#/definitions/tocItem"
},
"type": "array",
"minItems": 1
}
],
"definitions": {
"name": {
"type": "string",
"description": "A string name that is displayed for the TOC item. The name cannot include a colon (:).",
"minLength": 1,
"pattern": "^[^:]+$"
},
"displayName": {
"type": "string",
"description": "An additional string value that doesn’t get displayed (yes, it's a poor name) but is searched, as well as name, during TOC filtering.",
"minLength": 1
},
"href": {
"type": "string",
"description": "The path the TOC item navigates to. Optional because items can exist just to parent other items. There are three-folded meanings for href: 1. href can specify the path the item navigates to. It can be either relative path, absolute path or external URL. 2. href can also point to another TOC file - this is the scenario called TOC include: all the items inside the included TOC file are considered and built into result as children of the current TOC item. 3. At last, href can point to a folder, indicating the navigation path be resolved to the first item in the TOC file under the root of that folder if both the TOC file and the item exist.",
"minLength": 1
},
"topicHref": {
"type": "string",
"description": "Specifies the path the item navigates to (see #1 in href). It is useful when href points to another TOC file (see #2 in href) or points to a folder (see #3 in href).",
"minLength": 1
},
"uid": {
"type": "string",
"description": "The uid the TOC item navigates to. Optional because items can exist just to parent other items.",
"minLength": 1
},
"maintainContext": {
"type": "boolean",
"description": "This property specifies whether the navigation to this TOC item maintains the current TOC context. The default value is false.",
"default": false
},
"expanded": {
"type": "boolean",
"description": "This property specifies whether the item should be expanded by default when the TOC is loaded. Only one root-level item can be expanded on load. The default value is false, so only add this with value true if you want the item to be expanded.",
"default": false
},
"tocItem": {
"properties": {
"name": {
"$ref": "#/definitions/name"
},
"displayName": {
"$ref": "#/definitions/displayName"
},
"href": {
"$ref": "#/definitions/href"
},
"topicHref": {
"$ref": "#/definitions/topicHref"
},
"uid": {
"$ref": "#/definitions/uid"
},
"maintainContext": {
"$ref": "#/definitions/maintainContext"
},
"expanded": {
"$ref": "#/definitions/expanded"
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/tocItem"
},
"minItems": 1
}
},
"not": {
"anyOf": [
{
"required": [ "href", "uid" ]
},
{
"required": [ "topicHref", "uid" ]
}
]
},
"type": "object",
"required": [ "name" ],
"additionalProperties": true
},
"tocItemsWithMetadata": {
"properties": {
"metadata": {
"description": "The metadata of the TOC.",
"properties": {
},
"type": "object"
},
"items": {
"description": "The tree which represents the hierarchy of the TOC.",
"items": {
"$ref": "#/definitions/tocItem"
},
"type": "array",
"minItems": 1
}
},
"type": "object",
"required": [ "items" ],
"additionalProperties": false,
"metadata": "/metadata"
}
}
}