Overview
LiveGobe Module Language (LGML) is the scripting format used within LiveGobe’s wiki modules.
It is a modified subset of JavaScript, adapted to the wiki’s execution environment and designed to safely and efficiently handle content generation, rendering, and data manipulation.
While its syntax and semantics largely align with standard JavaScript (ES6), certain restrictions and extensions are applied to fit the wiki module context.
Context & Purpose
Modules written in LGML power templates, infoboxes, and dynamic data-driven content across the LiveGobe Wiki System.
They operate in a sandboxed environment, meaning they cannot access the file system or network, and can only interact with data and utilities explicitly provided by the wiki engine.
Language Characteristics
- Base Language: JavaScript (ECMAScript 6)
- Execution Model: Sandboxed runtime within the LiveGobe backend
- Primary Use Cases:
- Generating dynamic wiki content
- Handling structured data (e.g., item info, stats, infoboxes)
- Producing dynamicly changing HTML
Key Modifications
Restricted Features
Certain JavaScript features are disabled to ensure security and determinism:
- No
eval,Function, or dynamic imports - No access to global objects like
window,document, orprocess
LGML Sandbox Context
When executing a module, LGML provides a limited, sandboxed JavaScript-like environment.
The following globals and utilities are available inside each module’s context.
| Global | Description |
|---|---|
require(name) | Safe asynchronous loader for other LGML modules. Returns the module.exports of the requested module. |
__resolveLink(target) | Resolves an internal wiki link to a valid page URL. |
module.exports / exports | Standard CommonJS-style export objects for defining public functions. |
Built-ins (Math, Date, JSON, String, Number, Boolean, Array, Object) | Basic JavaScript standard objects, safely exposed. |
Example
exports.main = function(frame) {
const item = frame.item || "Unknown";
return `[[File:${item}.png]] ${item}`;
}
This example shows a minimal item module that uses LGML syntax to generate an item entry with its corresponding icon.
Notes
LGML scripts are compiled and executed server-side during page render.
They must return HTML or plain text — no direct DOM manipulation or side effects are allowed.