-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Wrong link to glossary definition in generated index file when `…
…glossaries[i].file` config is a glob. Regression related to #133 commit d34feaf721bf83b73157404658d589681cd590e1 Author: about-code <[email protected]> Date: Sun Dec 27 22:35:52 2020 +0100 test: New baseline. commit 40a798113f944d0a96ce00598e105c40bf4ae85c Author: about-code <[email protected]> Date: Sun Dec 27 22:32:27 2020 +0100 test: Add test case commit 9aa55b06c4f59c6a2b1bf247f9a392a16096ab98 Author: about-code <[email protected]> Date: Sun Dec 27 22:01:55 2020 +0100 fix: Wrong link to glossary definition in generated index file when `glossaries[i].file` config is a glob.
- Loading branch information
1 parent
9d88d12
commit 4ada56f
Showing
11 changed files
with
157 additions
and
26 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
5 changes: 5 additions & 0 deletions
5
test/input/config-glossaries/file-glob-and-index/2nd/3rd/glossary3.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,5 @@ | ||
# Glossary 3 | ||
|
||
## Third Level | ||
|
||
Term at the third level in the folder hierarchy. |
5 changes: 5 additions & 0 deletions
5
test/input/config-glossaries/file-glob-and-index/2nd/glossary2.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,5 @@ | ||
# Glossary 2 | ||
|
||
## Second Level | ||
|
||
Test: Mentioning term *Third Level* |
23 changes: 23 additions & 0 deletions
23
test/input/config-glossaries/file-glob-and-index/glossarify-md.conf.json
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,23 @@ | ||
{ | ||
"$schema": "../../../../conf/v5/schema.json", | ||
"baseDir": ".", | ||
"outDir": "../../../output-actual/config-glossaries/file-glob-and-index", | ||
"includeFiles": [ | ||
"." | ||
], | ||
"excludeFiles": [], | ||
"generateFiles": { | ||
"indexFile": { "file": "./index/generated.md"} | ||
}, | ||
"glossaries": [ | ||
{ | ||
"file": "./**/glossary*.md", | ||
"termHint": "~" | ||
} | ||
], | ||
"linking": { | ||
"paths": "relative", | ||
"mentions": "all" | ||
}, | ||
"ignoreCase": false | ||
} |
19 changes: 19 additions & 0 deletions
19
test/input/config-glossaries/file-glob-and-index/glossary.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,19 @@ | ||
# Testing Index generation for glossaries file glob | ||
|
||
- GIVEN a configuration | ||
|
||
~~~json | ||
"generateFiles": { | ||
"indexFile": { "file": "./index/generated.md"} | ||
}, | ||
"glossaries": [{ | ||
"file": "./**/document.md" | ||
}] | ||
~~~ | ||
|
||
- WITH a configuration to generate an Index file into a subdirectory | ||
- AND `glossaries.file` being a glob pattern | ||
- AND this document mentioning term *Second Level* | ||
- AND document `./2nd/glossary.md` mentioning `Third Level` | ||
- THEN the links to term definitions generated in the Index file MUST be relative | ||
- AND MUST begin with `../` to step out of the `./index/` directory |
5 changes: 5 additions & 0 deletions
5
test/output-expected/config-glossaries/file-glob-and-index/2nd/3rd/glossary3.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,5 @@ | ||
# [Glossary 3](#glossary-3) | ||
|
||
## [Third Level](#third-level) | ||
|
||
Term at the third level in the folder hierarchy. |
7 changes: 7 additions & 0 deletions
7
test/output-expected/config-glossaries/file-glob-and-index/2nd/glossary2.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 @@ | ||
# [Glossary 2](#glossary-2) | ||
|
||
## [Second Level](#second-level) | ||
|
||
Test: Mentioning term *[Third Level][1]* | ||
|
||
[1]: ./3rd/glossary3.md#third-level "Term at the third level in the folder hierarchy." |
23 changes: 23 additions & 0 deletions
23
test/output-expected/config-glossaries/file-glob-and-index/glossarify-md.conf.json
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,23 @@ | ||
{ | ||
"$schema": "../../../../conf/v5/schema.json", | ||
"baseDir": ".", | ||
"outDir": "../../../output-actual/config-glossaries/file-glob-and-index", | ||
"includeFiles": [ | ||
"." | ||
], | ||
"excludeFiles": [], | ||
"generateFiles": { | ||
"indexFile": { "file": "./index/generated.md"} | ||
}, | ||
"glossaries": [ | ||
{ | ||
"file": "./**/glossary*.md", | ||
"termHint": "~" | ||
} | ||
], | ||
"linking": { | ||
"paths": "relative", | ||
"mentions": "all" | ||
}, | ||
"ignoreCase": false | ||
} |
26 changes: 26 additions & 0 deletions
26
test/output-expected/config-glossaries/file-glob-and-index/glossary.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,26 @@ | ||
# [Testing Index generation for glossaries file glob](#testing-index-generation-for-glossaries-file-glob) | ||
|
||
* GIVEN a configuration | ||
|
||
```json | ||
"generateFiles": { | ||
"indexFile": { "file": "./index/generated.md"} | ||
}, | ||
"glossaries": [{ | ||
"file": "./**/document.md" | ||
}] | ||
``` | ||
|
||
* WITH a configuration to generate an Index file into a subdirectory | ||
|
||
* AND `glossaries.file` being a glob pattern | ||
|
||
* AND this document mentioning term *[Second Level][1]* | ||
|
||
* AND document `./2nd/glossary.md` mentioning `Third Level` | ||
|
||
* THEN the links to term definitions generated in the Index file MUST be relative | ||
|
||
* AND MUST begin with `../` to step out of the `./index/` directory | ||
|
||
[1]: ./2nd/glossary2.md#second-level "Test: Mentioning term Third Level" |
17 changes: 17 additions & 0 deletions
17
test/output-expected/config-glossaries/file-glob-and-index/index/generated.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,17 @@ | ||
# [Book Index](#book-index) | ||
|
||
## [Second Level](#second-level) | ||
|
||
[Glossary 2][1] ○ [Testing Index generation for glossaries file glob][2] | ||
|
||
## [Third Level](#third-level) | ||
|
||
[Glossary 3][3] ○ [Second Level][4] | ||
|
||
[1]: ../2nd/glossary2.md#second-level "Test: Mentioning term Third Level" | ||
|
||
[2]: ../glossary.md#testing-index-generation-for-glossaries-file-glob | ||
|
||
[3]: ../2nd/3rd/glossary3.md#third-level "Term at the third level in the folder hierarchy." | ||
|
||
[4]: ../2nd/glossary2.md#second-level |
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