Formatting

This page documents the formatting command.

LD can format Lua files by using the /format command in the DMs of the bot.

Customizable Formatting

LD allows users to select what formatting options they would like. Currently, script structure and variable names can be controlled. Once you have selected your options, upload a file and then click the Format button to format the file with those given options.

Structure Formatting Options

Structure formatting refers to how statements and expressions are formatted in the script. LD currently offers three modes of structure formatting:

  • Default Structure: The structure will be preserved as-is in the uploaded file.

  • Beautified Structure: The structure will be beautified and properly formatted.

  • Minified Structure: The structure will be minified to a single line.

Variable Formatting Options

Variable formatting refers to how variables are named in the script. LD currently offers three modes of variable formatting:

  • Default Variables: Variable names will be preserved as-is in the uploaded file.

  • Beautified Variables: Variables will be renamed to simplified representations.

    • Parameters: P_XXXX

    • Local Variables: L_XXXX

    • Iteration Variables: I_XXXX

    • Local Functions: F_XXXX

  • Minified Variables: Variables will be minified and compressed as small as possible.

Quick Format Options

Along with being able to customize formatting options, LD provides two buttons to quickly format a script in a certain style. The Beautify button will apply both beautification options, and the Minify button will apply both minification options. Upload a file, and then press either of these buttons to format with the corresponding styles.

Last updated