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
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,32 +28,47 @@ gulp.task('default', function () {
28
28
29
29
#### Meta Information
30
30
31
-
yamlMeta: true
31
+
yamlMeta: true // true || false || 'use-paths'
32
32
33
-
*Required* in order to construct the navigation menu. When set to true, each document given to gulp-markdown-docs should have a Front Matter YAML header providing needed information about the document.
33
+
*Must be either truthy or 'use paths'* in order to construct the navigation menu.
34
+
35
+
When set to true, each document given to gulp-markdown-docs should have a Front Matter YAML header providing needed information about the document.
34
36
35
37
```md
36
38
---
37
39
label: Nav Label
38
40
id: unique_slug
39
41
categorySlug:
40
-
categoryLabel:
41
-
categoryRank:
42
-
documentRank:
42
+
categoryLabel:
43
+
categoryRank:
44
+
documentRank:
43
45
---
44
46
45
47
# Your Content
46
48
...
47
49
```
48
50
51
+
When set to 'use paths', the folder structure will be used to determine the metadata. The first part of the markdown filename should start with a number to indicate the `documentRank`, followed by a space, and the rest of the filename will be used for the `label` (without the extension).
52
+
53
+
Each markdown file should be in a folder with a similar naming strategy: the first part of the folder name should be a number indicating the `categoryRank`, the rest of the folder name will be used as the `categorySlug` and `categoryLabel`. The `id` is created by appending the `categoryLabel` and `label` properties.
54
+
55
+
```
56
+
docs\10 Intro\10 Definitions.md
57
+
docs\10 Intro\20 Theory.md
58
+
docs\20 Getting Started\01 Step 1.md
59
+
...
60
+
```
61
+
62
+
This has the advantage of keeping your file structure sorted in the same way as the output HTML.
63
+
49
64
#### Sorting (`yamlMeta` must be true)
50
65
If you wanted a document or category to always be at the end you could set this to 10000, or beginning -10000.
51
66
52
67
All sorting is done on a last-in basis, so the last rank seen is the value used for the category
53
68
54
69
**NOTE** slugs/ids need to be unique between categories and documents TODO: !!
@@ -72,15 +87,15 @@ gulp-markdown-docs includes a simple layout by default. `false` will prevent it
72
87
73
88
templatePath: __dirname + '/resources/index.html'
74
89
75
-
gulp-markdown-docs includes a simple HTML document by default. Passing a path to a different HTML file allows you to customize the resulting documentation page.
76
-
**NOTE** This module looks for `<head>...</head>` to add stylesheets to, and `.doc-nav` and `.doc-content` to append the navigation items and documentation respectively.
90
+
gulp-markdown-docs includes a simple HTML document by default. Passing a path to a different HTML file allows you to customize the resulting documentation page.
91
+
**NOTE** This module looks for `<head>...</head>` to add stylesheets to, and `.doc-nav` and `.doc-content` to append the navigation items and documentation respectively.
92
+
93
+
#### Highlight theme
77
94
78
-
#### Highlight theme
79
-
80
95
highlightTheme: 'solarized_dark'
81
96
82
97
see [highlight.js](https://highlightjs.org/) for available themes
83
-
98
+
84
99
85
100
#### Markdown
86
101
@@ -98,7 +113,7 @@ see [highlight.js](https://highlightjs.org/) for available themes
98
113
smartypants: false
99
114
}
100
115
101
-
Defaults shown. See documentation for [marked](https://www.npmjs.org/package/marked) for additional details.
116
+
Defaults shown. See documentation for [marked](https://www.npmjs.org/package/marked) for additional details.
0 commit comments