Skip to content

Commit

Permalink
add some info on modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Mar 20, 2021
1 parent e605c9d commit c96a95e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def print_af(lf, af):
for lib in lualibs:
print('### `'+lib+'`')

print('## Modules')
print("""You can load modules with `require "mymod"` or `require "mydir.mymod"`, just put `mymod.lua` in the same directory the script is, or in `mydir/` to keep things organized.
Check the [Lua tutorial](http://lua-users.org/wiki/ModulesTutorial) or examples how to actually make modules.""")

print('## Global variables')
print("""These variables are always there to use.""")
for lf in funcs:
Expand Down
4 changes: 4 additions & 0 deletions docs/script-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ The following Lua libraries and their functions are available. You can read more
### `string`
### `table`
### `package`
## Modules
You can load modules with `require "mymod"` or `require "mydir.mymod"`, just put `mymod.lua` in the same directory the script is, or in `mydir/` to keep things organized.

Check the [Lua tutorial](http://lua-users.org/wiki/ModulesTutorial) or examples how to actually make modules.
## Global variables
These variables are always there to use.
### [`meta`](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=meta)
Expand Down

0 comments on commit c96a95e

Please sign in to comment.