mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Merge branch 'luadoc_docker' into 'master'
Support generating Lua API reference from self-built docker container See merge request OpenMW/openmw!2124
This commit is contained in:
commit
6693061795
26
docs/source/Dockerfile.luadoc
Normal file
26
docs/source/Dockerfile.luadoc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
apt install -y make gcc libreadline-dev wget unzip git zip && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ADD https://www.lua.org/ftp/lua-5.1.5.tar.gz /tmp/lua-5.1.5.tar.gz
|
||||||
|
RUN tar -zxf /tmp/lua-5.1.5.tar.gz -C /tmp && rm /tmp/lua-5.1.5.tar.gz
|
||||||
|
RUN cd /tmp/lua-5.1.5 && \
|
||||||
|
make linux -j $(nproc) && \
|
||||||
|
make install && \
|
||||||
|
rm -r /tmp/lua-5.1.5
|
||||||
|
|
||||||
|
ADD https://luarocks.org/releases/luarocks-2.4.2.tar.gz /tmp/luarocks-2.4.2.tar.gz
|
||||||
|
RUN tar -zxpf /tmp/luarocks-2.4.2.tar.gz -C /tmp && rm /tmp/luarocks-2.4.2.tar.gz
|
||||||
|
RUN cd /tmp/luarocks-2.4.2 && \
|
||||||
|
./configure && \
|
||||||
|
make build -j $(nproc) && \
|
||||||
|
make install && \
|
||||||
|
rm -r /tmp/luarocks-2.4.2
|
||||||
|
|
||||||
|
ADD https://gitlab.com/ptmikheev/openmw-luadocumentor/-/raw/master/luarocks/openmwluadocumentor-0.1.1-1.rockspec /tmp/openmwluadocumentor-0.1.1-1.rockspec
|
||||||
|
RUN cd /tmp && \
|
||||||
|
luarocks pack openmwluadocumentor-0.1.1-1.rockspec && \
|
||||||
|
luarocks install openmwluadocumentor-0.1.1-1.src.rock && \
|
||||||
|
rm /tmp/openmwluadocumentor-0.1.1-1.rockspec /tmp/openmwluadocumentor-0.1.1-1.src.rock
|
18
docs/source/README.md
Normal file
18
docs/source/README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Source files for OpenMW documentation
|
||||||
|
|
||||||
|
## Generating Lua scripting API reference
|
||||||
|
|
||||||
|
### Building Docker image
|
||||||
|
|
||||||
|
Run following command from OpenMW source directory to build a new Docker image `openmw.luadoc`:
|
||||||
|
```bash
|
||||||
|
docker build -f docs/source/Dockerfile.luadoc -t openmw.luadoc docs/source
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generating HTML
|
||||||
|
|
||||||
|
Run following command from OpenMW source directory to generate HTML pages:
|
||||||
|
```bash
|
||||||
|
docker run --rm --tty --interactive --user "$(id -u)":"$(id -g)" \
|
||||||
|
--volume "${PWD}":/openmw openmw.luadoc /openmw/docs/source/generate_luadoc_in_docker.sh
|
||||||
|
```
|
22
docs/source/generate_luadoc_in_docker.sh
Executable file
22
docs/source/generate_luadoc_in_docker.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
if ! [[ -f "/.dockerenv" ]]; then
|
||||||
|
echo "Run this script inside Docker container" >&2
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILES_DIR=/openmw/files
|
||||||
|
OUTPUT_DIR=/openmw/docs/source/reference/lua-scripting/generated_html
|
||||||
|
|
||||||
|
rm -rf "${OUTPUT_DIR}"
|
||||||
|
mkdir "${OUTPUT_DIR}"
|
||||||
|
|
||||||
|
cd "${FILES_DIR}/lua_api"
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" openmw/*lua
|
||||||
|
|
||||||
|
cd "${FILES_DIR}/data"
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" openmw_aux/*lua
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" scripts/omw/ai.lua
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" scripts/omw/camera/camera.lua
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" scripts/omw/mwui/init.lua
|
||||||
|
openmwluadocumentor -f doc -d "${OUTPUT_DIR}" scripts/omw/settings/player.lua
|
Loading…
x
Reference in New Issue
Block a user