Many doc updates RE: HJSON/general config

This commit is contained in:
Bryan Ashby 2018-11-19 21:16:37 -07:00
parent 5ea6f5e1f8
commit 284151a0c9
6 changed files with 58 additions and 26 deletions

View File

@ -14,15 +14,17 @@
- [Creating Config Files]({{ site.baseurl }}{% link configuration/creating-config.md %}) - [Creating Config Files]({{ site.baseurl }}{% link configuration/creating-config.md %})
- [SysOp Setup]({{ site.baseurl }}{% link configuration/sysop-setup.md %}) - [SysOp Setup]({{ site.baseurl }}{% link configuration/sysop-setup.md %})
- [Editing hjson]({{ site.baseurl }}{% link configuration/editing-hjson.md %}) - [Editing hjson]({{ site.baseurl }}{% link configuration/editing-hjson.md %})
- [config.hjson]({{ site.baseurl }}{% link configuration/config-hjson.md %}) - [System Configuration]({{ site.baseurl }}{% link configuration/config-hjson.md %})
- [menu.hjson]({{ site.baseurl }}{% link configuration/menu-hjson.md %}) - [HJSON General]({{ site.baseurl }}{% link configuration/hjson.md %})
- [prompt.hjson]({{ site.baseurl }}{% link configuration/prompt-hjson.md %}) - [Menus]({{ site.baseurl }}{% link configuration/menu-hjson.md %})
- [Prompts]({{ site.baseurl }}{% link configuration/prompt-hjson.md %})
- [Directory Structure]({{ site.baseurl }}{% link configuration/directory-structure.md %}) - [Directory Structure]({{ site.baseurl }}{% link configuration/directory-structure.md %})
- [Archivers]({{ site.baseurl }}{% link configuration/archivers.md %}) - [Archivers]({{ site.baseurl }}{% link configuration/archivers.md %})
- [File Transfer Protocols]({{ site.baseurl }}{% link configuration/file-transfer-protocols.md %}) - [File Transfer Protocols]({{ site.baseurl }}{% link configuration/file-transfer-protocols.md %})
- [Email]({{ site.baseurl }}{% link configuration/email.md %}) - [Email]({{ site.baseurl }}{% link configuration/email.md %})
- [Colour Codes]({{ site.baseurl }}{% link configuration/colour-codes.md %}) - [Colour Codes]({{ site.baseurl }}{% link configuration/colour-codes.md %})
- [Access Condition System (ACS)]({{ site.baseurl }}{% link configuration/acs.md %}) - [Access Condition System (ACS)]({{ site.baseurl }}{% link configuration/acs.md %})
- [Event Scheduler]({{ site.baseurl }}{% link configuration/event-scheduler.md %})
- Scheduled jobs - Scheduled jobs
- File Base - File Base

View File

@ -1,10 +1,12 @@
--- ---
layout: page layout: page
title: config.hjson title: System Configuration
--- ---
## System Configuration ## System Configuration
The main system configuration file, `config.hjson` both overrides defaults and provides additional configuration such as message areas. The default path is `/enigma-bbs-install-path/config/config.hjson` though you can override the `config.hjson` location with the `--config` parameter when invoking `main.js`. Values found in `core/config.js` may be overridden by simply providing the object members you wish replace. The main system configuration file, `config.hjson` both overrides defaults and provides additional configuration such as message areas. The default path is `/enigma-bbs-install-path/config/config.hjson` though you can override the `config.hjson` location with the `--config` parameter when invoking `main.js`. Values found in `core/config.js` may be overridden by simply providing the object members you wish replace.
See also [HJSON General Information](hjson.md) for more information on the HJSON format.
### Creating a Configuration ### Creating a Configuration
Your initial configuration skeleton can be created using the `oputil.js` command line utility. From your enigma-bbs root directory: Your initial configuration skeleton can be created using the `oputil.js` command line utility. From your enigma-bbs root directory:
``` ```

View File

@ -2,26 +2,13 @@
layout: page layout: page
title: Creating Initial Config Files title: Creating Initial Config Files
--- ---
Configuration files in ENiGMA½ are simple UTF-8 encoded [HJSON](http://hjson.org/) files. HJSON is just Configuration files in ENiGMA½ are simple UTF-8 encoded [HJSON](http://hjson.org/) files. HJSON is just like JSON but simplified and much more resilient to human error.
like JSON but simplified and much more resilient to human error.
## config.hjson ## Initial Configuration
Your initial configuration skeleton can be created using the `oputil.js` command line utility. From your Your initial configuration skeleton can be created using the `oputil.js` command line utility. From your enigma-bbs root directory:
enigma-bbs root directory: ```bash
```
./oputil.js config new ./oputil.js config new
``` ```
You will be asked a series of questions to create an initial configuration. You will be asked a series of questions to create an initial configuration, which will be saved to `/enigma-bbs-install-path/config/config.hjson`. This will also produce `config/<bbsName>-menu.hjson` and `config/<bbsName>-prompt.hjson` files (where `<bbsName>` is replaced by the name you provided in the steps above). See [Menu HJSON](menu-hjson.md) and [Prompt HJSON](prompt-hjson.md) for more information.
## menu.hjson and prompt.hjson
Create your own copy of `/config/menu.hjson` and `/config/prompt.hjson`, and specify it in the
`general` section of `config.hjson`:
````hjson
general: {
menuFile: my-menu.hjson
promptFile: my-prompt.hjson
}
````

View File

@ -0,0 +1,39 @@
---
layout: page
title: HJSON General Information
---
## JSON for Humans!
HJSON is the configuration file format used by ENiGMA½ for [System Configuration](config-hjson.md), [Menus](menu-hjson.md), [Prompts](prompt-hjson.md), etc. [HJSON](https://hjson.org/) is is [JSON](https://json.org/) for humans!
For those completely unfamiliar, JSON stands for JavaScript Object Notation. But don't let that scare you! JSON is simply a text file format with a bit of structure ― kind of like a fancier INI file. HJSON on the other hand as mentioned previously, is JSON for humans. That is, it has the following features and more:
* More resilliant to syntax errors such as missing a comma
* Strings generally do not need to be quoted. Multi-line strings are also supported!
* Comments are supported (JSON doesn't allow this!): `#`, `//` and `/* ... */` style comments are allowed.
* Keys never need to be quoted
* ...much more! See [the official HJSON website](https://hjson.org/).
## Terminology
Through the documentation, some terms regarding HJSON and configuration files will be used:
* `config.hjson`: Refers to `/path/to/enigma-bbs/config/config.hjson`. See [System Configuration](config-hjson.md).
* `menu.hjson`: Refers to `/path/to/enigma-bbs/config/<yourBBSName>-menu.hjson`. See [Menus](menu-hjson.md).
* `prompt.hjson`: Refers to `/path/to/enigma-bbs/config/<yourBBSName>-prompt.hjson`. See [Prompts](prompt-hjson.md).
* Configuration *key*: Elements in HJSON are name-value pairs where the name is the *key*. For example, provided `foo: bar`, `foo` is the key.
* Configuration *section* or *block* (also commonly called an "Object" in code): This is referring to a section in a HJSON file that starts with a *key*. For example:
```hjson
someSection: {
foo: bar
}
```
Note that `someSection` is the configuration *section* (or *block*) and `foo: bar` is within it.
## Editing HJSON
HJSON is a text file format, and ENiGMA½ configuration files **should always be saved as UTF-8**.
It is **highly** recommended to use a text editor that has HJSON support. A few (but not all!) examples include:
* Sublime Text 3 via the `sublime-hjson` package.
* Visual Studio code via the `vscode-hjson` plugin.
* Notepad++ via the `npp-hjson` plugin.
See https://hjson.org/users.html for more information.

View File

@ -1,9 +1,9 @@
--- ---
layout: page layout: page
title: menu.hjson title: Menus
--- ---
## Menu HJSON ## Menus
The core of a ENiGMA½ based BBS is `menu.hjson`. Note that when `menu.hjson` is referenced, we're actually talking about `config/yourboardname-menu.hjson` or similar. This file determines the menus (or screens) a user can see, the order they come in and how they interact with each other, ACS configuration, etc. Like all configuration within ENiGMA½, menu configuration is done in [HJSON](https://hjson.org/) format. The core of a ENiGMA½ based BBS is `menu.hjson`. Note that when `menu.hjson` is referenced, we're actually talking about `config/yourboardname-menu.hjson` or similar. This file determines the menus (or screens) a user can see, the order they come in and how they interact with each other, ACS configuration, etc. Like all configuration within ENiGMA½, menu configuration is done in [HJSON](https://hjson.org/) format. See [HJSON General Information](hjson.md) for more information.
Entries in `menu.hjson` are often referred to as *blocks* or *sections*. Each entry defines a menu. A menu in this sense is something the user can see or visit. Examples include but are not limited to: Entries in `menu.hjson` are often referred to as *blocks* or *sections*. Each entry defines a menu. A menu in this sense is something the user can see or visit. Examples include but are not limited to:

View File

@ -4,3 +4,5 @@ title: prompt.hjson
--- ---
:zap: This page is to describe general information the `prompt.hjson` file. It :zap: This page is to describe general information the `prompt.hjson` file. It
needs fleshing out, please submit a PR if you'd like to help! needs fleshing out, please submit a PR if you'd like to help!
See [HJSON General Information](hjson.md) for more information.