2022-07-19 22:25:46 +00:00
|
|
|
#!/bin/bash
|
2021-04-25 00:55:08 +02:00
|
|
|
|
2022-07-19 22:25:46 +00:00
|
|
|
DOCS_SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
FILES_DIR=$DOCS_SOURCE_DIR/../../files
|
|
|
|
OUTPUT_DIR=$DOCS_SOURCE_DIR/reference/lua-scripting/generated_html
|
|
|
|
|
2023-02-20 22:43:45 +01:00
|
|
|
if ! command -v openmwluadocumentor &> /dev/null
|
|
|
|
then
|
2022-08-09 09:29:02 +00:00
|
|
|
if [ -f /.dockerenv ] || [ -f /home/docs/omw_luadoc_docker ]; then
|
2023-02-11 14:09:41 +01:00
|
|
|
./install_luadocumentor_in_docker.sh
|
2022-08-09 09:29:02 +00:00
|
|
|
fi
|
|
|
|
fi
|
2023-02-20 22:43:45 +01:00
|
|
|
|
|
|
|
PATH=$PATH:~/luarocks/bin
|
|
|
|
eval "$(luarocks path)"
|
|
|
|
|
|
|
|
if ! command -v openmwluadocumentor &> /dev/null
|
|
|
|
then
|
2022-08-09 09:29:02 +00:00
|
|
|
echo "openmwluadocumentor not found; See README.md for installation instructions."
|
|
|
|
exit
|
2021-11-18 15:19:54 +00:00
|
|
|
fi
|
2021-04-25 00:55:08 +02:00
|
|
|
|
2022-07-19 22:25:46 +00:00
|
|
|
rm -f $OUTPUT_DIR/*.html
|
2021-04-25 00:55:08 +02:00
|
|
|
|
2023-01-26 23:31:27 +01:00
|
|
|
data_paths=$($DOCS_SOURCE_DIR/luadoc_data_paths.sh)
|
|
|
|
|
2022-07-19 22:25:46 +00:00
|
|
|
cd $FILES_DIR/lua_api
|
2023-02-20 19:18:34 +01:00
|
|
|
openmwluadocumentor -f doc -d $OUTPUT_DIR openmw/*lua
|
2022-07-19 22:25:46 +00:00
|
|
|
cd $FILES_DIR/data
|
2023-01-26 23:31:27 +01:00
|
|
|
for path in $data_paths
|
|
|
|
do
|
2023-02-20 19:18:34 +01:00
|
|
|
openmwluadocumentor -f doc -d $OUTPUT_DIR $path
|
2023-01-26 23:31:27 +01:00
|
|
|
done
|