From 5141e41fe4759c5ee35b1cfc93ef9b4a5e879e9f Mon Sep 17 00:00:00 2001 From: octacian Date: Tue, 31 Jan 2017 07:39:01 -0800 Subject: [PATCH] Improve documentation with Modules in mind --- doc/README.md | 14 ++++++++------ doc/{c_api.md => computers/api.md} | 2 +- doc/{c_os.md => computers/os.md} | 0 3 files changed, 9 insertions(+), 7 deletions(-) rename doc/{c_api.md => computers/api.md} (97%) rename doc/{c_os.md => computers/os.md} (100%) diff --git a/doc/README.md b/doc/README.md index 5cabccd..7cc08f5 100644 --- a/doc/README.md +++ b/doc/README.md @@ -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. \ No newline at end of file diff --git a/doc/c_api.md b/doc/computers/api.md similarity index 97% rename from doc/c_api.md rename to doc/computers/api.md index b14285d..e4b20e3 100644 --- a/doc/c_api.md +++ b/doc/computers/api.md @@ -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. diff --git a/doc/c_os.md b/doc/computers/os.md similarity index 100% rename from doc/c_os.md rename to doc/computers/os.md