-
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.
feat: New option
linking.pathComponents
(#173)
* feat: Path components * test: New test cases. * test: New baseline. * doc: Update config schema docs
- Loading branch information
1 parent
1e7e658
commit 1a2fdd6
Showing
65 changed files
with
1,456 additions
and
36 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
conf/v5/doc/schema-defs-linking-properties-pathcomponents-items.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,9 @@ | ||
## items Constraints | ||
|
||
**enum**: the value of this property must be equal to one of the following values: | ||
|
||
| Value | Explanation | | ||
| :------- | :---------- | | ||
| `"path"` | | | ||
| `"file"` | | | ||
| `"ext"` | | |
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,3 @@ | ||
## pathComponents Constraints | ||
|
||
**maximum number of items**: the maximum number of items for this array is: `3` |
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
23 changes: 23 additions & 0 deletions
23
.../input/config-linking/paths-absolute-pathComponents/path-file-ext/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-linking/paths-absolute-pathComponents/path-file-ext", | ||
"linking": { | ||
"baseUrl": "http://localhost/", | ||
"paths": "absolute", | ||
"pathComponents": ["path", "file", "ext"] | ||
}, | ||
"generateFiles": { | ||
"listOfTables": { | ||
"file": "./tables.md" | ||
}, | ||
"listOfFigures": { | ||
"file": "./figures.md" | ||
}, | ||
"listOf": [{ | ||
"class": "foo", | ||
"file": "./foo.md" | ||
}] | ||
}, | ||
"glossaries": [{ "file": "./glossary.md" } ] | ||
} |
5 changes: 5 additions & 0 deletions
5
test/input/config-linking/paths-absolute-pathComponents/path-file-ext/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,5 @@ | ||
# Glossary | ||
|
||
## Term | ||
|
||
Term definition. |
67 changes: 67 additions & 0 deletions
67
...ut/config-linking/paths-absolute-pathComponents/path-file-ext/sub-1/document.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,67 @@ | ||
# Document | ||
|
||
GIVEN a configuration | ||
|
||
~~~json | ||
{ | ||
"linking": { | ||
"baseUrl": "http://localhost/", | ||
"paths": "absolute", | ||
"pathComponents": ["path", "file", "ext"] | ||
}, | ||
"generateFiles": { | ||
"listOfTables": { | ||
"file": "./tables.md" | ||
}, | ||
"listOfFigures": { | ||
"file": "./figures.md" | ||
}, | ||
"listOf": [{ | ||
"class": "foo", | ||
"file": "./foo.md" | ||
}] | ||
}, | ||
} | ||
~~~ | ||
|
||
WITH `baseUrl` being terminated by `/`... | ||
|
||
## Term Links | ||
|
||
...WITH this document mentioning glossary term *Term* | ||
THEN the term must be linked | ||
AND the link url MUST be `http://localhost/glossary.md#Term` | ||
|
||
## List Of Tables | ||
|
||
...WITH a configuration `listOfTable` | ||
AND and a table | ||
|
||
*A table:* | ||
|
||
| Head 1 | Head 2 | | ||
| ------ | ------ | | ||
| Item 1 | Item 2 | | ||
|
||
THEN a file `./tables.md` MUST be generated | ||
AND there MUST be a list item with caption *A table:* | ||
AND the list item must be linked | ||
AND the link MUST be `http://localhost/sub-1/document.md#a-table`. | ||
|
||
## List Of Figures | ||
|
||
...WITH a configuration `listOfFigure` | ||
AND and a figure ![My Figure](./not-found.png) | ||
THEN a file `./figures.md` MUST be generated | ||
AND there MUST be a list item with caption *My Figure* | ||
AND the list item must be linked | ||
AND the link MUST be `http://localhost/sub-1/document.md#my-figure`. | ||
|
||
## List Of Foo | ||
|
||
...WITH a configuration `listOfFigure` | ||
AND and a <span id="foo-bar">Foo</span> | ||
THEN a file `./foo.md` MUST be generated | ||
AND there MUST be a list item with caption *Foo* | ||
AND the list item must be linked | ||
AND the link MUST be `http://localhost/sub-1/document.md#foo-bar`. |
23 changes: 23 additions & 0 deletions
23
test/input/config-linking/paths-absolute-pathComponents/path-file/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-linking/paths-absolute-pathComponents/path-file", | ||
"linking": { | ||
"baseUrl": "http://localhost/", | ||
"paths": "absolute", | ||
"pathComponents": ["path", "file"] | ||
}, | ||
"generateFiles": { | ||
"listOfTables": { | ||
"file": "./tables.md" | ||
}, | ||
"listOfFigures": { | ||
"file": "./figures.md" | ||
}, | ||
"listOf": [{ | ||
"class": "foo", | ||
"file": "./foo.md" | ||
}] | ||
}, | ||
"glossaries": [{ "file": "./glossary.md" } ] | ||
} |
5 changes: 5 additions & 0 deletions
5
test/input/config-linking/paths-absolute-pathComponents/path-file/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,5 @@ | ||
# Glossary | ||
|
||
## Term | ||
|
||
Term definition. |
Oops, something went wrong.