Lua templating/Debug console

The debug console is a Scribunto tool that allows one to quickly try out some code in real time. It is only available when editing a module in the Module:Namespace as show in the screenshot.
The debug console is designed for testing pure Lua logic (tables, methods & primitives). Thus, it has a couple limitations in Scribunto:
* The console doesn't have syntax highlighting or client-side error checks.
* Lua variables can't be inspected or displayed in human-readable format.
See #Limitations for some workarounds.
== Purpose ==
This helps to debug one or more modules without having to leave the current page and without having to save a page. A good introduction for Lua is available in Wikiversity.https://en.wikiversity.org/wiki/Lua
== Usage ==
There are primarily two ways to interact with the debug console. One by directly typing text and waiting for the output, and the other is to access functions in the code editor.
=== Direct ===
The simplest way to use the code editor is to write code directly in it and pressing . The results may take some time because they are returned from the server.
==== Example ====
print (5 * 6)
;Output
=== Code editor ===
One can quickly put code in the code editor and try it out using the console before saving as depicted in the image. This helps to try out a lot of code without filling up the debug console, and it reduces the need to copy paste from console to editor.
=== Other functions from external modules ===
Trying other functions from modules stored in other pages is also possible. This is possible using:
;Output
== Global Modules ==
Modules stored in a central repository (dev.fandom.com) can also be accessed in a similar manner to external modules by writing:
== Limitations ==
# Object inspection unavailable.
#* The console is very static. It can't visually inspect first-class items (primitives & functions), tables, & their metatables.
#* The Inspect metamodule can help get around this, by rendering Lua items in a human-readable format.
# The console does not support syntax highlighting.
#* The console editor is very basic, it does not provide syntax highlighting or linting.
== Tips and tricks ==
Rather than writing the whole text each time or pasting it into the console, one can add commonly used functions or code to MediaWiki:Scribunto-console-intro. This will allow anyone in the community easy access to them.
== ==
* w:Help:Lua
* Lua templating/Tips and tricks
* Lua templating/Reference manual
== References ==
Debug console