github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/types/toml.md (about)

     1  # `toml`
     2  
     3  > Tom's Obvious, Minimal Language (TOML)
     4  
     5  ## Description
     6  
     7  TOML support within Murex is pretty mature however it is not considered a
     8  primitive. Which means, while it is a recommended builtin which you should
     9  expect in most deployments of Murex, it's still an optional package and
    10  thus may not be present in some edge cases. This is because it relies on
    11  external source packages for the shell to compile.
    12  
    13  ## Examples
    14  
    15  Example TOML document taken from [Wikipedia](https://en.wikipedia.org/wiki/TOML)
    16  
    17  ```
    18  # This is a TOML document.
    19  
    20  title = "TOML Example"
    21  
    22  [owner]
    23  name = "Tom Preston-Werner"
    24  dob = 1979-05-27T07:32:00-08:00 # First class dates
    25  
    26  [database]
    27  server = "192.168.1.1"
    28  ports = [ 8001, 8001, 8002 ]
    29  connection_max = 5000
    30  enabled = true
    31  
    32  [servers]
    33  
    34    # Indentation (tabs and/or spaces) is allowed but not required
    35    [servers.alpha]
    36    ip = "10.0.0.1"
    37    dc = "eqdc10"
    38  
    39    [servers.beta]
    40    ip = "10.0.0.2"
    41    dc = "eqdc10"
    42  
    43  [clients]
    44  data = [ ["gamma", "delta"], [1, 2] ]
    45  
    46  # Line breaks are OK when inside arrays
    47  hosts = [
    48    "alpha",
    49    "omega"
    50  ]
    51  ```
    52  
    53  ## Default Associations
    54  
    55  * **Extension**: `toml`
    56  * **MIME**: `application/toml`
    57  * **MIME**: `application/x-toml`
    58  * **MIME**: `text/toml`
    59  * **MIME**: `text/x-toml`
    60  
    61  
    62  ## Supported Hooks
    63  
    64  * `Marshal()`
    65      Supported
    66  * `ReadArray()`
    67      Hook supported albeit TOML doesn't support naked arrays
    68  * `ReadArrayWithType()`
    69      Hook supported albeit TOML doesn't support naked arrays
    70  * `ReadIndex()`
    71      Works against all properties in TOML
    72  * `ReadNotIndex()`
    73      Works against all properties in TOML
    74  * `Unmarshal()`
    75      Supported
    76  
    77  ## See Also
    78  
    79  * [`[[ Element ]]`](../parser/element.md):
    80    Outputs an element from a nested structure
    81  * [`cast`](../commands/cast.md):
    82    Alters the data type of the previous function without altering it's output
    83  * [`format`](../commands/format.md):
    84    Reformat one data-type into another data-type
    85  * [`json`](../types/json.md):
    86    JavaScript Object Notation (JSON)
    87  * [`jsonl`](../types/jsonl.md):
    88    JSON Lines
    89  * [`open`](../commands/open.md):
    90    Open a file with a preferred handler
    91  * [`runtime`](../commands/runtime.md):
    92    Returns runtime information on the internal state of Murex
    93  * [`yaml`](../types/yaml.md):
    94    YAML Ain't Markup Language (YAML)
    95  * [index](../parser/item-index.md):
    96    Outputs an element from an array, map or table
    97  
    98  ### Read more about type hooks
    99  
   100  - [`ReadIndex()` (type)](../apis/ReadIndex.md): Data type handler for the index, `[`, builtin
   101  - [`ReadNotIndex()` (type)](../apis/ReadNotIndex.md): Data type handler for the bang-prefixed index, `![`, builtin
   102  - [`ReadArray()` (type)](../apis/ReadArray.md): Read from a data type one array element at a time
   103  - [`WriteArray()` (type)](../apis/WriteArray.md): Write a data type, one array element at a time
   104  - [`ReadMap()` (type)](../apis/ReadMap.md): Treat data type as a key/value structure and read its contents
   105  - [`Marshal()` (type)](../apis/Marshal.md): Converts structured memory into a structured file format (eg for stdio)
   106  - [`Unmarshal()` (type)](../apis/Unmarshal.md): Converts a structured file format into structured memory
   107  
   108  <hr/>
   109  
   110  This document was generated from [builtins/types/toml/toml_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/types/toml/toml_doc.yaml).