Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs validator #1

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/docs_verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Docs validator

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
check:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v2
- name: Checking if all the types are documented in the API doc
run: |
cd docs
python validator.py
15 changes: 15 additions & 0 deletions docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"const char*": "string",
"wstring": "string",
"u16string": "string",
"string_view": "string",
"char16_t": "string",
"pair<": "tuple<",
"std::": "",
Expand Down Expand Up @@ -618,7 +619,7 @@ def print_lf(lf):
for cat in sorted(type_cats[type_cat], key=lambda x: x):
print("\n## " + cat + "\n")
for type in sorted(type_cats[type_cat][cat], key=lambda x: x["name"]):
if type["comment"] and "NoDoc" in type["comment"]:
if "comment" in type and "NoDoc" in type["comment"]:
continue
type_name = type["name"]
print("\n### " + type_name + "\n")
Expand All @@ -627,7 +628,7 @@ def print_lf(lf):
for com in type["comment"]:
com = link_custom_type(com)
print(com)
if type["base"]:
if "base" in type and type["base"]:
print("Derived from", end="")
bases = type["base"].split(",")
for base in bases:
Expand Down
58 changes: 58 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,9 @@
<li>
<a href="#Letter" class="toc-h3 toc-link" data-title="Letter">Letter</a>
</li>
<li>
<a href="#MagmamanSpawnPosition" class="toc-h3 toc-link" data-title="MagmamanSpawnPosition">MagmamanSpawnPosition</a>
</li>
<li>
<a href="#MovableBehavior" class="toc-h3 toc-link" data-title="MovableBehavior">MovableBehavior</a>
</li>
Expand Down Expand Up @@ -1825,6 +1828,9 @@
<li>
<a href="#LogicTiamatCutscene" class="toc-h3 toc-link" data-title="LogicTiamatCutscene">LogicTiamatCutscene</a>
</li>
<li>
<a href="#LogicVolcana" class="toc-h3 toc-link" data-title="LogicVolcana">LogicVolcana</a>
</li>
</ul>
</li>
<li>
Expand Down Expand Up @@ -8796,6 +8802,37 @@ <h3 id='Letter'>Letter</h3>
<td>Get&#39;s approximated center of a letter by finding the highest and lowest values, then finding the center of a rectangle build from those values</td>
</tr>
</tbody></table>
<h3 id='MagmamanSpawnPosition'>MagmamanSpawnPosition</h3>
<p>Used in <a href="#LogicList">LogicList</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><a href="#MagmamanSpawnPosition">MagmamanSpawnPosition</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=MagmamanSpawnPosition">new(int x_, int y_)</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=x">x</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=y">y</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=timer">timer</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='MovableBehavior'>MovableBehavior</h3>
<p>Opaque handle to a movable behavior used in some <a href="#Movable">Movable</a> functions</p>

Expand Down Expand Up @@ -10632,6 +10669,11 @@ <h3 id='LogicList'>LogicList</h3>
<td></td>
</tr>
<tr>
<td>LogicMagmamanSpawn</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=magmaman_spawn">magmaman_spawn</a></td>
<td></td>
</tr>
<tr>
<td><a href="#LogicDiceShop">LogicDiceShop</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=diceshop">diceshop</a></td>
<td></td>
Expand Down Expand Up @@ -10701,6 +10743,22 @@ <h3 id='LogicTiamatCutscene'>LogicTiamatCutscene</h3>
<td></td>
</tr>
</tbody></table>
<h3 id='LogicVolcana'>LogicVolcana</h3>
<p>Derived from <a href="#Logic">Logic</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>custom_array&lt;<a href="#MagmamanSpawnPosition">MagmamanSpawnPosition</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=magmaman_positions">magmaman_positions</a></td>
<td></td>
</tr>
</tbody></table>
<h2 id='Online-types'>Online types</h2><h3 id='Online'>Online</h3>
<p>Can be accessed via global <a href="#online">online</a></p>

Expand Down
58 changes: 58 additions & 0 deletions docs/light.html
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,9 @@
<li>
<a href="#Letter" class="toc-h3 toc-link" data-title="Letter">Letter</a>
</li>
<li>
<a href="#MagmamanSpawnPosition" class="toc-h3 toc-link" data-title="MagmamanSpawnPosition">MagmamanSpawnPosition</a>
</li>
<li>
<a href="#MovableBehavior" class="toc-h3 toc-link" data-title="MovableBehavior">MovableBehavior</a>
</li>
Expand Down Expand Up @@ -1825,6 +1828,9 @@
<li>
<a href="#LogicTiamatCutscene" class="toc-h3 toc-link" data-title="LogicTiamatCutscene">LogicTiamatCutscene</a>
</li>
<li>
<a href="#LogicVolcana" class="toc-h3 toc-link" data-title="LogicVolcana">LogicVolcana</a>
</li>
</ul>
</li>
<li>
Expand Down Expand Up @@ -8796,6 +8802,37 @@ <h3 id='Letter'>Letter</h3>
<td>Get&#39;s approximated center of a letter by finding the highest and lowest values, then finding the center of a rectangle build from those values</td>
</tr>
</tbody></table>
<h3 id='MagmamanSpawnPosition'>MagmamanSpawnPosition</h3>
<p>Used in <a href="#LogicList">LogicList</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><a href="#MagmamanSpawnPosition">MagmamanSpawnPosition</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=MagmamanSpawnPosition">new(int x_, int y_)</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=x">x</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=y">y</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=timer">timer</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='MovableBehavior'>MovableBehavior</h3>
<p>Opaque handle to a movable behavior used in some <a href="#Movable">Movable</a> functions</p>

Expand Down Expand Up @@ -10632,6 +10669,11 @@ <h3 id='LogicList'>LogicList</h3>
<td></td>
</tr>
<tr>
<td>LogicMagmamanSpawn</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=magmaman_spawn">magmaman_spawn</a></td>
<td></td>
</tr>
<tr>
<td><a href="#LogicDiceShop">LogicDiceShop</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=diceshop">diceshop</a></td>
<td></td>
Expand Down Expand Up @@ -10701,6 +10743,22 @@ <h3 id='LogicTiamatCutscene'>LogicTiamatCutscene</h3>
<td></td>
</tr>
</tbody></table>
<h3 id='LogicVolcana'>LogicVolcana</h3>
<p>Derived from <a href="#Logic">Logic</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>custom_array&lt;<a href="#MagmamanSpawnPosition">MagmamanSpawnPosition</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=magmaman_positions">magmaman_positions</a></td>
<td></td>
</tr>
</tbody></table>
<h2 id='Online-types'>Online types</h2><h3 id='Online'>Online</h3>
<p>Can be accessed via global <a href="#online">online</a></p>

Expand Down
21 changes: 21 additions & 0 deletions docs/src/includes/_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,17 @@ Type | Name | Description
nil | [set_quad(Quad quad)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_quad) | Inverse of the get_quad
[Vec2](#Vec2) | [center()](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=center) | Get's approximated center of a letter by finding the highest and lowest values, then finding the center of a rectangle build from those values

### MagmamanSpawnPosition

Used in [LogicList](#LogicList)

Type | Name | Description
---- | ---- | -----------
[MagmamanSpawnPosition](#MagmamanSpawnPosition) | [new(int x_, int y_)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=MagmamanSpawnPosition) |
int | [x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=x) |
int | [y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=y) |
int | [timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=timer) |

### MovableBehavior

Opaque handle to a movable behavior used in some [Movable](#Movable) functions
Expand Down Expand Up @@ -1315,6 +1326,7 @@ Type | Name | Description
---- | ---- | -----------
[LogicOlmecCutscene](#LogicOlmecCutscene) | [olmec_cutscene](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=olmec_cutscene) |
[LogicTiamatCutscene](#LogicTiamatCutscene) | [tiamat_cutscene](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=tiamat_cutscene) |
LogicMagmamanSpawn | [magmaman_spawn](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=magmaman_spawn) |
[LogicDiceShop](#LogicDiceShop) | [diceshop](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=diceshop) |

### LogicOlmecCutscene
Expand Down Expand Up @@ -1343,6 +1355,15 @@ Type | Name | Description
[Entity](#Entity) | [cinematic_anchor](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=cinematic_anchor) |
int | [timer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=timer) |

### LogicVolcana

Derived from [Logic](#Logic)


Type | Name | Description
---- | ---- | -----------
custom_array&lt;[MagmamanSpawnPosition](#MagmamanSpawnPosition)&gt; | [magmaman_positions](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=magmaman_positions) |

## Online types


Expand Down
Loading
Loading