-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12472 from keymanapp/feat/common/12347-check-mark…
…down-links test(common): add markdown link check test for product documentation
- Loading branch information
Showing
19 changed files
with
369 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
## START STANDARD BUILD SCRIPT INCLUDE | ||
# adjust relative paths as necessary | ||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" | ||
. "${THIS_SCRIPT%/*}/../resources/build/builder.inc.sh" | ||
## END STANDARD BUILD SCRIPT INCLUDE | ||
|
||
# Include our resource functions; they're pretty useful! | ||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" | ||
|
||
# Please note that this build script (understandably) assumes that it is running on Mac OS X. | ||
verify_on_mac | ||
|
||
builder_describe "Builds Keyman Engine and the Keyman app for use on iOS devices - iPhone and iPad." \ | ||
"@/resources/tools/check-markdown test:help" \ | ||
"clean" \ | ||
"configure" \ | ||
"build" \ | ||
"test" \ | ||
":engine Builds KeymanEngine.xcframework, usable by our main app and by third-party apps" \ | ||
":app=keyman Builds the Keyman app for iOS platforms" \ | ||
":help Online documentation" \ | ||
":sample1=Samples/KMSample1 Builds the first KeymanEngine sample app" \ | ||
":sample2=Samples/KMSample2 Builds the second KeymanEngine sample app" \ | ||
":fv=../oem/firstvoices/ios Builds OEM FirstVoices for iOS platforms" \ | ||
"--sim-artifact+ Also outputs a simulator-friendly test artifact corresponding to the build" | ||
|
||
builder_parse "$@" | ||
|
||
builder_run_child_actions clean configure build | ||
builder_run_child_actions clean configure build test | ||
builder_run_action test:help check-markdown "$KEYMAN_ROOT/ios/docs/help" |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
build/ |
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 @@ | ||
# check-markdown | ||
|
||
This tool is used to test the validity of internal links within product | ||
documentation, e.g. `/android/docs/help/**/*.md`. | ||
|
||
It currently tests that: | ||
|
||
1. Markdown can be parsed | ||
2. Links to other files in the same section exist (with or without .md extension) | ||
3. Images exist | ||
|
||
It will also optionally report on: | ||
|
||
1. External absolute links (starting with http/https) | ||
2. Relative links outside the root of the help documentation | ||
3. Unnecessary use of .md extension in links | ||
|
||
We could extend it to include: | ||
|
||
1. Checks for anchor validity |
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 @@ | ||
#!/usr/bin/env bash | ||
## START STANDARD BUILD SCRIPT INCLUDE | ||
# adjust relative paths as necessary | ||
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" | ||
. "${THIS_SCRIPT%/*}/../../../resources/build/builder.inc.sh" | ||
## END STANDARD BUILD SCRIPT INCLUDE | ||
|
||
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" | ||
|
||
################################ Main script ################################ | ||
|
||
builder_describe "Check markdown internal links" \ | ||
"clean" \ | ||
"configure" \ | ||
"build" | ||
|
||
builder_describe_outputs \ | ||
configure /node_modules \ | ||
build build/index.js | ||
|
||
builder_parse "$@" | ||
|
||
builder_run_action clean rm -rf build/ tsconfig.tsbuildinfo | ||
builder_run_action configure verify_npm_setup | ||
builder_run_action build tsc --build | ||
# builder_run_action test mocha |
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,11 @@ | ||
{ | ||
"name": "check-markdown", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"main": "build/index.js", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"marked": "^14.1.2", | ||
"chalk": "^2.4.2" | ||
} | ||
} |
Oops, something went wrong.