Overview
The LiveGobe Module Language (LGML) is a scripting language used by LiveGobe Wiki System modules.
It is a modified subset of JavaScript designed for embedding logic within the LiveGobe Wiki environment — providing a sandboxed API surface and additional syntax for wiki-style interaction.
This guide will help you understand how to write, structure, and execute module code in LiveGobe Wiki System.
Quick Start
Each module script runs in an isolated context and has access to special LiveGobe Wiki System-provided objects.
The entry point is the module.exports/exports object, where you define functions, constants, and handlers.
exports = {
hello(frame) {
return "Hello " + frame[0] + "!";
}
};
You can then call this function in a page using:
{{#invoke:ExampleModule|hello|World}}
Output:
Hello World!
Language Basics
The LG Module Language uses JavaScript syntax with small modifications.
Supported Features
- Variables (
let,const,var) - Functions and arrow functions
- Objects and arrays
- Control structures (
if,for,while) - String and number literals
- JSON-like syntax for data
Not Supported
eval,Functionconstructor- Direct DOM or file access
These restrictions ensure determinism and sandbox safety for wiki rendering.
Template Interaction
You can also use module functions to generate wikitext that is then parsed as part of the page.
To do this, simply return a string containing LGWL markup.
exports = {
makeTable() {
return `{|
! Name !! Value
|-
| Apple || 100
|-
| Banana || 200
|}`;
}
};
Output:
| Name | Value |
|---|---|
| Apple | 100 |
| Banana | 200 |