Improve documentation with Modules in mind

master
octacian 2017-01-31 07:39:01 -08:00
parent f805b6b1e0
commit 5141e41fe4
3 changed files with 9 additions and 7 deletions

View File

@ -1,17 +1,19 @@
# Documentation
The digicompute API is divided among several different files. Unless otherwise mentioned, the `.md` documentation file is labeled the same as the Lua file containin the code. For example, documentation of all the API functions introduced by `builtin.lua` can be found in `doc/builtin.md`. Below, an overview of each documentation can be found.
The digicompute API is divided among several different files. Unless otherwise mentioned, the `.md` documentation file is labeled the same as the Lua file containin the code. However, for modules, documentation is found in a subdirectory. Below, the main documentation sections are found before being divided depending on the module.
## `modules.md`
### `modules.md`
Non-API portions of digicompute are loaded as modules to allow them to be easily enabled or disabled. This documents the API for loading, configuring, and interacting with modules.
## `builtin.md`
### `builtin.md`
This documents the API introduced by `builtin.lua`. Mostly containing file interaction APIs, __builtin__ contains functions that don't fit elsewhere.
## `env.md`
### `env.md`
This covers the simplistic API created in `env.lua` for running code under an environment.
## `c_api.md`
## [Module] Computers
### `api.md`
This documents the entire API used by computers. This API is only for use by modders who want to register or customize a computer.
## `c_os.md`
### `os.md`
This documents the API accessible under a secure environment to the computer OS. Through this API, the player can interact with the computer itself to make their own programs.

View File

@ -54,7 +54,7 @@ digicompute.register_computer("default", {
})
```
Above is example code from the default computer.
Above is example code from the default computer. Computers should typically be registered in the `nodes.lua` file of the computers module unless you are registering a computer from a different mod.
## Advanced API
This API is more of a documentation of pre-existing API functions for developers new to this mod who would like to get started. The Advanced API documentation is sectioned out as it is in the code.