mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 08:55:34 +00:00
Refreshes all of the public API header documentation so we have a single source for the documentation -- the keyman_core_api.h header. A lot of reformatting but very little change in terms of content. This is converted into Markdown by api-header-extractor, and the results can be copied to help.keyman.com. Will only do the main keyman_core_api.h for v17 release, in interests of time. The other headers are primarily internal only and have many deprecated functions also. Will also leave the full automation of the documentation generation to a future PR. The script will be there but it won't run during build for now.
36 lines
1.2 KiB
Bash
Executable file
36 lines
1.2 KiB
Bash
Executable file
#!/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/build-utils.sh"
|
|
## END STANDARD BUILD SCRIPT INCLUDE
|
|
|
|
CORE_ROOT="$KEYMAN_ROOT/core"
|
|
CORE_H_FILE="$CORE_ROOT/include/keyman/keyman_core_api.h"
|
|
CORE_H_DOC="index.md"
|
|
OUTPATH="$CORE_ROOT/build/doc"
|
|
|
|
################################ Main script ################################
|
|
|
|
builder_describe "Extract documentation from header files" clean configure build run
|
|
builder_parse "$@"
|
|
|
|
builder_run_action clean rm -rf "${OUTPATH}"
|
|
builder_run_action build tsc --build
|
|
|
|
if builder_start_action run; then
|
|
rm -rf "$OUTPATH"
|
|
mkdir -p "$OUTPATH"
|
|
node --enable-source-maps ./build/src/index.js "${CORE_H_FILE}" "${OUTPATH}"
|
|
echo "Wrote documentation to ${OUTPATH}/${CORE_H_DOC}"
|
|
|
|
# if [ ! -z "${HELP_KEYMAN_COM+x}" ]; then
|
|
# # TODO move this to help-keyman-com.sh
|
|
# rm -rf "${HELP_KEYMAN_COM}developer/core/desktop/17.0/c-api/"
|
|
# mkdir -p "${HELP_KEYMAN_COM}developer/core/desktop/17.0/c-api/"
|
|
# cp "${OUTPATH}/"* "${HELP_KEYMAN_COM}developer/core/desktop/17.0/c-api/"
|
|
# fi
|
|
|
|
builder_finish_action success run
|
|
fi
|
|
|