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: README.md
+84-12Lines changed: 84 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,24 +24,23 @@ Whether you’re building a static site generator, documentation renderer, or a
24
24
.
25
25
├── README.md
26
26
├── CHANGELOG.md
27
-
├── CODE_OF_CONDUCT.md
28
-
├── CONTRIBUTING.md
29
-
├── LICENSE
27
+
├── package.json
28
+
├── docs/
29
+
│ ├── definitions.md
30
+
│ ├── integrations-guide.md
31
+
│ └── overview.md
30
32
├── schema/
31
33
│ ├── v1.0.0/
32
34
│ │ ├── sidebar.schema.json
33
35
│ │ └── samples/
34
-
│ │ ├── meta-valid-sample.yaml
35
-
│ │ └── valid-sample.yaml
36
+
│ │ └── example.yaml
36
37
│ └── latest/
37
38
│ ├── sidebar.schema.json
38
39
│ └── samples/
39
-
│ ├── meta-valid-sample.yaml
40
-
│ └── valid-sample.yaml
41
-
├── docs/
42
-
│ ├── definitions.md
43
-
│ ├── integration-guide.md
44
-
│ └── overview.md
40
+
│ └── example.yaml
41
+
├── scripts/
42
+
│ ├── yamlToMarkdown.js
43
+
│ └── markdownToYaml.js
45
44
```
46
45
47
46
-`latest/` is a pointer to the most recent version of the schema for easy integration. Update it manually on each release, or use a script/symlink strategy.
@@ -58,6 +57,79 @@ Whether you’re building a static site generator, documentation renderer, or a
58
57
59
58
---
60
59
60
+
## 🛠️ Conversion Scripts
61
+
62
+
### `yamlToMarkdown.js`
63
+
64
+
**Description:**
65
+
Converts sidebar YAML files (matching the schema) into readable, structured Markdown navigation lists.
66
+
Supports preservation of YAML comments (before each sidebar entry) as Markdown paragraphs, and includes metadata such as the YAML filename and timestamp as Markdown comments.
67
+
68
+
**Features:**
69
+
70
+
- Converts all sidebar structure, including nested items, headings, and tags, into Markdown.
71
+
- Scalar properties (string, number, boolean) are rendered as `_property_: value`.
72
+
- Tags arrays are rendered as Markdown sub-lists.
73
+
- YAML comments before each sidebar entry are rendered as Markdown paragraphs after the heading.
74
+
- Prepends Markdown comments for the YAML filename and timestamp.
Converts Markdown navigation lists (as generated by `yamlToMarkdown.js`) back into YAML, reconstructing the sidebar structure and restoring comments as YAML comments.
96
+
97
+
**Features:**
98
+
99
+
- Parses Markdown headings, paragraphs, and lists to reconstruct the sidebar data structure.
100
+
- Converts Markdown paragraphs between headings and the first list item into YAML comments.
101
+
- Scalar properties and tags are faithfully restored.
102
+
- Prepends YAML comments for the Markdown filename and timestamp.
0 commit comments