Browse Source

Unconditionally use variants key;

Currently only functions with multiple variants use the variants table,
and functions with a single variant use an array of arguments/returns.
This means that there's less typing for single-variant functions, but
it's really annoying to change between the 2 different syntaxes.

Instead, just always be explicit about the variants and use string key
for arguments/returns tables.
bjorn 3 years ago
parent
commit
fc9ffd996c
100 changed files with 825 additions and 432 deletions
  1. 9 6
      api/lovr/audio/getAbsorption.lua
  2. 8 4
      api/lovr/audio/getDevices.lua
  3. 10 8
      api/lovr/audio/getOrientation.lua
  4. 13 14
      api/lovr/audio/getPose.lua
  5. 9 6
      api/lovr/audio/getPosition.lua
  6. 7 2
      api/lovr/audio/getSampleRate.lua
  7. 7 2
      api/lovr/audio/getSpatializer.lua
  8. 8 4
      api/lovr/audio/getVolume.lua
  9. 8 4
      api/lovr/audio/isStarted.lua
  10. 9 6
      api/lovr/audio/setAbsorption.lua
  11. 11 10
      api/lovr/audio/setDevice.lua
  12. 11 9
      api/lovr/audio/setOrientation.lua
  13. 13 14
      api/lovr/audio/setPose.lua
  14. 10 7
      api/lovr/audio/setPosition.lua
  15. 8 4
      api/lovr/audio/setVolume.lua
  16. 8 4
      api/lovr/audio/start.lua
  17. 8 4
      api/lovr/audio/stop.lua
  18. 7 1
      api/lovr/event/clear.lua
  19. 7 2
      api/lovr/event/poll.lua
  20. 6 0
      api/lovr/event/pump.lua
  21. 7 2
      api/lovr/event/push.lua
  22. 7 2
      api/lovr/event/quit.lua
  23. 6 0
      api/lovr/event/restart.lua
  24. 8 4
      api/lovr/filesystem/createDirectory.lua
  25. 7 2
      api/lovr/filesystem/getAppdataDirectory.lua
  26. 8 4
      api/lovr/filesystem/getDirectoryItems.lua
  27. 7 2
      api/lovr/filesystem/getExecutablePath.lua
  28. 7 2
      api/lovr/filesystem/getIdentity.lua
  29. 8 4
      api/lovr/filesystem/getLastModified.lua
  30. 8 4
      api/lovr/filesystem/getRealDirectory.lua
  31. 7 2
      api/lovr/filesystem/getRequirePath.lua
  32. 7 2
      api/lovr/filesystem/getSaveDirectory.lua
  33. 8 4
      api/lovr/filesystem/getSize.lua
  34. 7 2
      api/lovr/filesystem/getSource.lua
  35. 7 2
      api/lovr/filesystem/getUserDirectory.lua
  36. 7 2
      api/lovr/filesystem/getWorkingDirectory.lua
  37. 8 4
      api/lovr/filesystem/isDirectory.lua
  38. 8 4
      api/lovr/filesystem/isFile.lua
  39. 7 2
      api/lovr/filesystem/isFused.lua
  40. 8 4
      api/lovr/filesystem/load.lua
  41. 11 10
      api/lovr/filesystem/mount.lua
  42. 8 4
      api/lovr/filesystem/newBlob.lua
  43. 10 8
      api/lovr/filesystem/read.lua
  44. 8 4
      api/lovr/filesystem/remove.lua
  45. 8 3
      api/lovr/filesystem/setIdentity.lua
  46. 7 2
      api/lovr/filesystem/setRequirePath.lua
  47. 8 3
      api/lovr/filesystem/setSource.lua
  48. 8 4
      api/lovr/filesystem/unmount.lua
  49. 10 8
      api/lovr/graphics/getBackgroundColor.lua
  50. 7 2
      api/lovr/graphics/getDefaultFont.lua
  51. 7 2
      api/lovr/graphics/getDevice.lua
  52. 7 2
      api/lovr/graphics/getFeatures.lua
  53. 7 2
      api/lovr/graphics/getLimits.lua
  54. 7 2
      api/lovr/graphics/getStats.lua
  55. 7 2
      api/lovr/graphics/getWindowPass.lua
  56. 8 4
      api/lovr/graphics/isFormatSupported.lua
  57. 8 4
      api/lovr/graphics/newSampler.lua
  58. 10 8
      api/lovr/graphics/newTally.lua
  59. 6 0
      api/lovr/graphics/present.lua
  60. 6 0
      api/lovr/graphics/wait.lua
  61. 9 6
      api/lovr/headset/animate.lua
  62. 10 8
      api/lovr/headset/getAngularVelocity.lua
  63. 8 4
      api/lovr/headset/getAxis.lua
  64. 7 2
      api/lovr/headset/getBoundsDepth.lua
  65. 8 4
      api/lovr/headset/getBoundsDimensions.lua
  66. 8 4
      api/lovr/headset/getBoundsGeometry.lua
  67. 7 2
      api/lovr/headset/getBoundsWidth.lua
  68. 8 4
      api/lovr/headset/getClipDistance.lua
  69. 8 4
      api/lovr/headset/getDisplayDimensions.lua
  70. 7 2
      api/lovr/headset/getDisplayFrequencies.lua
  71. 7 2
      api/lovr/headset/getDisplayFrequency.lua
  72. 7 2
      api/lovr/headset/getDisplayHeight.lua
  73. 7 2
      api/lovr/headset/getDisplayMask.lua
  74. 7 2
      api/lovr/headset/getDisplayWidth.lua
  75. 7 2
      api/lovr/headset/getHands.lua
  76. 7 2
      api/lovr/headset/getMirrorTexture.lua
  77. 7 2
      api/lovr/headset/getName.lua
  78. 11 10
      api/lovr/headset/getOrientation.lua
  79. 7 2
      api/lovr/headset/getOriginType.lua
  80. 7 2
      api/lovr/headset/getPass.lua
  81. 14 16
      api/lovr/headset/getPose.lua
  82. 10 8
      api/lovr/headset/getPosition.lua
  83. 7 2
      api/lovr/headset/getTime.lua
  84. 10 8
      api/lovr/headset/getVelocity.lua
  85. 11 10
      api/lovr/headset/getViewAngles.lua
  86. 7 2
      api/lovr/headset/getViewCount.lua
  87. 14 16
      api/lovr/headset/getViewPose.lua
  88. 9 6
      api/lovr/headset/isDown.lua
  89. 9 6
      api/lovr/headset/isTouched.lua
  90. 8 4
      api/lovr/headset/isTracked.lua
  91. 9 6
      api/lovr/headset/newModel.lua
  92. 13 2
      api/lovr/headset/renderTo.lua
  93. 8 4
      api/lovr/headset/setClipDistance.lua
  94. 8 4
      api/lovr/headset/setDisplayFrequency.lua
  95. 11 10
      api/lovr/headset/vibrate.lua
  96. 9 6
      api/lovr/headset/wasPressed.lua
  97. 9 6
      api/lovr/headset/wasReleased.lua
  98. 7 1
      api/lovr/math/drain.lua
  99. 7 2
      api/lovr/math/getRandomSeed.lua
  100. 9 6
      api/lovr/math/randomNormal.lua

+ 9 - 6
api/lovr/audio/getAbsorption.lua

@@ -10,22 +10,25 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'low',
+    low = {
       type = 'number',
       description = 'The absorption coefficient for the low frequency band.'
     },
-    {
-      name = 'mid',
+    mid = {
       type = 'number',
       description = 'The absorption coefficient for the mid frequency band.'
     },
-    {
-      name = 'high',
+    high = {
       type = 'number',
       description = 'The absorption coefficient for the high frequency band.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'low', 'mid', 'high' }
+    }
+  },
   notes = [[
     Absorption is currently only supported by the phonon spatializer.
 

+ 8 - 4
api/lovr/audio/getDevices.lua

@@ -8,16 +8,14 @@ return {
     To use a specific device id for playback or capture, pass it to `lovr.audio.setDevice`.
   ]],
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       default = [['playback']],
       description = 'The type of devices to query (playback or capture).'
     }
   },
   returns = {
-    {
-      name = 'devices',
+    devices = {
       type = 'table',
       description = 'The list of devices.',
       table = {
@@ -39,6 +37,12 @@ return {
       }
     }
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'devices' }
+    }
+  },
   related = {
     'lovr.audio.setDevice',
     'lovr.audio.start',

+ 10 - 8
api/lovr/audio/getOrientation.lua

@@ -6,27 +6,29 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
     'lovr.audio.getPosition',
     'lovr.audio.getPose',

+ 13 - 14
api/lovr/audio/getPose.lua

@@ -4,42 +4,41 @@ return {
   description = 'Returns the position and orientation of the virtual audio listener.',
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the listener, in meters.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the listener, in meters.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the listener, in meters.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
     'lovr.audio.getPosition',
     'lovr.audio.getOrientation',

+ 9 - 6
api/lovr/audio/getPosition.lua

@@ -4,20 +4,23 @@ return {
   description = 'Returns the position of the virtual audio listener, in meters.',
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the listener.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the listener.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the listener.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z' }
+    }
   }
 }

+ 7 - 2
api/lovr/audio/getSampleRate.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'rate',
+    rate = {
       type = 'number',
       description = 'The sample rate of the playback device, in Hz.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'rate' }
+    }
+  },
   related = {
     'lovr.conf'
   }

+ 7 - 2
api/lovr/audio/getSpatializer.lua

@@ -10,12 +10,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'spatializer',
+    spatializer = {
       type = 'string',
       description = 'The name of the active spatializer.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'spatializer' }
+    }
+  },
   notes = [[
     Using a feature or effect that is not supported by the current spatializer will not error, it
     just won't do anything.

+ 8 - 4
api/lovr/audio/getVolume.lua

@@ -6,19 +6,23 @@ return {
     this factor.
   ]],
   arguments = {
-    {
-      name = 'units',
+    units = {
       type = 'VolumeUnit',
       default = [['linear']],
       description = 'The units to return (linear or db).'
     }
   },
   returns = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       description = 'The master volume.'
     }
   },
+  variants = {
+    {
+      arguments = { 'units' },
+      returns = { 'volume' }
+    }
+  },
   notes = 'The default volume is 1.0 (0 dB).'
 }

+ 8 - 4
api/lovr/audio/isStarted.lua

@@ -3,20 +3,24 @@ return {
   summary = 'Check if an audio device is started.',
   description = 'Returns whether an audio device is started.',
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       default = [['playback']],
       description = 'The type of device to check.'
     }
   },
   returns = {
-    {
-      name = 'started',
+    started = {
       type = 'boolean',
       description = 'Whether the device is active.'
     }
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'started' }
+    }
+  },
   related = {
     'lovr.audio.start',
     'lovr.audio.stop'

+ 9 - 6
api/lovr/audio/setAbsorption.lua

@@ -9,23 +9,26 @@ return {
     and stuff.
   ]],
   arguments = {
-    {
-      name = 'low',
+    low = {
       type = 'number',
       description = 'The absorption coefficient for the low frequency band.'
     },
-    {
-      name = 'mid',
+    mid = {
       type = 'number',
       description = 'The absorption coefficient for the mid frequency band.'
     },
-    {
-      name = 'high',
+    high = {
       type = 'number',
       description = 'The absorption coefficient for the high frequency band.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'low', 'mid', 'high' },
+      returns = {}
+    }
+  },
   notes = [[
     Absorption is currently only supported by the phonon spatializer.
 

+ 11 - 10
api/lovr/audio/setDevice.lua

@@ -24,38 +24,39 @@ return {
     try the device in exclusive mode, switching to shared if it doesn't work.
   ]],
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       default = [['playback']],
       description = 'The device to switch.'
     },
-    {
-      name = 'id',
+    id = {
       type = 'userdata',
       default = 'nil',
       description = 'The id of the device to use, or `nil` to use the default device.'
     },
-    {
-      name = 'sink',
+    sink = {
       type = 'Sound',
       default = 'nil',
       description = 'An optional audio stream to use as a sink for the device.'
     },
-    {
-      name = 'mode',
+    mode = {
       type = 'AudioShareMode',
       default = 'shared',
       description = 'The sharing mode for the device.'
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether creating the audio device succeeded.'
     }
   },
+  variants = {
+    {
+      arguments = { 'type', 'id', 'sink', 'mode' },
+      returns = { 'success' }
+    }
+  },
   related = {
     'lovr.audio.getDevices',
     'lovr.audio.start',

+ 11 - 9
api/lovr/audio/setOrientation.lua

@@ -3,26 +3,28 @@ return {
   summary = 'Set the orientation of the listener.',
   description = 'Sets the orientation of the virtual audio listener in angle/axis representation.',
   arguments = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the listener should be rotated around its rotation axis.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    }
+  }
 }

+ 13 - 14
api/lovr/audio/setPose.lua

@@ -3,43 +3,42 @@ return {
   summary = 'Set the pose of the listener.',
   description = 'Sets the position and orientation of the virtual audio listener.',
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the listener, in meters.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the listener, in meters.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the listener, in meters.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the listener is rotated around its axis of rotation.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    }
+  },
   related = {
     'lovr.audio.setPosition',
     'lovr.audio.setOrientation',

+ 10 - 7
api/lovr/audio/setPosition.lua

@@ -3,21 +3,24 @@ return {
   summary = 'Set the position of the listener.',
   description = 'Sets the position of the virtual audio listener, in meters.',
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the listener.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the listener.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the listener.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'z' },
+      returns = {}
+    }
+  }
 }

+ 8 - 4
api/lovr/audio/setVolume.lua

@@ -6,18 +6,22 @@ return {
     factor.
   ]],
   arguments = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       description = 'The master volume.'
     },
-    {
-      name = 'units',
+    units = {
       type = 'VolumeUnit',
       default = [['linear']],
       description = 'The units of the value.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'volume', 'units' },
+      returns = {}
+    }
+  },
   notes = 'The volume will be clamped to a 0-1 range (0 dB).'
 }

+ 8 - 4
api/lovr/audio/start.lua

@@ -6,20 +6,24 @@ return {
     and started, but this can be controlled using the `t.audio.start` flag in `lovr.conf`.
   ]],
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       default = [['playback']],
       description = 'The type of device to start.'
     }
   },
   returns = {
-    {
-      name = 'started',
+    started = {
       type = 'boolean',
       description = 'Whether the device was successfully started.'
     }
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'started' }
+    }
+  },
   notes = [[
     Starting an audio device may fail if:
 

+ 8 - 4
api/lovr/audio/stop.lua

@@ -8,20 +8,24 @@ return {
     - No device was initialized with `lovr.audio.setDevice`
   ]],
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'AudioType',
       default = [['playback']],
       description = 'The type of device to stop.'
     }
   },
   returns = {
-    {
-      name = 'stopped',
+    stopped = {
       type = 'boolean',
       description = 'Whether the device was successfully stopped.'
     }
   },
+  variants = {
+    {
+      arguments = { 'type' },
+      returns = { 'stopped' }
+    }
+  },
   notes = 'Switching devices with `lovr.audio.setDevice` will stop the existing one.',
   related = {
     'lovr.audio.getDevices',

+ 7 - 1
api/lovr/event/clear.lua

@@ -2,5 +2,11 @@ return {
   summary = 'Clear the event queue.',
   description = 'Clears the event queue, removing any unprocessed events.',
   arguments = {},
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  }
 }

+ 7 - 2
api/lovr/event/poll.lua

@@ -8,12 +8,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'iterator',
+    iterator = {
       type = 'function',
       arguments = {},
       returns = {},
       description = 'The iterator function, usable in a for loop.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'iterator' }
+    }
   }
 }

+ 6 - 0
api/lovr/event/pump.lua

@@ -7,6 +7,12 @@ return {
   ]],
   arguments = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
     'lovr.event.poll'
   }

+ 7 - 2
api/lovr/event/push.lua

@@ -6,8 +6,7 @@ return {
     `lovr.handlers` table with a key that's the same as the event name.
   ]],
   arguments = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the event.'
     },
@@ -18,6 +17,12 @@ return {
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'name' },
+      returns = {}
+    }
+  },
   notes = [[
     Only nil, booleans, numbers, strings, and LÖVR objects are supported types for event data.
   ]],

+ 7 - 2
api/lovr/event/quit.lua

@@ -6,14 +6,19 @@ return {
     indicates that an error occurred.
   ]],
   arguments = {
-    {
-      name = 'code',
+    code = {
       type = 'number',
       default = '0',
       description = 'The exit code of the program.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'code' },
+      returns = {}
+    }
+  },
   notes = [[
     This function is equivalent to calling `lovr.event.push('quit', <args>)`.
 

+ 6 - 0
api/lovr/event/restart.lua

@@ -3,6 +3,12 @@ return {
   description = 'Pushes an event to restart the framework.',
   arguments = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   notes = [[
     The event won't be processed until the next time `lovr.event.poll` is called.
 

+ 8 - 4
api/lovr/filesystem/createDirectory.lua

@@ -5,17 +5,21 @@ return {
     created.
   ]],
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The directory to create, recursively.'
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the directory was created.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
   }
 }

+ 7 - 2
api/lovr/filesystem/getAppdataDirectory.lua

@@ -9,10 +9,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The absolute path to the appdata directory.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
 }

+ 8 - 4
api/lovr/filesystem/getDirectoryItems.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get a list of files in a directory.',
   description = 'Returns a sorted table containing all files and folders in a single directory.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The directory.'
     }
   },
   returns = {
-    {
-      name = 'table',
+    table = {
       type = 'items',
       description = 'A table with a string for each file and subfolder in the directory.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'table' }
+    }
+  },
   notes = [[
     This function calls `table.sort` to sort the results, so if `table.sort` is not available in the
     global scope the results are not guaranteed to be sorted.

+ 7 - 2
api/lovr/filesystem/getExecutablePath.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns the absolute path of the LÖVR executable.',
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The absolute path of the LÖVR executable, or `nil` if it is unknown.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
 }

+ 7 - 2
api/lovr/filesystem/getIdentity.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       description = 'The name of the save directory, or `nil` if it isn\'t set.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'identity' }
+    }
+  },
   notes = [[
     On Android, this is always the package id (like `org.lovr.app`).
   ]]

+ 8 - 4
api/lovr/filesystem/getLastModified.lua

@@ -2,17 +2,21 @@ return {
   summary = 'Get the modification time of a file.',
   description = 'Returns when a file was last modified, since some arbitrary time in the past.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The file to check.'
     }
   },
   returns = {
-    {
-      name = 'time',
+    time = {
       type = 'number',
       description = 'The modification time of the file, in seconds, or `nil` if it\'s unknown.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'time' }
+    }
   }
 }

+ 8 - 4
api/lovr/filesystem/getRealDirectory.lua

@@ -5,17 +5,21 @@ return {
     can be used to determine if a file is in the game's source directory or the save directory.
   ]],
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The path to check.'
     }
   },
   returns = {
-    {
-      name = 'realpath',
+    realpath = {
       type = 'string',
       description = 'The absolute path of the mounted archive containing `path`.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'realpath' }
+    }
   }
 }

+ 7 - 2
api/lovr/filesystem/getRequirePath.lua

@@ -8,11 +8,16 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The semicolon separated list of search patterns.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
+  },
   notes = ' The default reqiure path is \'?.lua;?/init.lua\'.'
 }

+ 7 - 2
api/lovr/filesystem/getSaveDirectory.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the absolute path to the save directory.',
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The absolute path to the save directory.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
+  },
   notes = [[
     The save directory takes the following form:
 

+ 8 - 4
api/lovr/filesystem/getSize.lua

@@ -2,18 +2,22 @@ return {
   summary = 'Get the size of a file.',
   description = 'Returns the size of a file, in bytes.',
   arguments = {
-    {
-      name = 'file',
+    file = {
       type = 'string',
       description = 'The file.'
     }
   },
   returns = {
-    {
-      name = 'size',
+    size = {
       type = 'number',
       description = 'The size of the file, in bytes.'
     }
   },
+  variants = {
+    {
+      arguments = { 'file' },
+      returns = { 'size' }
+    }
+  },
   notes = 'If the file does not exist, an error is thrown.'
 }

+ 7 - 2
api/lovr/filesystem/getSource.lua

@@ -3,10 +3,15 @@ return {
   description = 'Get the absolute path of the project\'s source directory or archive.',
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The absolute path of the project\'s source, or `nil` if it\'s unknown.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
 }

+ 7 - 2
api/lovr/filesystem/getUserDirectory.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns the absolute path of the user\'s home directory.',
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The absolute path of the user\'s home directory.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
 }

+ 7 - 2
api/lovr/filesystem/getWorkingDirectory.lua

@@ -6,10 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The current working directory, or `nil` if it\'s unknown.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'path' }
+    }
   }
 }

+ 8 - 4
api/lovr/filesystem/isDirectory.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Check whether a path is a directory.',
   description = 'Check if a path exists and is a directory.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The path to check.'
     }
   },
   returns = {
-    {
-      name = 'isDirectory',
+    isDirectory = {
       type = 'boolean',
       description = 'Whether or not the path is a directory.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'isDirectory' }
+    }
+  },
   related = {
     'lovr.filesystem.isFile'
   }

+ 8 - 4
api/lovr/filesystem/isFile.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Check whether a path is a file.',
   description = 'Check if a path exists and is a file.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The path to check.'
     }
   },
   returns = {
-    {
-      name = 'isFile',
+    isFile = {
       type = 'boolean',
       description = 'Whether or not the path is a file.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'isFile' }
+    }
+  },
   related = {
     'lovr.filesystem.isDirectory'
   }

+ 7 - 2
api/lovr/filesystem/isFused.lua

@@ -3,10 +3,15 @@ return {
   description = 'Returns whether the current project source is fused to the executable.',
   arguments = {},
   returns = {
-    {
-      name = 'fused',
+    fused = {
       type = 'boolean',
       description = 'Whether or not the project is fused.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'fused' }
+    }
   }
 }

+ 8 - 4
api/lovr/filesystem/load.lua

@@ -2,15 +2,13 @@ return {
   summary = 'Load a file as Lua code.',
   description = 'Load a file containing Lua code, returning a Lua chunk that can be run.',
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       description = 'The file to load.'
     }
   },
   returns = {
-    {
-      name = 'chunk',
+    chunk = {
       type = 'function',
       arguments = {
         {
@@ -27,6 +25,12 @@ return {
       description = 'The runnable chunk.'
     }
   },
+  variants = {
+    {
+      arguments = { 'filename' },
+      returns = { 'chunk' }
+    }
+  },
   notes = 'An error is thrown if the file contains syntax errors.',
   example = {
     description = 'Safely loading code:',

+ 11 - 10
api/lovr/filesystem/mount.lua

@@ -5,27 +5,23 @@ return {
     allows you to read files from it.
   ]],
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The path to mount.'
     },
-    {
-      name = 'mountpoint',
+    mountpoint = {
       type = 'string',
       default = [['/']],
       description = 'The path in the virtual filesystem to mount to.'
     },
-    {
-      name = 'append',
+    append = {
       type = 'boolean',
       default = 'false',
       description = [[
         Whether the archive will be added to the end or the beginning of the search path.
       ]]
     },
-    {
-      name = 'root',
+    root = {
       type = 'string',
       default = 'nil',
       description = [[
@@ -35,12 +31,17 @@ return {
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the archive was successfully mounted.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path', 'mountpoint', 'append', 'root' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
     The `append` option lets you control the priority of the archive's files in the event of naming
     collisions.

+ 8 - 4
api/lovr/filesystem/newBlob.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Create a new Blob from a file.',
   description = 'Creates a new Blob that contains the contents of a file.',
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       description = 'The file to load.'
     }
   },
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       description = 'The new Blob.'
     }
   },
+  variants = {
+    {
+      arguments = { 'filename' },
+      returns = { 'blob' }
+    }
+  },
   related = {
     'lovr.data.newBlob',
     'Blob'

+ 10 - 8
api/lovr/filesystem/read.lua

@@ -2,29 +2,31 @@ return {
   summary = 'Read a file.',
   description = 'Read the contents of a file.',
   arguments = {
-    {
-      name = 'filename',
+    filename = {
       type = 'string',
       description = 'The name of the file to read.'
     },
-    {
-      name = 'bytes',
+    bytes = {
       type = 'number',
       default = '-1',
       description = 'The number of bytes to read (if -1, all bytes will be read).'
     }
   },
   returns = {
-    {
-      name = 'contents',
+    contents = {
       type = 'string',
       description = 'The contents of the file.'
     },
-    {
-      name = 'bytes',
+    bytes = {
       type = 'number',
       description = 'The number of bytes read from the file.'
     }
   },
+  variants = {
+    {
+      arguments = { 'filename', 'bytes' },
+      returns = { 'contents', 'bytes' }
+    }
+  },
   notes = 'If the file does not exist or cannot be read, nil is returned.'
 }

+ 8 - 4
api/lovr/filesystem/remove.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Remove a file or directory.',
   description = 'Remove a file or directory in the save directory.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The file or directory to remove.'
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the path was removed.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
     A directory can only be removed if it is empty.
 

+ 8 - 3
api/lovr/filesystem/setIdentity.lua

@@ -2,11 +2,16 @@ return {
   summary = 'Set the name of the save directory.',
   description = 'Set the name of the save directory.',
   arguments = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       description = 'The new name of the save directory.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'identity' },
+      returns = {}
+    }
+  }
 }

+ 7 - 2
api/lovr/filesystem/setRequirePath.lua

@@ -8,13 +8,18 @@ return {
     the project directory.
   ]],
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       default = 'nil',
       description = 'An optional semicolon separated list of search patterns.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = {}
+    }
+  },
   notes = 'The default reqiure path is \'?.lua;?/init.lua\'.'
 }

+ 8 - 3
api/lovr/filesystem/setSource.lua

@@ -5,11 +5,16 @@ return {
     internally.
   ]],
   arguments = {
-    {
-      name = 'identity',
+    identity = {
       type = 'string',
       description = 'The path containing the project\'s source.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'identity' },
+      returns = {}
+    }
+  }
 }

+ 8 - 4
api/lovr/filesystem/unmount.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Unmount a mounted archive.',
   description = 'Unmounts a directory or archive previously mounted with `lovr.filesystem.mount`.',
   arguments = {
-    {
-      name = 'path',
+    path = {
       type = 'string',
       description = 'The path to unmount.'
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the archive was unmounted.'
     }
   },
+  variants = {
+    {
+      arguments = { 'path' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
     This function is not thread safe.  Mounting or unmounting an archive while other threads call
     lovr.filesystem functions is not supported.

+ 10 - 8
api/lovr/graphics/getBackgroundColor.lua

@@ -4,26 +4,28 @@ return {
   description = 'TODO',
   arguments = {},
   returns = {
-    {
-      name = 'r',
+    r = {
       type = 'number',
       description = 'The red component of the background color.',
     },
-    {
-      name = 'g',
+    g = {
       type = 'number',
       description = 'The green component of the background color.',
     },
-    {
-      name = 'b',
+    b = {
       type = 'number',
       description = 'The blue component of the background color.',
     },
-    {
-      name = 'a',
+    a = {
       type = 'number',
       description = 'The alpha component of the background color.',
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'r', 'g', 'b', 'a' }
+    }
+  },
   notes = 'TODO'
 }

+ 7 - 2
api/lovr/graphics/getDefaultFont.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'font',
+    font = {
       type = 'Font',
       description = 'The default Font object.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'font' }
+    }
+  },
   related = {
     'Pass:text',
     'lovr.graphics.newFont'

+ 7 - 2
api/lovr/graphics/getDevice.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns information about the graphics device and driver.',
   arguments = {},
   returns = {
-    {
-      name = 'device',
+    device = {
       type = 'table',
       table = {
         {
@@ -45,6 +44,12 @@ return {
       }
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'device' }
+    }
+  },
   notes = [[
     The device and vendor ID numbers will usually be PCI IDs, which are standardized numbers
     consisting of 4 hex digits.  Various online databases and system utilities can be used to look

+ 7 - 2
api/lovr/graphics/getFeatures.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns a table indicating which features are supported by the GPU.',
   arguments = {},
   returns = {
-    {
-      name = 'features',
+    features = {
       type = 'table',
       description = '',
       table = {
@@ -66,6 +65,12 @@ return {
       }
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'features' }
+    }
+  },
   related = {
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.getDevice',

+ 7 - 2
api/lovr/graphics/getLimits.lua

@@ -4,8 +4,7 @@ return {
   description = 'Returns limits of the current GPU.',
   arguments = {},
   returns = {
-    {
-      name = 'limits',
+    limits = {
       type = 'table',
       description = '',
       table = {
@@ -191,6 +190,12 @@ return {
       }
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'limits' }
+    }
+  },
   notes = [[
     The limit ranges are as follows:
 

+ 7 - 2
api/lovr/graphics/getStats.lua

@@ -4,8 +4,7 @@ return {
   description = 'TODO',
   arguments = {},
   returns = {
-    {
-      name = 'stats',
+    stats = {
       type = 'table',
       description = 'Graphics statistics.',
       table = {
@@ -150,6 +149,12 @@ return {
       }
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'stats' }
+    }
+  },
   related = {
     'lovr.graphics.getDevice',
     'lovr.graphics.getFeatures',

+ 7 - 2
api/lovr/graphics/getWindowPass.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'pass',
+    pass = {
       type = 'Pass',
       description = 'The window pass, or `nil` if there is no window.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pass' }
+    }
+  },
   notes = [[
     - TODO is the same pass always returned
     - TODO does the texture change

+ 8 - 4
api/lovr/graphics/isFormatSupported.lua

@@ -3,8 +3,7 @@ return {
   summary = 'Check if a Texture format is supported.',
   description = 'TODO',
   arguments = {
-    {
-      name = 'format',
+    format = {
       type = 'TextureFormat',
       description = 'TODO'
     },
@@ -15,12 +14,17 @@ return {
     }
   },
   returns = {
-    {
-      name = 'supported',
+    supported = {
       type = 'boolean',
       description = 'TODO'
     }
   },
+  variants = {
+    {
+      arguments = { 'format' },
+      returns = { 'supported' }
+    }
+  },
   related = {
     'lovr.graphics.getDevice',
     'lovr.graphics.getFeatures',

+ 8 - 4
api/lovr/graphics/newSampler.lua

@@ -3,8 +3,7 @@ return {
   summary = 'Create a new Sampler.',
   description = 'TODO',
   arguments = {
-    {
-      name = 'options',
+    options = {
       type = 'table',
       description = 'TODO',
       table = {
@@ -37,12 +36,17 @@ return {
     }
   },
   returns = {
-    {
-      name = 'sampler',
+    sampler = {
       type = 'Sampler',
       description = 'TODO'
     }
   },
+  variants = {
+    {
+      arguments = { 'options' },
+      returns = { 'sampler' }
+    }
+  },
   related = {
     'Pass:setSampler'
   }

+ 10 - 8
api/lovr/graphics/newTally.lua

@@ -3,18 +3,15 @@ return {
   summary = 'Create a new Tally.',
   description = 'TODO',
   arguments = {
-    {
-      name = 'type',
+    type = {
       type = 'TallyType',
       description = 'The type of the Tally, which controls what "thing" it measures.'
     },
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of slots in the Tally.  Each slot performs one measurement.'
     },
-    {
-      name = 'views',
+    views = {
       type = 'number',
       default = '2',
       description = [[
@@ -24,12 +21,17 @@ return {
     }
   },
   returns = {
-    {
-      name = 'tally',
+    tally = {
       type = 'Tally',
       description = 'The new Tally.'
     }
   },
+  variants = {
+    {
+      arguments = { 'type', 'count', 'views' },
+      returns = { 'tally' }
+    }
+  },
   related = {
     'Pass:tick',
     'Pass:tock'

+ 6 - 0
api/lovr/graphics/present.lua

@@ -7,6 +7,12 @@ return {
   ]],
   arguments = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   notes = [[
     This should be called after submitting the window pass (`lovr.graphics.getWindowPass`).  If the
     window texture has not been rendered to since the last present, this function does nothing.

+ 6 - 0
api/lovr/graphics/wait.lua

@@ -4,6 +4,12 @@ return {
   description = 'TODO',
   arguments = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
     'lovr.graphics.submit'
   }

+ 9 - 6
api/lovr/headset/animate.lua

@@ -9,21 +9,18 @@ return {
     `true`.
   ]],
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to use for the animation data.'
     },
-    {
-      name = 'model',
+    model = {
       type = 'Model',
       description = 'The model to animate.'
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = [[
         Whether the animation was applied successfully to the Model.  If the Model was not
@@ -31,6 +28,12 @@ return {
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'model' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
     Currently this function is supported for OpenVR controller models and Oculus hand models.
 

+ 10 - 8
api/lovr/headset/getAngularVelocity.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the angular velocity of a device.',
   description = 'Returns the current angular velocity of a device.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the velocity of.'
     }
   },
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x component of the angular velocity.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y component of the angular velocity.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z component of the angular velocity.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   related = {
     'lovr.headset.getVelocity',
     'lovr.headset.getPosition',

+ 8 - 4
api/lovr/headset/getAxis.lua

@@ -8,13 +8,11 @@ return {
     the `select` function built in to Lua to select a particular axis component.
   ]],
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       description = 'The device.'
     },
-    {
-      name = 'axis',
+    axis = {
       type = 'DeviceAxis',
       description = 'The axis.'
     }
@@ -29,6 +27,12 @@ return {
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'axis' },
+      returns = {}
+    }
+  },
   notes = [[
     The axis values will be between 0 and 1 for 1D axes, and between -1 and 1 for each component of
     a multidimensional axis.

+ 7 - 2
api/lovr/headset/getBoundsDepth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the depth of the play area, in meters.',
   arguments = {},
   returns = {
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       description = 'The depth of the play area, in meters.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'depth' }
+    }
+  },
   related = {
     'lovr.headset.getBoundsWidth',
     'lovr.headset.getBoundsDimensions'

+ 8 - 4
api/lovr/headset/getBoundsDimensions.lua

@@ -4,17 +4,21 @@ return {
   description = 'Returns the size of the play area, in meters.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the play area, in meters.'
     },
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       description = 'The depth of the play area, in meters.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'depth' }
+    }
+  },
   notes = [[
     This currently returns 0 on the Quest.
   ]],

+ 8 - 4
api/lovr/headset/getBoundsGeometry.lua

@@ -6,20 +6,24 @@ return {
     headset driver does not expose this information.
   ]],
   arguments = {
-    {
-      name = 't',
+    t = {
       type = 'table',
       default = 'nil',
       description = 'A table to fill with the points.  If `nil`, a new table will be created.'
     }
   },
   returns = {
-    {
-      name = 'points',
+    points = {
       type = 'table',
       description = 'A flat table of 3D points representing the play area boundaries.'
     }
   },
+  variants = {
+    {
+      arguments = { 't' },
+      returns = { 'points' }
+    }
+  },
   related = {
     'lovr.headset.getBoundsDimensions'
   }

+ 7 - 2
api/lovr/headset/getBoundsWidth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the width of the play area, in meters.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the play area, in meters.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
     'lovr.headset.getBoundsDepth',
     'lovr.headset.getBoundsDimensions'

+ 8 - 4
api/lovr/headset/getClipDistance.lua

@@ -7,17 +7,21 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'near',
+    near = {
       type = 'number',
       description = 'The distance to the near clipping plane, in meters.'
     },
-    {
-      name = 'far',
+    far = {
       type = 'number',
       description = 'The distance to the far clipping plane, in meters.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'near', 'far' }
+    }
+  },
   notes = [[
     The default near and far clipping planes are 0.1 meters and 100.0 meters.
 

+ 8 - 4
api/lovr/headset/getDisplayDimensions.lua

@@ -4,17 +4,21 @@ return {
   description = 'Returns the texture dimensions of the headset display (for one eye), in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the display.'
     },
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the display.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'height' }
+    }
+  },
   related = {
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayHeight'

+ 7 - 2
api/lovr/headset/getDisplayFrequencies.lua

@@ -6,14 +6,19 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'frequencies',
+    frequencies = {
       type = 'table',
       description = [[
         A flat table of the refresh rates supported by the headset display, nil if not supported.
       ]]
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frequencies' }
+    }
+  },
   related = {
     'lovr.headset.setDisplayFrequency'
   }

+ 7 - 2
api/lovr/headset/getDisplayFrequency.lua

@@ -4,10 +4,15 @@ return {
   description = 'Returns the refresh rate of the headset display, in Hz.',
   arguments = {},
   returns = {
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       description = 'The frequency of the display, or `nil` if I have no idea what it is.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frequency' }
+    }
   }
 }

+ 7 - 2
api/lovr/headset/getDisplayHeight.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the height of the headset display (for one eye), in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the display.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'lovr.headset.getDisplayWidth',
     'lovr.headset.getDisplayDimensions'

+ 7 - 2
api/lovr/headset/getDisplayMask.lua

@@ -10,12 +10,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'points',
+    points = {
       type = 'table',
       description = 'A table of points.  Each point is a table with two numbers between 0 and 1.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'points' }
+    }
+  },
   example = [=[
     function lovr.load()
       lovr.graphics.setBackgroundColor(1, 1, 1)

+ 7 - 2
api/lovr/headset/getDisplayWidth.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns the width of the headset display (for one eye), in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the display.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
     'lovr.headset.getDisplayHeight',
     'lovr.headset.getDisplayDimensions'

+ 7 - 2
api/lovr/headset/getHands.lua

@@ -4,14 +4,19 @@ return {
   description = 'Returns a table with all of the currently tracked hand devices.',
   arguments = {},
   returns = {
-    {
-      name = 'hands',
+    hands = {
       type = 'table',
       arguments = {},
       returns = {},
       description = 'The currently tracked hand devices.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'hands' }
+    }
+  },
   notes = 'The hand paths will *always* be either `hand/left` or `hand/right`.',
   example = [[
     function lovr.update(dt)

+ 7 - 2
api/lovr/headset/getMirrorTexture.lua

@@ -13,12 +13,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'mirror',
+    mirror = {
       type = 'Texture',
       description = 'The mirror texture.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'mirror' }
+    }
+  },
   related = {
     'lovr.mirror'
   }

+ 7 - 2
api/lovr/headset/getName.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the headset as a string.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'name' }
+    }
+  },
   notes = [[
     <table>
       <thead>

+ 11 - 10
api/lovr/headset/getOrientation.lua

@@ -3,35 +3,36 @@ return {
   summary = 'Get the orientation of a device.',
   description = 'Returns the current orientation of a device, in angle/axis form.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the orientation of.'
     }
   },
   returns = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The amount of rotation around the axis of rotation, in radians.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   related = {
     'lovr.headset.getPose',

+ 7 - 2
api/lovr/headset/getOriginType.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'origin',
+    origin = {
       type = 'HeadsetOrigin',
       description = 'The type of origin.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'origin' }
+    }
+  },
   related = {
     'HeadsetOrigin'
   }

+ 7 - 2
api/lovr/headset/getPass.lua

@@ -3,12 +3,17 @@ return {
   description = 'TODO',
   arguments = {},
   returns = {
-    {
-      name = 'pass',
+    pass = {
       type = 'Pass',
       description = 'The Pass.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pass' }
+    }
+  },
   related = {
     'lovr.graphics.getPass',
     'lovr.conf'

+ 14 - 16
api/lovr/headset/getPose.lua

@@ -3,50 +3,48 @@ return {
   summary = 'Get the pose of a device.',
   description = 'Returns the current position and orientation of a device.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the pose of.'
     }
   },
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The amount of rotation around the axis of rotation, in radians.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   notes = [[
     Units are in meters.
 

+ 10 - 8
api/lovr/headset/getPosition.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the position of a device.',
   description = 'Returns the current position of a device, in meters, relative to the play area.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the position of.'
     }
   },
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the device.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the device.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the device.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   notes = ' If the device isn\'t tracked, all zeroes will be returned.',
   related = {
     'lovr.headset.getPose',

+ 7 - 2
api/lovr/headset/getTime.lua

@@ -9,12 +9,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'time',
+    time = {
       type = 'number',
       description = 'The predicted display time, in seconds.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'time' }
+    }
+  },
   notes = [[
     This has a different epoch than `lovr.timer.getTime`, so it is not guaranteed to be close to
     that value.

+ 10 - 8
api/lovr/headset/getVelocity.lua

@@ -3,30 +3,32 @@ return {
   summary = 'Get the linear velocity of a device.',
   description = 'Returns the current linear velocity of a device, in meters per second.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the velocity of.'
     }
   },
   returns = {
-    {
-      name = 'vx',
+    vx = {
       type = 'number',
       description = 'The x component of the linear velocity.'
     },
-    {
-      name = 'vy',
+    vy = {
       type = 'number',
       description = 'The y component of the linear velocity.'
     },
-    {
-      name = 'vz',
+    vz = {
       type = 'number',
       description = 'The z component of the linear velocity.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'vx', 'vy', 'vz' }
+    }
+  },
   related = {
     'lovr.headset.getAngularVelocity',
     'lovr.headset.getPose',

+ 11 - 10
api/lovr/headset/getViewAngles.lua

@@ -9,34 +9,35 @@ return {
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
   ]],
   arguments = {
-    {
-      name = 'view',
+    view = {
       type = 'number',
       description = 'The view index.'
     }
   },
   returns = {
-    {
-      name = 'left',
+    left = {
       type = 'number',
       description = 'The left view angle, in radians.'
     },
-    {
-      name = 'right',
+    right = {
       type = 'number',
       description = 'The right view angle, in radians.'
     },
-    {
-      name = 'top',
+    top = {
       type = 'number',
       description = 'The top view angle, in radians.'
     },
-    {
-      name = 'bottom',
+    bottom = {
       type = 'number',
       description = 'The bottom view angle, in radians.'
     }
   },
+  variants = {
+    {
+      arguments = { 'view' },
+      returns = { 'left', 'right', 'top', 'bottom' }
+    }
+  },
   related = {
     'lovr.headset.getViewCount',
     'lovr.headset.getViewPose'

+ 7 - 2
api/lovr/headset/getViewCount.lua

@@ -11,12 +11,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of views.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'lovr.headset.getViewPose',
     'lovr.headset.getViewAngles'

+ 14 - 16
api/lovr/headset/getViewPose.lua

@@ -8,49 +8,47 @@ return {
     If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
   ]],
   arguments = {
-    {
-      name = 'view',
+    view = {
       type = 'number',
       description = 'The view index.'
     }
   },
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate of the view position, in meters.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate of the view position, in meters.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z coordinate of the view position, in meters.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The amount of rotation around the rotation axis, in radians.'
     },
-    {
-      name = 'ax',
+    ax = {
       type = 'number',
       description = 'The x component of the axis of rotation.'
     },
-    {
-      name = 'ay',
+    ay = {
       type = 'number',
       description = 'The y component of the axis of rotation.'
     },
-    {
-      name = 'az',
+    az = {
       type = 'number',
       description = 'The z component of the axis of rotation.'
     }
   },
+  variants = {
+    {
+      arguments = { 'view' },
+      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
+    }
+  },
   related = {
     'lovr.headset.getViewCount',
     'lovr.headset.getViewAngles'

+ 9 - 6
api/lovr/headset/isDown.lua

@@ -3,20 +3,17 @@ return {
   summary = 'Get the state of a button on a device.',
   description = 'Returns whether a button on a device is pressed.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       description = 'The device.'
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       description = 'The button.'
     }
   },
   returns = {
-    {
-      name = 'down',
+    down = {
       type = 'boolean',
       description = [[
         Whether the button on the device is currently pressed, or `nil` if the device does not have
@@ -24,6 +21,12 @@ return {
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'down' }
+    }
+  },
   notes = 'When hand tracking is active, pinching will be mapped to the `trigger` button.',
   related = {
     'DeviceButton',

+ 9 - 6
api/lovr/headset/isTouched.lua

@@ -3,20 +3,17 @@ return {
   summary = 'Check if a button on a device is touched.',
   description = 'Returns whether a button on a device is currently touched.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       description = 'The device.'
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       description = 'The button.'
     }
   },
   returns = {
-    {
-      name = 'touched',
+    touched = {
       type = 'boolean',
       description = [[
         Whether the button on the device is currently touched, or `nil` if the device does not have
@@ -24,6 +21,12 @@ return {
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'touched' }
+    }
+  },
   related = {
     'DeviceButton',
     'lovr.headset.isDown',

+ 8 - 4
api/lovr/headset/isTracked.lua

@@ -5,20 +5,24 @@ return {
     Returns whether any active headset driver is currently returning pose information for a device.
   ]],
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to get the pose of.'
     }
   },
   returns = {
-    {
-      name = 'tracked',
+    tracked = {
       type = 'boolean',
       description = 'Whether the device is currently tracked.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device' },
+      returns = { 'tracked' }
+    }
+  },
   notes = [[
     If a device is tracked, it is guaranteed to return a valid pose until the next call to
     `lovr.headset.update`.

+ 9 - 6
api/lovr/headset/newModel.lua

@@ -3,14 +3,12 @@ return {
   summary = 'Get a Model for a device.',
   description = 'Returns a new Model for the specified device.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to load a model for.'
     },
-    {
-      name = 'options',
+    options = {
       type = 'table',
       default = '{}',
       description = 'Options for loading the model.',
@@ -25,12 +23,17 @@ return {
     }
   },
   returns = {
-    {
-      name = 'model',
+    model = {
       type = 'Model',
       description = 'The new Model, or `nil` if a model could not be loaded.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'options' },
+      returns = { 'model' }
+    }
+  },
   notes = 'This is only supported on the `openvr` and `vrapi` drivers right now.',
   example = [[
     local models = {}

+ 13 - 2
api/lovr/headset/renderTo.lua

@@ -12,11 +12,16 @@ return {
     `lovr.draw` as the callback.
   ]],
   arguments = {
-    {
-      name = 'callback',
+    callback = {
       type = 'function',
       arguments = {},
       returns = {},
+  variants = {
+    {
+      arguments = { 'callback' },
+      returns = {}
+    }
+  },
       description = [[
         The function used to render.  Any functions called will render to the headset instead of to
         the window.
@@ -24,6 +29,12 @@ return {
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'callback' },
+      returns = {}
+    }
+  },
   notes = [[
     When using the `pico` headset driver, headset rendering is asynchronous and the callback passed
     to `lovr.headset.renderTo` will not be called immediately.

+ 8 - 4
api/lovr/headset/setClipDistance.lua

@@ -6,17 +6,21 @@ return {
     near clipping plane or further than the far clipping plane will be clipped out of view.
   ]],
   arguments = {
-    {
-      name = 'near',
+    near = {
       type = 'number',
       description = 'The distance to the near clipping plane, in meters.'
     },
-    {
-      name = 'far',
+    far = {
       type = 'number',
       description = 'The distance to the far clipping plane, in meters.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'near', 'far' },
+      returns = {}
+    }
+  },
   notes = 'The default clip distances are 0.1 and 100.0.'
 }

+ 8 - 4
api/lovr/headset/setDisplayFrequency.lua

@@ -3,19 +3,23 @@ return {
   summary = 'Set the display refresh rate.',
   description = 'Sets the display refresh rate, in Hz.',
   arguments = {
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       description = 'The new refresh rate, in Hz.',
     }
   },
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the display refresh rate was successfully set.'
     }
   },
+  variants = {
+    {
+      arguments = { 'frequency' },
+      returns = { 'success' }
+    }
+  },
   notes = [[
     Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as
     they depend on the display frequency.

+ 11 - 10
api/lovr/headset/vibrate.lua

@@ -5,38 +5,39 @@ return {
     Causes the device to vibrate with a custom strength, duration, and frequency, if possible.
   ]],
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       default = [['head']],
       description = 'The device to vibrate.'
     },
-    {
-      name = 'strength',
+    strength = {
       type = 'number',
       default = '1',
       description = 'The strength of the vibration (amplitude), between 0 and 1.'
     },
-    {
-      name = 'duration',
+    duration = {
       type = 'number',
       default = '.5',
       description = 'The duration of the vibration, in seconds.'
     },
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       default = '0',
       description = 'The frequency of the vibration, in hertz.  0 will use a default frequency.'
     }
   },
   returns = {
-    {
-      name = 'vibrated',
+    vibrated = {
       type = 'boolean',
       description = 'Whether the vibration was successfully triggered by an active headset driver.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'strength', 'duration', 'frequency' },
+      returns = { 'vibrated' }
+    }
+  },
   notes = [[
     When using the `openvr` headset driver on an HTC Vive, the value for the `duration` currently
     must be less than .004 seconds.  Call this function several frames in a row for stronger or

+ 9 - 6
api/lovr/headset/wasPressed.lua

@@ -3,24 +3,27 @@ return {
   summary = 'Check if a button was just pressed.',
   description = 'Returns whether a button on a device was pressed this frame.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       description = 'The device.'
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       description = 'The button to check.'
     }
   },
   returns = {
-    {
-      name = 'pressed',
+    pressed = {
       type = 'boolean',
       description = 'Whether the button on the device was pressed this frame.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'pressed' }
+    }
+  },
   notes = [[
     Some headset backends are not able to return pressed/released information.  These drivers will
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.

+ 9 - 6
api/lovr/headset/wasReleased.lua

@@ -3,24 +3,27 @@ return {
   summary = 'Check if a button was just released.',
   description = 'Returns whether a button on a device was released this frame.',
   arguments = {
-    {
-      name = 'device',
+    device = {
       type = 'Device',
       description = 'The device.'
     },
-    {
-      name = 'button',
+    button = {
       type = 'DeviceButton',
       description = 'The button to check.'
     }
   },
   returns = {
-    {
-      name = 'released',
+    released = {
       type = 'boolean',
       description = 'Whether the button on the device was released this frame.'
     }
   },
+  variants = {
+    {
+      arguments = { 'device', 'button' },
+      returns = { 'released' }
+    }
+  },
   notes = [[
     Some headset backends are not able to return pressed/released information.  These drivers will
     always return false for `lovr.headset.wasPressed` and `lovr.headset.wasReleased`.

+ 7 - 1
api/lovr/math/drain.lua

@@ -7,5 +7,11 @@ return {
     This is called automatically at the end of each frame.
   ]],
   arguments = {},
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  }
 }

+ 7 - 2
api/lovr/math/getRandomSeed.lua

@@ -4,10 +4,15 @@ return {
   description = 'Get the seed used to initialize the random generator.',
   arguments = {},
   returns = {
-    {
-      name = 'seed',
+    seed = {
       type = 'number',
       description = 'The new seed.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'seed' }
+    }
   }
 }

+ 9 - 6
api/lovr/math/randomNormal.lua

@@ -6,8 +6,7 @@ return {
     center of the bell curve (the mean value) and the overall width (sigma, or standard deviation).
   ]],
   arguments = {
-    {
-      name = 'sigma',
+    sigma = {
       type = 'number',
       default = '1',
       description = [[
@@ -15,20 +14,24 @@ return {
         numbers is or how much variability there is.
       ]]
     },
-    {
-      name = 'mu',
+    mu = {
       type = 'number',
       default = '0',
       description = 'The average value returned.'
     }
   },
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'A normally distributed pseudo-random number.'
     }
   },
+  variants = {
+    {
+      arguments = { 'sigma', 'mu' },
+      returns = { 'x' }
+    }
+  },
   related = {
     'lovr.math.random',
     'RandomGenerator'

Some files were not shown because too many files changed in this diff