fix(common): Start adjusting parameters

This commit is contained in:
Darcy Wong 2023-03-10 10:07:47 +07:00
parent 247dab8fc3
commit 413e77e2ae

View file

@ -1,11 +1,18 @@
#!/usr/bin/env bash
#
# This script contains utilities for converting markdown help documentation to htm/html
# This script contains utilities for converting markdown help documentation to htm/html.
# The apps can then include the htm/html files in the installation to display
# help within the app.
# Expected platforms: android, ios, mac
# Note: linux app doesn't need to convert from markdown to html
#
# Clean the htm/html files and recreate the output folder
# Clean the htm/html files and recreate the output path
# ### Parameters
#
# * `platform` the platform to build, matching the platform folder name
# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform`
#
function _build_help_clean() {
echo "Cleaning"
if [[ "$1" == "android" ]]; then
@ -24,6 +31,10 @@ function _build_help_clean() {
#
# Compile all .md to .html
# ### Parameters
#
# * `platform` the platform to build, matching the platform folder name
# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform`
#
function _build_help_build() {
MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua"
@ -63,24 +74,24 @@ function _build_help_build() {
# Builds .html files from .md source
#
# ### Usage
#
#
# ```bash
# build_help_html platform output_path
# ```
#
#
# ### Parameters
#
#
# * `platform` the platform to build, matching the platform folder name
# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform`
#
#
# ### Description
#
#
# Expects to find .md source under $KEYMAN_ROOT/$platform/help/, and
# will write the output .html to $KEYMAN_ROOT/$platform/$output_path.
#
function build_help_html() {
pushd $(pwd)
_build_help_clean $1
_build_help_build $1
_build_help_clean $1 $2
_build_help_build $1 $2
popd
}