-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOCSTOOLS-794: support link mode to include tocs
- Loading branch information
1 parent
f5a40a6
commit 8ec12a0
Showing
16 changed files
with
136 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {compareDirectories, runYfmDocs, getTestPaths} from './utils'; | ||
|
||
describe('Include toc', () => { | ||
test('Test1', () => { | ||
const testRootPath = './tests/mocks/include-toc/test1'; | ||
const {inputPath, outputPath, expectedOutputPath} = getTestPaths(testRootPath); | ||
|
||
runYfmDocs(inputPath, outputPath); | ||
|
||
const compareResult = compareDirectories(outputPath, expectedOutputPath); | ||
|
||
if (typeof compareResult === 'boolean') { | ||
expect(true).toEqual(compareResult); | ||
} else { | ||
const {expectedContent, outputContent} = compareResult; | ||
|
||
expect(expectedContent).toEqual(outputContent); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /a1.md file content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /folder1/a1.md file content. |
1 change: 1 addition & 0 deletions
1
tests/mocks/include-toc/test1/expected-output/folder1/folder2/a1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /folder1/folder1/a1.md file content. |
12 changes: 12 additions & 0 deletions
12
tests/mocks/include-toc/test1/expected-output/folder1/toc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
items: | ||
- name: A1 | ||
href: a1.md | ||
- name: folder1 | ||
items: | ||
- name: A1 | ||
href: folder1/a1.md | ||
- name: folder1 | ||
items: | ||
- name: A1 | ||
href: folder1/folder2/a1.md | ||
base: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
items: | ||
- name: A1 | ||
href: a1.md | ||
- name: folder1 | ||
items: | ||
- name: A1 | ||
href: folder1/a1.md | ||
- name: folder1 | ||
items: | ||
- name: A1 | ||
href: folder1/folder2/a1.md | ||
base: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /a1.md file content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /folder1/a1.md file content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is the /folder1/folder1/a1.md file content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
items: | ||
- name: A1 | ||
href: a1.md | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
items: | ||
- name: A1 | ||
href: a1.md | ||
- name: folder1 | ||
include: | ||
mode: link | ||
path: folder2/toc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
items: | ||
- name: A1 | ||
href: a1.md | ||
- name: folder1 | ||
include: | ||
mode: link | ||
path: folder1/toc.yaml | ||
|
||
|