Skip to content

Commit 8f8bb3c

Browse files
committed
Add documentation-structure
Add first-documentation-example
1 parent 94af9da commit 8f8bb3c

6 files changed

Lines changed: 128 additions & 0 deletions

File tree

src/assets/data/data.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "../schema/db.schema.json",
3+
"versions": [
4+
{
5+
"version": "1.0.0",
6+
"isLatest": true,
7+
"groups": [
8+
{
9+
"title": "Introduction",
10+
"posts": [
11+
{
12+
"id": "getting-started",
13+
"title": "Getting Started",
14+
"fileName": "getting-started.html",
15+
"sections": []
16+
}
17+
]
18+
}
19+
]
20+
}
21+
]
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span>Some text.......................</span>

src/assets/schema/db.schema.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "The documentation database",
4+
"description": "Defines the structure of the documentation versions",
5+
"type": "object",
6+
"properties": {
7+
"versions": {
8+
"type": "array",
9+
"items": {
10+
"$ref": "./documentation-version.schema.json"
11+
},
12+
"description": "The versions of the documentation"
13+
}
14+
},
15+
"required": [
16+
"versions"
17+
]
18+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Documentation version",
4+
"description": "Defines a new documentation version",
5+
"type": "object",
6+
"properties": {
7+
"version": {
8+
"type": "string",
9+
"pattern": "^([0-9].){2}[0-9]$",
10+
"description": "The version of the documentation"
11+
},
12+
"isLatest": {
13+
"type": "boolean",
14+
"description": "Indicates wether this is the latest version to use it as the default documentation",
15+
"const": true
16+
},
17+
"groups": {
18+
"type": "array",
19+
"items": {
20+
"$ref": "./post-group.schema.json"
21+
},
22+
"minItems": 1,
23+
"description": "An array of documentation post groups"
24+
}
25+
},
26+
"required": [
27+
"version",
28+
"groups"
29+
]
30+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Documentation posts group",
4+
"description": "Contains a set of documentation posts",
5+
"type": "object",
6+
"properties": {
7+
"title": {
8+
"type": "string",
9+
"description": "The title of the documentation post group"
10+
},
11+
"posts": {
12+
"type": "array",
13+
"items": {
14+
"$ref": "./post.schema.json"
15+
},
16+
"minItems": 1,
17+
"description": "An array of documentation posts"
18+
}
19+
},
20+
"required": [
21+
"title",
22+
"posts"
23+
]
24+
}

src/assets/schema/post.schema.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "Documentation post",
4+
"description": "Contains all data associated with a documentation post",
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"type": "string",
9+
"description": "A unique identifier to use as a routeUrl"
10+
},
11+
"title": {
12+
"type": "string",
13+
"description": "The title of the documentation post"
14+
},
15+
"sections": {
16+
"type": "array",
17+
"items": {
18+
"type": "string"
19+
},
20+
"uniqueItems": true,
21+
"description": "An array of the sections which included in the post body"
22+
},
23+
"fileName": {
24+
"type": "string",
25+
"description": "The url for the post body Html file"
26+
}
27+
},
28+
"required": [
29+
"id",
30+
"title",
31+
"fileName"
32+
]
33+
}

0 commit comments

Comments
 (0)