mirror of
https://codeberg.org/AntumLuanti/mod-cleaner.git
synced 2025-03-21 15:41:22 +00:00
LDoc: move files for generating docs into ".ldoc" directory
This commit is contained in:
parent
99544d286f
commit
c13f78b471
5 changed files with 41 additions and 17 deletions
|
@ -20,7 +20,7 @@ file = {
|
||||||
"api.lua",
|
"api.lua",
|
||||||
"chat.lua",
|
"chat.lua",
|
||||||
"tools.lua",
|
"tools.lua",
|
||||||
"docs/config.luadoc",
|
".ldoc/config.luadoc",
|
||||||
}
|
}
|
||||||
|
|
||||||
new_type("chatcmd", "Chat Commands")
|
new_type("chatcmd", "Chat Commands")
|
||||||
|
@ -49,7 +49,7 @@ custom_tags = {
|
||||||
"img",
|
"img",
|
||||||
title = "Image",
|
title = "Image",
|
||||||
format = function(value)
|
format = function(value)
|
||||||
return "<img src=\"../../../textures/" .. value .. "\" style=\"width:32px; height:32px;\" />"
|
return "<img src=\"../data/" .. value .. "\" style=\"width:32px; height:32px;\" />"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,6 @@ local function format_setting_tag(desc, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setting_handler(item)
|
local function setting_handler(item)
|
||||||
print("\nsetting_handler: " .. item.name)
|
|
||||||
|
|
||||||
if not ipairs or not type then
|
if not ipairs or not type then
|
||||||
return item
|
return item
|
||||||
end
|
end
|
39
.ldoc/gendoc.sh
Executable file
39
.ldoc/gendoc.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# place this file in mod ".ldoc" directory
|
||||||
|
|
||||||
|
|
||||||
|
d_ldoc="$(dirname $(readlink -f $0))"
|
||||||
|
f_config="${d_ldoc}/config.ld"
|
||||||
|
|
||||||
|
cd "${d_ldoc}/.."
|
||||||
|
|
||||||
|
d_root="$(pwd)"
|
||||||
|
d_ref="${d_root}/docs/reference"
|
||||||
|
d_data="${d_ref}/data"
|
||||||
|
|
||||||
|
cmd_ldoc="${d_ldoc}/ldoc/ldoc.lua"
|
||||||
|
if test ! -x "${cmd_ldoc}"; then
|
||||||
|
cmd_ldoc="ldoc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# clean old files
|
||||||
|
rm -rf "${d_ref}"
|
||||||
|
|
||||||
|
# create new files
|
||||||
|
"${cmd_ldoc}" --UNSAFE_NO_SANDBOX -c "${f_config}" -d "${d_ref}" "${d_root}"
|
||||||
|
|
||||||
|
# check exit status
|
||||||
|
retval=$?
|
||||||
|
if test ${retval} -ne 0; then
|
||||||
|
exit ${retval}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# copy textures to data directory
|
||||||
|
echo -e "\ncopying textures ..."
|
||||||
|
mkdir -p "${d_data}"
|
||||||
|
for png in $(find "${d_root}/textures" -maxdepth 1 -type f -name "*.png"); do
|
||||||
|
cp -v "${png}" "${d_data}"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -e "\nDone!"
|
|
@ -1,13 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
docs="$(dirname $(readlink -f $0))"
|
|
||||||
root="$(dirname ${docs})"
|
|
||||||
config="${docs}/config.ld"
|
|
||||||
|
|
||||||
cd "${root}"
|
|
||||||
|
|
||||||
# Clean old files
|
|
||||||
rm -rf "${docs}/reference"
|
|
||||||
|
|
||||||
# Create new files
|
|
||||||
ldoc --UNSAFE_NO_SANDBOX -c "${config}" -d "${docs}/reference" "${root}"
|
|
Loading…
Add table
Reference in a new issue