The PortaLinux Markup Language Specification 1.1
The PortaLinux Markup Language, PLML for short, is a simple markup language that is mainly used for configuring PortaLinux system software, such as pl-srv and some other programs within pl-coreutils.
The PLML syntax is based on TOML. PLML is basically an attempt to simplify TOML into an INI-like language. Because of PLML being a subset of TOML, any PLML file is a valid TOML file and can be parsed by any TOML parsing library.
Syntax
The PLML syntax only has three types of tokens:
- Header: Starts with '[', ends with ']'. Header cannot have spaces.
- Example:
[header]
- Variable: Follows the 'name = value' format. Name cannot have spaces, and value must be an integer, string, boolean, decimal or array.
- Example (Integer):
variable = 1234
- Example (String):
variable = "basic string"
orvariable = 'literal string'
- There are two types of strings. Basic (starts and end with double quotes) or literal (starts and ends with single quotes). PLML treats them both as a string, this is only a parser distinction.
- Example (Boolead):
variable = true
orvariable = false
- Example (Decimal):
variable = 123.456
- Example (Array):
variable = [ 123, 1999, 6502 ]
orvariable = [ 123.456, 23.45, 1.25 ]
or[ "string1", 'string2', "string3" ]
- PLML arrays, just like TOML arrays, do not allow for multiple data types to be stored in an array
- Unlike TOML arrays, PLML arrays cannot be multidimensional
- Comment: Starts with a pound sign and anything past that character gets ignored by the parser
- Example:
name = 123 # This will get ignored by the parser :3
Example file
This is an example PLML file that shows all the features of this TOML subset:
# This is an example PLML File
[example-header]
property1 = "test string 123" # Basic string
property2 = 1234 # Integer
property3 = true # Boolean
property4 = 1.5 # Float
property5 = [ 123, 2011, 6502 ] # Array