@readme/cli 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/dev/lib/docs.js +2 -2
- package/src/validators/nesting.js +9 -4
package/package.json
CHANGED
package/src/dev/lib/docs.js
CHANGED
|
@@ -25,8 +25,8 @@ const SECTIONS = [
|
|
|
25
25
|
// Max folder nesting per section — anything deeper doesn't render in ReadMe's
|
|
26
26
|
// sidebar, so we mirror the cap here. Keep in sync with src/validators/nesting.js.
|
|
27
27
|
const MAX_DEPTH = {
|
|
28
|
-
docs:
|
|
29
|
-
reference:
|
|
28
|
+
docs: 5,
|
|
29
|
+
reference: 5,
|
|
30
30
|
recipes: 0,
|
|
31
31
|
custom_pages: 0,
|
|
32
32
|
};
|
|
@@ -4,9 +4,14 @@ export const name = 'nesting';
|
|
|
4
4
|
|
|
5
5
|
// Max folder nesting per top-level content dir. Anything deeper still syncs
|
|
6
6
|
// but won't appear in the sidebar.
|
|
7
|
+
//
|
|
8
|
+
// For `docs` and `reference` the category is the first folder and each page
|
|
9
|
+
// level below it adds one, so this is the number of page levels the sidebar
|
|
10
|
+
// renders under a category. It mirrors our publicly documented sidebar levels.
|
|
11
|
+
// Keep in sync with src/dev/lib/docs.js.
|
|
7
12
|
const MAX_DEPTH = {
|
|
8
|
-
docs:
|
|
9
|
-
reference:
|
|
13
|
+
docs: 5,
|
|
14
|
+
reference: 5,
|
|
10
15
|
recipes: 0,
|
|
11
16
|
custom_pages: 0,
|
|
12
17
|
custom_blocks: 0,
|
|
@@ -23,8 +28,8 @@ export function validateAll(files) {
|
|
|
23
28
|
if (max === undefined) continue;
|
|
24
29
|
|
|
25
30
|
// Depth = number of folders between the top dir and the file.
|
|
26
|
-
// docs/a/b/c/page.md → parts.length
|
|
27
|
-
// docs/a/b/c/d/page.md → parts.length
|
|
31
|
+
// docs/a/b/c/d/e/page.md → parts.length 7 → depth 5
|
|
32
|
+
// docs/a/b/c/d/e/f/page.md → parts.length 8 → depth 6
|
|
28
33
|
const depth = parts.length - 2;
|
|
29
34
|
if (depth <= max) continue;
|
|
30
35
|
|