-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Lua doc into sphinx doc (issue #5931)
- Loading branch information
1 parent
4eb5841
commit 25cc884
Showing
18 changed files
with
295 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#luadoc tt { font-family: monospace; } | ||
|
||
#luadoc p, | ||
#luadoc td, | ||
#luadoc th { font-size: .95em; line-height: 1.2em;} | ||
|
||
#luadoc p, | ||
#luadoc ul | ||
{ margin: 10px 0 0 10px;} | ||
|
||
#luadoc strong { font-weight: bold;} | ||
|
||
#luadoc em { font-style: italic;} | ||
|
||
#luadoc h1 { | ||
font-size: 1.5em; | ||
margin: 25px 0 20px 0; | ||
} | ||
#luadoc h2, | ||
#luadoc h3, | ||
#luadoc h4 { margin: 15px 0 10px 0; } | ||
#luadoc h2 { font-size: 1.25em; } | ||
#luadoc h3 { font-size: 1.15em; } | ||
#luadoc h4 { font-size: 1.06em; } | ||
|
||
#luadoc hr { | ||
color:#cccccc; | ||
background: #00007f; | ||
height: 1px; | ||
} | ||
|
||
#luadoc blockquote { margin-left: 3em; } | ||
|
||
#luadoc ul { list-style-type: disc; } | ||
|
||
#luadoc p.name { | ||
font-family: "Andale Mono", monospace; | ||
padding-top: 1em; | ||
} | ||
|
||
#luadoc p:first-child { | ||
margin-top: 0px; | ||
} | ||
|
||
#luadoc table.function_list { | ||
border-width: 1px; | ||
border-style: solid; | ||
border-color: #cccccc; | ||
border-collapse: collapse; | ||
} | ||
#luadoc table.function_list td { | ||
border-width: 1px; | ||
padding: 3px; | ||
border-style: solid; | ||
border-color: #cccccc; | ||
} | ||
|
||
#luadoc table.function_list td.name { background-color: #f0f0f0; } | ||
#luadoc table.function_list td.summary { width: 100%; } | ||
|
||
#luadoc dl.table dt, | ||
#luadoc dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} | ||
#luadoc dl.table dd, | ||
#luadoc dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} | ||
#luadoc dl.table h3, | ||
#luadoc dl.function h3 {font-size: .95em;} | ||
|
||
|
||
|
||
#luadoc pre.example { | ||
background-color: #eeffcc; | ||
border: 1px solid #e1e4e5; | ||
padding: 10px; | ||
margin: 10px 0 10px 0; | ||
overflow-x: auto; | ||
} | ||
|
||
#luadoc code { | ||
background-color: inherit; | ||
color: inherit; | ||
border: none; | ||
font-family: monospace; | ||
} | ||
|
||
#luadoc pre.example code { | ||
color: #404040; | ||
background-color: #eeffcc; | ||
border: none; | ||
white-space: pre; | ||
padding: 0px; | ||
} | ||
|
||
#luadoc dt { | ||
background: inherit; | ||
color: inherit; | ||
width: 100%; | ||
padding: 0px; | ||
} | ||
|
||
#luadoc a:not(:link) { | ||
font-weight: bold; | ||
color: #000; | ||
text-decoration: none; | ||
cursor: inherit; | ||
} | ||
#luadoc a:link { font-weight: bold; color: #004080; text-decoration: none; } | ||
#luadoc a:visited { font-weight: bold; color: #006699; text-decoration: none; } | ||
#luadoc a:link:hover { text-decoration: underline; } | ||
|
||
#luadoc dl, | ||
#luadoc dd {margin: 0px; line-height: 1.2em;} | ||
#luadoc li {list-style: bullet;} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# How to install openmwluadocumentor: | ||
|
||
# sudo apt install luarocks | ||
# git clone https://gitlab.com/ptmikheev/openmw-luadocumentor.git | ||
# cd openmw-luadocumentor/luarocks | ||
# luarocks --local pack openmwluadocumentor-0.1.1-1.rockspec | ||
# luarocks --local install openmwluadocumentor-0.1.1-1.src.rock | ||
|
||
if [ -f /.dockerenv ]; then | ||
# We are inside readthedocs pipeline | ||
echo "Install lua 5.1" | ||
cd ~ | ||
curl -R -O https://www.lua.org/ftp/lua-5.1.5.tar.gz | ||
tar -zxf lua-5.1.5.tar.gz | ||
cd lua-5.1.5/ | ||
make linux | ||
PATH=$PATH:~/lua-5.1.5/src | ||
|
||
echo "Install luarocks" | ||
cd ~ | ||
wget https://luarocks.org/releases/luarocks-2.4.2.tar.gz | ||
tar zxpf luarocks-2.4.2.tar.gz | ||
cd luarocks-2.4.2/ | ||
./configure --with-lua-bin=$HOME/lua-5.1.5/src --with-lua-include=$HOME/lua-5.1.5/src --prefix=$HOME/luarocks | ||
make build | ||
make install | ||
PATH=$PATH:~/luarocks/bin | ||
|
||
echo "Install openmwluadocumentor" | ||
cd ~ | ||
git clone https://gitlab.com/ptmikheev/openmw-luadocumentor.git | ||
cd openmw-luadocumentor/luarocks | ||
luarocks --local install checks | ||
luarocks --local pack openmwluadocumentor-0.1.1-1.rockspec | ||
luarocks --local install openmwluadocumentor-0.1.1-1.src.rock | ||
fi | ||
|
||
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 | ||
|
||
rm -f $OUTPUT_DIR/*.html | ||
|
||
cd $FILES_DIR/lua_api | ||
~/.luarocks/bin/openmwluadocumentor -f doc -d $OUTPUT_DIR openmw/*lua | ||
|
||
cd $FILES_DIR/builtin_scripts | ||
~/.luarocks/bin/openmwluadocumentor -f doc -d $OUTPUT_DIR openmw_aux/*lua | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Engine handlers reference | ||
========================= | ||
|
||
Engine handler is a function defined by a script, that can be called by the engine. | ||
|
||
+---------------------------------------------------------------------------------------------------------+ | ||
| **Can be defined by any script** | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onUpdate(dt) | | Called every frame if game not paused. `dt` is the time | | ||
| | | from the last update in seconds. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onSave() -> data | | Called when the game is saving. May be called in inactive | | ||
| | | state, so it shouldn't use `openmw.nearby`. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onLoad(data) | | Called on loading with the data previosly returned by | | ||
| | | onSave. During loading the object is always inactive. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| **Only for global scripts** | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onNewGame() | New game is started | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onPlayerAdded(player) | Player added to the game world. The argument is a `Game object`. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onActorActive(actor) | Actor (NPC or Creature) becomes active. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| **Only for local scripts** | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onActive() | | Called when the object becomes active (either a player | | ||
| | | came to this cell again, or a save was loaded). | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onInactive() | | Object became inactive. Since it is inactive the handler | | ||
| | | can not access anything nearby, but it is possible to send | | ||
| | | an event to global scripts. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onConsume(recordId) | | Called if `recordId` (e.g. a potion) is consumed. | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| **Only for local scripts attached to a player** | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
| onKeyPress(key) | | `Key <openmw_core.html##(KeyboardEvent)>`_ pressed. Usage example: | | ||
| | | ``if key.symbol == 'z' and key.withShift then ...`` | | ||
+----------------------------------+----------------------------------------------------------------------+ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ OpenMW Lua scripting | |
|
||
.. toctree:: | ||
:caption: Table of Contents | ||
:includehidden: | ||
:maxdepth: 2 | ||
|
||
overview | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package openmw.async | ||
==================== | ||
|
||
.. raw:: html | ||
:file: generated_html/openmw_async.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package openmw_aux.util | ||
======================= | ||
|
||
.. raw:: html | ||
:file: generated_html/openmw_aux_util.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package openmw.core | ||
=================== | ||
|
||
.. raw:: html | ||
:file: generated_html/openmw_core.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package openmw.nearby | ||
===================== | ||
|
||
.. raw:: html | ||
:file: generated_html/openmw_nearby.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Package openmw.query | ||
==================== | ||
|
||
.. raw:: html | ||
:file: generated_html/openmw_query.html |
Oops, something went wrong.