refactor(common): Update to build_help_html params

This commit is contained in:
Darcy Wong 2023-03-10 12:49:37 +07:00
parent 413e77e2ae
commit 3ef331a87e
4 changed files with 10 additions and 23 deletions

View file

@ -115,7 +115,7 @@ fi
# Convert markdown to html for offline help
echo "Converting markdown to html for offline help"
cd "$KEYMAN_ROOT/android"
_help android
build_help_html android KMAPro/kMAPro/src/main/assets/info
cd "$KEYMAN_ROOT/android/KMAPro"
# Download default keyboard and dictionary

View file

@ -17,7 +17,6 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
cd "$(dirname "$THIS_SCRIPT")"
# Include our resource functions; they're pretty useful!
. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh"
. "$KEYMAN_ROOT/resources/build/build-download-resources.sh"
. "$KEYMAN_ROOT/resources/build/build-help.inc.sh"
@ -252,7 +251,7 @@ echo "KMEI build complete."
if [ $DO_KEYMANAPP = true ]; then
echo ""
echo "Building offline help."
_help ios
build_help_html ios keyman/Keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources
echo ""
echo "Building Keyman app."

View file

@ -366,7 +366,7 @@ fi
if $DO_KEYMANIM ; then
if $DO_HELP ; then
echo "Building help"
_help mac
build_help_html mac Keyman4MacIM/Keyman4MacIM/Help
fi
builder_heading "Building Keyman.app"

View file

@ -15,13 +15,8 @@
#
function _build_help_clean() {
echo "Cleaning"
if [[ "$1" == "android" ]]; then
DESTHTM="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/info"
elif [[ "$1" == "ios" ]]; then
DESTHTM="$KEYMAN_ROOT/ios/keyman/Keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources"
elif [[ "$1" == "mac" ]]; then
DESTHTM="$KEYMAN_ROOT/mac/Keyman4MacIM/Keyman4MacIM/Help"
fi
local PLATFORM="$1"
local DESTHTM="$KEYMAN_ROOT/$PLATFORM/$2"
echo "rm DESTHTM: $DESTHTM"
rm -rf "$DESTHTM"
@ -37,20 +32,13 @@ function _build_help_clean() {
# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform`
#
function _build_help_build() {
MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua"
CSS="$KEYMAN_ROOT/resources/build/offline-help-style-spec.txt"
DESTHTM=
PLATFORM="$1"
local MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua"
local CSS="$KEYMAN_ROOT/resources/build/offline-help-style-spec.txt"
local PLATFORM="$1"
cd "$KEYMAN_ROOT/$PLATFORM/help"
MD=`find . -name "*.md"`
if [[ "$1" == "android" ]]; then
DESTHTM="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/info"
elif [[ "$1" == "ios" ]]; then
DESTHTM="$KEYMAN_ROOT/ios/keyman/Keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources"
elif [[ "$1" == "mac" ]]; then
DESTHTM="$KEYMAN_ROOT/mac/Keyman4MacIM/Keyman4MacIM/Help"
fi
local MD=`find . -name "*.md"`
local DESTHTM="$KEYMAN_ROOT/$PLATFORM/$2"
#
# Generate HTML files from Markdown