Browse Source

Also convert objects to use expanded variant format;

bjorn 2 years ago
parent
commit
c241f9cab7
100 changed files with 1275 additions and 1108 deletions
  1. 496 742
      api/init.lua
  2. 7 2
      api/lovr/audio/Source/clone.lua
  3. 8 4
      api/lovr/audio/Source/getDirectivity.lua
  4. 8 4
      api/lovr/audio/Source/getDuration.lua
  5. 10 8
      api/lovr/audio/Source/getOrientation.lua
  6. 13 14
      api/lovr/audio/Source/getPose.lua
  7. 9 6
      api/lovr/audio/Source/getPosition.lua
  8. 7 2
      api/lovr/audio/Source/getRadius.lua
  9. 7 2
      api/lovr/audio/Source/getSound.lua
  10. 8 4
      api/lovr/audio/Source/getVolume.lua
  11. 8 4
      api/lovr/audio/Source/isEffectEnabled.lua
  12. 7 2
      api/lovr/audio/Source/isLooping.lua
  13. 7 2
      api/lovr/audio/Source/isPlaying.lua
  14. 7 1
      api/lovr/audio/Source/pause.lua
  15. 7 2
      api/lovr/audio/Source/play.lua
  16. 8 4
      api/lovr/audio/Source/seek.lua
  17. 9 5
      api/lovr/audio/Source/setDirectivity.lua
  18. 8 4
      api/lovr/audio/Source/setEffectEnabled.lua
  19. 7 2
      api/lovr/audio/Source/setLooping.lua
  20. 10 8
      api/lovr/audio/Source/setOrientation.lua
  21. 13 14
      api/lovr/audio/Source/setPose.lua
  22. 10 7
      api/lovr/audio/Source/setPosition.lua
  23. 8 3
      api/lovr/audio/Source/setRadius.lua
  24. 8 4
      api/lovr/audio/Source/setVolume.lua
  25. 6 0
      api/lovr/audio/Source/stop.lua
  26. 8 4
      api/lovr/audio/Source/tell.lua
  27. 7 2
      api/lovr/data/Blob/getName.lua
  28. 7 2
      api/lovr/data/Blob/getPointer.lua
  29. 7 2
      api/lovr/data/Blob/getSize.lua
  30. 7 2
      api/lovr/data/Blob/getString.lua
  31. 7 2
      api/lovr/data/Image/encode.lua
  32. 7 2
      api/lovr/data/Image/getBlob.lua
  33. 8 4
      api/lovr/data/Image/getDimensions.lua
  34. 7 2
      api/lovr/data/Image/getFormat.lua
  35. 7 2
      api/lovr/data/Image/getHeight.lua
  36. 12 12
      api/lovr/data/Image/getPixel.lua
  37. 7 2
      api/lovr/data/Image/getWidth.lua
  38. 13 14
      api/lovr/data/Image/paste.lua
  39. 12 12
      api/lovr/data/Image/setPixel.lua
  40. 7 2
      api/lovr/data/ModelData/getAnimationCount.lua
  41. 8 4
      api/lovr/data/ModelData/getAnimationName.lua
  42. 8 4
      api/lovr/data/ModelData/getBlob.lua
  43. 7 2
      api/lovr/data/ModelData/getBlobCount.lua
  44. 12 12
      api/lovr/data/ModelData/getBoundingBox.lua
  45. 10 8
      api/lovr/data/ModelData/getBoundingSphere.lua
  46. 9 6
      api/lovr/data/ModelData/getCenter.lua
  47. 7 2
      api/lovr/data/ModelData/getDepth.lua
  48. 9 6
      api/lovr/data/ModelData/getDimensions.lua
  49. 7 2
      api/lovr/data/ModelData/getHeight.lua
  50. 8 4
      api/lovr/data/ModelData/getImage.lua
  51. 7 2
      api/lovr/data/ModelData/getImageCount.lua
  52. 7 2
      api/lovr/data/ModelData/getMaterialCount.lua
  53. 8 4
      api/lovr/data/ModelData/getMaterialName.lua
  54. 7 2
      api/lovr/data/ModelData/getMeshCount.lua
  55. 8 4
      api/lovr/data/ModelData/getMeshDrawMode.lua
  56. 9 6
      api/lovr/data/ModelData/getMeshIndex.lua
  57. 8 4
      api/lovr/data/ModelData/getMeshIndexCount.lua
  58. 11 10
      api/lovr/data/ModelData/getMeshIndexFormat.lua
  59. 8 4
      api/lovr/data/ModelData/getMeshMaterial.lua
  60. 9 6
      api/lovr/data/ModelData/getMeshVertex.lua
  61. 8 4
      api/lovr/data/ModelData/getMeshVertexCount.lua
  62. 8 4
      api/lovr/data/ModelData/getMeshVertexFormat.lua
  63. 7 2
      api/lovr/data/ModelData/getMetadata.lua
  64. 7 2
      api/lovr/data/ModelData/getNodeCount.lua
  65. 8 4
      api/lovr/data/ModelData/getNodeName.lua
  66. 7 2
      api/lovr/data/ModelData/getRootNode.lua
  67. 7 2
      api/lovr/data/ModelData/getSkinCount.lua
  68. 9 6
      api/lovr/data/ModelData/getSkinInverseBindMatrix.lua
  69. 8 4
      api/lovr/data/ModelData/getSkinJoints.lua
  70. 7 2
      api/lovr/data/ModelData/getTriangleCount.lua
  71. 8 4
      api/lovr/data/ModelData/getTriangles.lua
  72. 7 2
      api/lovr/data/ModelData/getVertexCount.lua
  73. 7 2
      api/lovr/data/ModelData/getWidth.lua
  74. 7 2
      api/lovr/data/Rasterizer/getAdvance.lua
  75. 7 2
      api/lovr/data/Rasterizer/getAscent.lua
  76. 7 2
      api/lovr/data/Rasterizer/getDescent.lua
  77. 7 2
      api/lovr/data/Rasterizer/getGlyphCount.lua
  78. 7 2
      api/lovr/data/Rasterizer/getHeight.lua
  79. 7 2
      api/lovr/data/Rasterizer/getLineHeight.lua
  80. 8 4
      api/lovr/data/Rasterizer/hasGlyphs.lua
  81. 7 2
      api/lovr/data/Sound/getBlob.lua
  82. 7 2
      api/lovr/data/Sound/getCapacity.lua
  83. 7 2
      api/lovr/data/Sound/getChannelCount.lua
  84. 7 2
      api/lovr/data/Sound/getChannelLayout.lua
  85. 7 2
      api/lovr/data/Sound/getDuration.lua
  86. 7 2
      api/lovr/data/Sound/getFormat.lua
  87. 7 2
      api/lovr/data/Sound/getFrameCount.lua
  88. 7 2
      api/lovr/data/Sound/getSampleCount.lua
  89. 7 2
      api/lovr/data/Sound/getSampleRate.lua
  90. 7 2
      api/lovr/data/Sound/isCompressed.lua
  91. 7 2
      api/lovr/data/Sound/isStream.lua
  92. 8 4
      api/lovr/graphics/Buffer/clear.lua
  93. 7 2
      api/lovr/graphics/Buffer/getFormat.lua
  94. 7 2
      api/lovr/graphics/Buffer/getLength.lua
  95. 7 2
      api/lovr/graphics/Buffer/getPointer.lua
  96. 7 2
      api/lovr/graphics/Buffer/getSize.lua
  97. 7 2
      api/lovr/graphics/Buffer/getStride.lua
  98. 7 2
      api/lovr/graphics/Buffer/isTemporary.lua
  99. 7 2
      api/lovr/graphics/Font/getDescent.lua
  100. 7 2
      api/lovr/graphics/Font/getHeight.lua

File diff suppressed because it is too large
+ 496 - 742
api/init.lua


+ 7 - 2
api/lovr/audio/Source/clone.lua

@@ -8,12 +8,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'source',
+    source = {
       type = 'Source',
       description = 'A genetically identical copy of the Source.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'source' }
+    }
+  },
   notes = [[
     This is a good way to create multiple Sources that play the same sound, since the audio data
     won't be loaded multiple times and can just be reused.  You can also create multiple `Source`

+ 8 - 4
api/lovr/audio/Source/getDirectivity.lua

@@ -18,15 +18,19 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'weight',
+    weight = {
       type = 'number',
       description = 'The dipole weight.  0.0 is omnidirectional, 1.0 is a dipole, 0.5 is cardioid.'
     },
-    {
-      name = 'power',
+    power = {
       type = 'number',
       description = 'The dipole power, controlling how focused the directivity shape is.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'weight', 'power' }
+    }
   }
 }

+ 8 - 4
api/lovr/audio/Source/getDuration.lua

@@ -3,20 +3,24 @@ return {
   summary = 'Get the duration of the Source.',
   description = 'Returns the duration of the Source.',
   arguments = {
-    {
-      name = 'unit',
+    unit = {
       type = 'TimeUnit',
       default = [['seconds']],
       description = 'The unit to return.'
     }
   },
   returns = {
-    {
-      name = 'duration',
+    duration = {
       type = 'number',
       description = 'The duration of the Source.'
     }
   },
+  variants = {
+    {
+      arguments = { 'unit' },
+      returns = { 'duration' }
+    }
+  },
   related = {
     'Sound:getDuration'
   }

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

@@ -4,27 +4,29 @@ return {
   description = 'Returns the orientation of the Source, in angle/axis representation.',
   arguments = {},
   returns = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the Source 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 = {
     'Source:getPosition',
     'Source:getPose',

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

@@ -4,42 +4,41 @@ return {
   description = 'Returns the position and orientation of the Source.',
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the Source, in meters.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the Source, in meters.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the Source, in meters.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the Source 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 = {
     'Source:getPosition',
     'Source:getOrientation',

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

@@ -7,22 +7,25 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z coordinate.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   related = {
     'Source:getOrientation',
     'Source:getPose',

+ 7 - 2
api/lovr/audio/Source/getRadius.lua

@@ -11,10 +11,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'radius',
+    radius = {
       type = 'number',
       description = 'The radius of the Source, in meters.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'radius' }
+    }
   }
 }

+ 7 - 2
api/lovr/audio/Source/getSound.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'sound',
+    sound = {
       type = 'Sound',
       description = 'The Sound object.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'sound' }
+    }
+  },
   related = {
     'Source:clone',
     'lovr.audio.newSource'

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

@@ -3,18 +3,22 @@ return {
   summary = 'Get the volume of the Source.',
   description = 'Returns the current volume factor for the Source.',
   arguments = {
-    {
-      name = 'units',
+    units = {
       type = 'VolumeUnit',
       default = [['linear']],
       description = 'The units to return (linear or db).'
     }
   },
   returns = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       description = 'The volume of the Source.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'units' },
+      returns = { 'volume' }
+    }
   }
 }

+ 8 - 4
api/lovr/audio/Source/isEffectEnabled.lua

@@ -3,19 +3,23 @@ return {
   summary = 'Check if an effect is enabled.',
   description = 'Returns whether a given `Effect` is enabled for the Source.',
   arguments = {
-    {
-      name = 'effect',
+    effect = {
       type = 'Effect',
       description = 'The effect.'
     }
   },
   returns = {
-    {
-      name = 'enabled',
+    enabled = {
       type = 'boolean',
       description = 'Whether the effect is enabled.'
     }
   },
+  variants = {
+    {
+      arguments = { 'effect' },
+      returns = { 'enabled' }
+    }
+  },
   notes = [[
     The active spatializer will determine which effects are supported.  If an unsupported effect is
     enabled on a Source, no error will be reported.  Instead, it will be silently ignored.  See

+ 7 - 2
api/lovr/audio/Source/isLooping.lua

@@ -4,10 +4,15 @@ return {
   description = 'Returns whether or not the Source will loop when it finishes.',
   arguments = {},
   returns = {
-    {
-      name = 'looping',
+    looping = {
       type = 'boolean',
       description = 'Whether or not the Source is looping.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'looping' }
+    }
   }
 }

+ 7 - 2
api/lovr/audio/Source/isPlaying.lua

@@ -4,12 +4,17 @@ return {
   description = 'Returns whether or not the Source is playing.',
   arguments = {},
   returns = {
-    {
-      name = 'playing',
+    playing = {
       type = 'boolean',
       description = 'Whether the Source is playing.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'playing' }
+    }
+  },
   related = {
     'Source:play',
     'Source:pause',

+ 7 - 1
api/lovr/audio/Source/pause.lua

@@ -6,5 +6,11 @@ return {
     is rewound, it will remain paused.
   ]],
   arguments = {},
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  }
 }

+ 7 - 2
api/lovr/audio/Source/play.lua

@@ -4,12 +4,17 @@ return {
   description = 'Plays the Source.  This doesn\'t do anything if the Source is already playing.',
   arguments = {},
   returns = {
-    {
-      name = 'success',
+    success = {
       type = 'boolean',
       description = 'Whether the Source successfully started playing.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'success' }
+    }
+  },
   notes = [[
     There is a maximum of 64 Sources that can be playing at once.  If 64 Sources are already
     playing, this function will return `false`.

+ 8 - 4
api/lovr/audio/Source/seek.lua

@@ -3,18 +3,22 @@ return {
   summary = 'Set the playback position of the Source.',
   description = 'Seeks the Source to the specified position.',
   arguments = {
-    {
-      name = 'position',
+    position = {
       type = 'number',
       description = 'The position to seek to.'
     },
-    {
-      name = 'unit',
+    unit = {
       type = 'TimeUnit',
       default = [['seconds']],
       description = 'The units for the seek position.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'position', 'unit' },
+      returns = {}
+    }
+  },
   notes = 'Seeking a Source backed by a stream `Sound` has no meaningful effect.'
 }

+ 9 - 5
api/lovr/audio/Source/setDirectivity.lua

@@ -17,16 +17,20 @@ return {
     that a power of zero will still result in an omnidirectional source, regardless of the weight.
   ]],
   arguments = {
-    {
-      name = 'weight',
+    weight = {
       type = 'number',
       description = 'The dipole weight.  0.0 is omnidirectional, 1.0 is a dipole, 0.5 is cardioid.'
     },
-    {
-      name = 'power',
+    power = {
       type = 'number',
       description = 'The dipole power, controlling how focused the directivity shape is.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'weight', 'power' },
+      returns = {}
+    }
+  }
 }

+ 8 - 4
api/lovr/audio/Source/setEffectEnabled.lua

@@ -3,18 +3,22 @@ return {
   summary = 'Enable or disable an effect.',
   description = 'Enables or disables an effect on the Source.',
   arguments = {
-    {
-      name = 'effect',
+    effect = {
       type = 'Effect',
       description = 'The effect.'
     },
-    {
-      name = 'enable',
+    enable = {
       type = 'boolean',
       description = 'Whether the effect should be enabled.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'effect', 'enable' },
+      returns = {}
+    }
+  },
   notes = [[
     The active spatializer will determine which effects are supported.  If an unsupported effect is
     enabled on a Source, no error will be reported.  Instead, it will be silently ignored.  See

+ 7 - 2
api/lovr/audio/Source/setLooping.lua

@@ -3,12 +3,17 @@ return {
   summary = 'Set whether or not the Source loops.',
   description = 'Sets whether or not the Source loops.',
   arguments = {
-    {
-      name = 'loop',
+    loop = {
       type = 'boolean',
       description = 'Whether or not the Source will loop.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'loop' },
+      returns = {}
+    }
+  },
   notes = 'Attempting to loop a Source backed by a stream `Sound` will cause an error.'
 }

+ 10 - 8
api/lovr/audio/Source/setOrientation.lua

@@ -3,28 +3,30 @@ return {
   summary = 'Set the orientation of the Source.',
   description = 'Sets the orientation of the Source in angle/axis representation.',
   arguments = {
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the Source 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 = {},
+  variants = {
+    {
+      arguments = { 'angle', 'ax', 'ay', 'az' },
+      returns = {}
+    }
+  },
   related = {
     'Source:setPosition',
     'Source:setPose',

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

@@ -3,43 +3,42 @@ return {
   summary = 'Set the pose of the Source.',
   description = 'Sets the position and orientation of the Source.',
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x position of the Source, in meters.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y position of the Source, in meters.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z position of the Source, in meters.'
     },
-    {
-      name = 'angle',
+    angle = {
       type = 'number',
       description = 'The number of radians the Source 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 = {
     'Source:setPosition',
     'Source:setOrientation',

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

@@ -9,21 +9,24 @@ return {
     error.
   ]],
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z coordinate.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'z' },
+      returns = {}
+    }
+  }
 }

+ 8 - 3
api/lovr/audio/Source/setRadius.lua

@@ -10,11 +10,16 @@ return {
     a smooth transition between audible and occluded, improving realism.
   ]],
   arguments = {
-    {
-      name = 'radius',
+    radius = {
       type = 'number',
       description = 'The new radius of the Source, in meters.'
     }
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'radius' },
+      returns = {}
+    }
+  }
 }

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

@@ -3,18 +3,22 @@ return {
   summary = 'Set the volume of the Source.',
   description = 'Sets the current volume factor for the Source.',
   arguments = {
-    {
-      name = 'volume',
+    volume = {
       type = 'number',
       description = 'The new 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).'
 }

+ 6 - 0
api/lovr/audio/Source/stop.lua

@@ -4,6 +4,12 @@ return {
   description = 'Stops the source, also rewinding it to the beginning.',
   arguments = {},
   returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
     'Source:play',
     'Source:pause',

+ 8 - 4
api/lovr/audio/Source/tell.lua

@@ -3,19 +3,23 @@ return {
   summary = 'Get the playback position of the Source.',
   description = 'Returns the current playback position of the Source.',
   arguments = {
-    {
-      name = 'unit',
+    unit = {
       type = 'TimeUnit',
       default = [['seconds']],
       description = 'The unit to return.'
     }
   },
   returns = {
-    {
-      name = 'position',
+    position = {
       type = 'number',
       description = 'The current playback position.'
     }
   },
+  variants = {
+    {
+      arguments = { 'unit' },
+      returns = { 'position' }
+    }
+  },
   notes = 'The return value for Sources backed by a stream `Sound` has no meaning.'
 }

+ 7 - 2
api/lovr/data/Blob/getName.lua

@@ -6,10 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the Blob.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'name' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/Blob/getPointer.lua

@@ -6,10 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'pointer',
+    pointer = {
       type = 'userdata',
       description = 'A pointer to the data.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pointer' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/Blob/getSize.lua

@@ -5,10 +5,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'bytes',
+    bytes = {
       type = 'number',
       description = 'The size of the Blob, in bytes.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'bytes' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/Blob/getString.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns a binary string containing the Blob\'s data.',
   arguments = {},
   returns = {
-    {
-      name = 'data',
+    data = {
       type = 'string',
       description = 'The Blob\'s data.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'data' }
+    }
+  },
   example = {
     description = 'Manually copy a file using Blobs:',
     code = [[

+ 7 - 2
api/lovr/data/Image/encode.lua

@@ -3,12 +3,17 @@ return {
   description = 'Encodes the Image to an uncompressed png.  This intended mainly for debugging.',
   arguments = {},
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       description = 'A new Blob containing the PNG image data.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'blob' }
+    }
+  },
   related = {
     'lovr.filesystem.write'
   }

+ 7 - 2
api/lovr/data/Image/getBlob.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns a Blob containing the raw bytes of the Image.',
   arguments = {},
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       description = 'The Blob instance containing the bytes for the `Image`.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'blob' }
+    }
+  },
   related = {
     'Blob:getPointer',
     'Sound:getBlob'

+ 8 - 4
api/lovr/data/Image/getDimensions.lua

@@ -3,17 +3,21 @@ return {
   description = 'Returns the dimensions of the Image, in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the Image, in pixels.'
     },
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the Image, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'height' }
+    }
+  },
   related = {
     'Image:getWidth',
     'Image:getHeight',

+ 7 - 2
api/lovr/data/Image/getFormat.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the format of the Image.',
   arguments = {},
   returns = {
-    {
-      name = 'format',
+    format = {
       type = 'TextureFormat',
       description = 'The format of the pixels in the Image.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'format' }
+    }
+  },
   related = {
     'TextureFormat',
     'Texture:getFormat'

+ 7 - 2
api/lovr/data/Image/getHeight.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the height of the Image, in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the Image, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'Image:getWidth',
     'Image:getDimensions',

+ 12 - 12
api/lovr/data/Image/getPixel.lua

@@ -2,39 +2,39 @@ return {
   summary = 'Get the value of a pixel of the Image.',
   description = 'Returns the value of a pixel of the Image.',
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate of the pixel to get (0-indexed).'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate of the pixel to get (0-indexed).'
     }
   },
   returns = {
-    {
-      name = 'r',
+    r = {
       type = 'number',
       description = 'The red component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'g',
+    g = {
       type = 'number',
       description = 'The green component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'b',
+    b = {
       type = 'number',
       description = 'The blue component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'a',
+    a = {
       type = 'number',
       description = 'The alpha component of the pixel, from 0.0 to 1.0.'
     }
   },
+  variants = {
+    {
+      arguments = { 'x', 'y' },
+      returns = { 'r', 'g', 'b', 'a' }
+    }
+  },
   notes = [[
     The following texture formats are supported: `rgba`, `rgb`, `r32f`, `rg32f`, and `rgba32f`.
   ]],

+ 7 - 2
api/lovr/data/Image/getWidth.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the width of the Image, in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the Image, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
     'Image:getHeight',
     'Image:getDimensions',

+ 13 - 14
api/lovr/data/Image/paste.lua

@@ -2,49 +2,48 @@ return {
   summary = 'Copy pixels from another Image to this one.',
   description = 'Copies a rectangle of pixels from one Image to this one.',
   arguments = {
-    {
-      name = 'source',
+    source = {
       type = 'Image',
       description = 'The Image to copy pixels from.'
     },
-    {
-      name = 'x',
+    x = {
       type = 'number',
       default = '0',
       description = 'The x coordinate to paste to (0-indexed).',
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       default = '0',
       description = 'The y coordinate to paste to (0-indexed).',
     },
-    {
-      name = 'fromX',
+    fromX = {
       type = 'number',
       default = '0',
       description = 'The x coordinate in the source to paste from (0-indexed).',
     },
-    {
-      name = 'fromY',
+    fromY = {
       type = 'number',
       default = '0',
       description = 'The y coordinate in the source to paste from (0-indexed).',
     },
-    {
-      name = 'width',
+    width = {
       type = 'number',
       default = 'source:getWidth()',
       description = 'The width of the region to copy.'
     },
-    {
-      name = 'height',
+    height = {
       type = 'number',
       default = 'source:getHeight()',
       description = 'The height of the region to copy.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'source', 'x', 'y', 'fromX', 'fromY', 'width', 'height' },
+      returns = {}
+    }
+  },
   notes = [[
     The two Images must have the same pixel format.
 

+ 12 - 12
api/lovr/data/Image/setPixel.lua

@@ -2,39 +2,39 @@ return {
   summary = 'Set the value of a pixel of the Image.',
   description = 'Sets the value of a pixel of the Image.',
   arguments = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate of the pixel to set (0-indexed).'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate of the pixel to set (0-indexed).'
     },
-    {
-      name = 'r',
+    r = {
       type = 'number',
       description = 'The red component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'g',
+    g = {
       type = 'number',
       description = 'The green component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'b',
+    b = {
       type = 'number',
       description = 'The blue component of the pixel, from 0.0 to 1.0.'
     },
-    {
-      name = 'a',
+    a = {
       type = 'number',
       default = '1.0',
       description = 'The alpha component of the pixel, from 0.0 to 1.0.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'x', 'y', 'r', 'g', 'b', 'a' },
+      returns = {}
+    }
+  },
   notes = [[
     The following texture formats are supported: `rgba`, `rgb`, `r32f`, `rg32f`, and `rgba32f`.
   ]],

+ 7 - 2
api/lovr/data/ModelData/getAnimationCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of animations in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of animations in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'Model:getAnimationCount'
   }

+ 8 - 4
api/lovr/data/ModelData/getAnimationName.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get the name of an animation.',
   description = 'Returns the name of an animation.',
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of the animation.'
     }
   },
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the animation.'
     }
   },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'name' }
+    }
+  },
   notes = 'If the animation does not have a name, this function returns `nil`.',
   related = {
     'Model:getAnimationName'

+ 8 - 4
api/lovr/data/ModelData/getBlob.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get a Blob in the model.',
   description = 'Returns one of the Blobs in the model, by index.',
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of the Blob to get.'
     }
   },
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       description = 'The Blob object.'
     }
   },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'blob' }
+    }
+  },
   related = {
     'ModelData:getBlobCount',
     'ModelData:getImage'

+ 7 - 2
api/lovr/data/ModelData/getBlobCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of Blobs in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of Blobs in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getBlob',
     'ModelData:getImageCount'

+ 12 - 12
api/lovr/data/ModelData/getBoundingBox.lua

@@ -3,37 +3,37 @@ return {
   description = 'Returns the 6 values of the model\'s axis-aligned bounding box.',
   arguments = {},
   returns = {
-    {
-      name = 'minx',
+    minx = {
       type = 'number',
       description = 'The minimum x coordinate of the vertices in the model.'
     },
-    {
-      name = 'maxx',
+    maxx = {
       type = 'number',
       description = 'The maximum x coordinate of the vertices in the model.'
     },
-    {
-      name = 'miny',
+    miny = {
       type = 'number',
       description = 'The minimum y coordinate of the vertices in the model.'
     },
-    {
-      name = 'maxy',
+    maxy = {
       type = 'number',
       description = 'The maximum y coordinate of the vertices in the model.'
     },
-    {
-      name = 'minz',
+    minz = {
       type = 'number',
       description = 'The minimum z coordinate of the vertices in the model.'
     },
-    {
-      name = 'maxz',
+    maxz = {
       type = 'number',
       description = 'The maximum z coordinate of the vertices in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'minx', 'maxx', 'miny', 'maxy', 'minz', 'maxz' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getHeight',

+ 10 - 8
api/lovr/data/ModelData/getBoundingSphere.lua

@@ -3,27 +3,29 @@ return {
   description = 'Returns a sphere approximately enclosing the vertices in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x coordinate of the position of the sphere.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y coordinate of the position of the sphere.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z coordinate of the position of the sphere.'
     },
-    {
-      name = 'radius',
+    radius = {
       type = 'number',
       description = 'The radius of the bounding sphere.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z', 'radius' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getHeight',

+ 9 - 6
api/lovr/data/ModelData/getCenter.lua

@@ -5,22 +5,25 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'x',
+    x = {
       type = 'number',
       description = 'The x offset of the center of the bounding box.'
     },
-    {
-      name = 'y',
+    y = {
       type = 'number',
       description = 'The y offset of the center of the bounding box.'
     },
-    {
-      name = 'z',
+    z = {
       type = 'number',
       description = 'The z offset of the center of the bounding box.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'x', 'y', 'z' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getHeight',

+ 7 - 2
api/lovr/data/ModelData/getDepth.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the depth of the model, computed from its axis-aligned bounding box.',
   arguments = {},
   returns = {
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       description = 'The depth of the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'depth' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getHeight',

+ 9 - 6
api/lovr/data/ModelData/getDimensions.lua

@@ -5,22 +5,25 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the model.'
     },
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the model.'
     },
-    {
-      name = 'depth',
+    depth = {
       type = 'number',
       description = 'The depth of the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width', 'height', 'depth' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getHeight',

+ 7 - 2
api/lovr/data/ModelData/getHeight.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the height of the model, computed from its axis-aligned bounding box.',
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'ModelData:getWidth',
     'ModelData:getDepth',

+ 8 - 4
api/lovr/data/ModelData/getImage.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get an Image in the model.',
   description = 'Returns one of the Images in the model, by index.',
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of the Image to get.'
     }
   },
   returns = {
-    {
-      name = 'image',
+    image = {
       type = 'Image',
       description = 'The Image object.'
     }
   },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'image' }
+    }
+  },
   related = {
     'ModelData:getImageCount',
     'ModelData:getBlob'

+ 7 - 2
api/lovr/data/ModelData/getImageCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of Images in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of Images in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getImage',
     'ModelData:getBlobCount'

+ 7 - 2
api/lovr/data/ModelData/getMaterialCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of materials in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of materials in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getMaterialName',
     'ModelData:getMeshMaterial',

+ 8 - 4
api/lovr/data/ModelData/getMaterialName.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get the name of a material in the model.',
   description = 'Returns the name of a material in the model.',
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of a material.'
     }
   },
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the material, or nil if the material does not have a name.'
     }
   },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'name' }
+    }
+  },
   related = {
     'ModelData:getMaterialCount',
     'ModelData:getMeshMaterial',

+ 7 - 2
api/lovr/data/ModelData/getMeshCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of meshes in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of meshes in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getNodeMeshes'
   }

+ 8 - 4
api/lovr/data/ModelData/getMeshDrawMode.lua

@@ -5,17 +5,21 @@ return {
     lines, or triangles).
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'mode',
+    mode = {
       type = 'DrawMode',
       description = 'The draw mode of the mesh.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'mode' }
+    }
   }
 }

+ 9 - 6
api/lovr/data/ModelData/getMeshIndex.lua

@@ -6,24 +6,27 @@ return {
     times without duplicating its data.
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh to get the vertex from.'
     },
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of a vertex index in the mesh to retrieve.'
     }
   },
   returns = {
-    {
-      name = 'vertexindex',
+    vertexindex = {
       type = 'number',
       description = 'The vertex index.  Like all indices in Lua, this is 1-indexed.'
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh', 'index' },
+      returns = { 'vertexindex' }
+    }
+  },
   related = {
     'ModelData:getMeshIndexFormat',
     'ModelData:getMeshIndexCount',

+ 8 - 4
api/lovr/data/ModelData/getMeshIndexCount.lua

@@ -5,18 +5,22 @@ return {
     when defining triangles.
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of vertex indices in the mesh.'
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'count' }
+    }
+  },
   notes = 'This may return zero if the mesh does not use indices.'
 }

+ 11 - 10
api/lovr/data/ModelData/getMeshIndexFormat.lua

@@ -5,30 +5,25 @@ return {
     function returns nil.
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'type',
+    type = {
       type = 'AttributeType',
       description = 'The data type of each vertex index (always u16 or u32).'
     },
-    {
-      name = 'blob',
+    blob = {
       type = 'number',
       description = 'The index of a Blob in the mesh where the binary data is stored.'
     },
-    {
-      name = 'offset',
+    offset = {
       type = 'number',
       description = 'A byte offset into the Blob\'s data where the index data starts.'
     },
-    {
-      name = 'stride',
+    stride = {
       type = 'number',
       description = [[
         The number of bytes between subsequent vertex indices.  Indices are always tightly packed,
@@ -36,6 +31,12 @@ return {
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'type', 'blob', 'offset', 'stride' }
+    }
+  },
   related = {
     'ModelData:getMeshVertexFormat'
   }

+ 8 - 4
api/lovr/data/ModelData/getMeshMaterial.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get the index of the material applied to a mesh.',
   description = 'Returns the index of the material applied to a mesh.',
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'material',
+    material = {
       type = 'number',
       description = [[
         The index of the material applied to the mesh, or nil if the mesh does not have a material.
       ]]
     }
+  },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'material' }
+    }
   }
 }

+ 9 - 6
api/lovr/data/ModelData/getMeshVertex.lua

@@ -5,24 +5,27 @@ return {
     of a mesh, which is given by `ModelData:getMeshVertexFormat`.
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh to get the vertex from.'
     },
-    {
-      name = 'vertex',
+    vertex = {
       type = 'number',
       description = 'The index of a vertex in the mesh to retrieve.'
     }
   },
   returns = {
-    {
-      name = '...',
+    ['...'] = {
       type = 'number',
       description = 'The data for all of the attributes of the vertex.'
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh', 'vertex' },
+      returns = { '...' }
+    }
+  },
   related = {
     'ModelData:getMeshVertexFormat',
     'ModelData:getMeshVertexCount',

+ 8 - 4
api/lovr/data/ModelData/getMeshVertexCount.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get the number of vertices in a mesh.',
   description = 'Returns the number of vertices in a mesh.',
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of vertices in the mesh.'
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getMeshIndexCount'
   }

+ 8 - 4
api/lovr/data/ModelData/getMeshVertexFormat.lua

@@ -5,19 +5,23 @@ return {
     each vertex (position, color, etc.), including their types and binary data layout.
   ]],
   arguments = {
-    {
-      name = 'mesh',
+    mesh = {
       type = 'number',
       description = 'The index of a mesh.'
     }
   },
   returns = {
-    {
-      name = 'format',
+    format = {
       type = 'table',
       description = 'The vertex format of the mesh.'
     }
   },
+  variants = {
+    {
+      arguments = { 'mesh' },
+      returns = { 'format' }
+    }
+  },
   notes = [[
     The format is given as a table of vertex attributes.  Each attribute is a table containing the
     following:

+ 7 - 2
api/lovr/data/ModelData/getMetadata.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'metadata',
+    metadata = {
       type = 'string',
       description = 'The metadata from the model file.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'metadata' }
+    }
+  },
   related = {
     'Model:getMetadata'
   }

+ 7 - 2
api/lovr/data/ModelData/getNodeCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of nodes in the model.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of nodes in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'Model:getNodeCount'
   }

+ 8 - 4
api/lovr/data/ModelData/getNodeName.lua

@@ -2,19 +2,23 @@ return {
   summary = 'Get the name of a node.',
   description = 'Returns the name of a node.',
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       description = 'The index of the node.'
     }
   },
   returns = {
-    {
-      name = 'name',
+    name = {
       type = 'string',
       description = 'The name of the node.'
     }
   },
+  variants = {
+    {
+      arguments = { 'index' },
+      returns = { 'name' }
+    }
+  },
   notes = 'If the node does not have a name, this function returns `nil`.',
   related = {
     'Model:getNodeName'

+ 7 - 2
api/lovr/data/ModelData/getRootNode.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the index of the model\'s root node.',
   arguments = {},
   returns = {
-    {
-      name = 'root',
+    root = {
       type = 'number',
       description = 'The index of the root node.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'root' }
+    }
+  },
   related = {
     'ModelData:getNodeCount',
     'ModelData:getNodeParent',

+ 7 - 2
api/lovr/data/ModelData/getSkinCount.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of skins in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   notes = 'There is currently a maximum of 256 skins.',
   related = {
     'Model:hasJoints'

+ 9 - 6
api/lovr/data/ModelData/getSkinInverseBindMatrix.lua

@@ -2,22 +2,25 @@ return {
   summary = 'Get the inverse bind matrix for a joint in the skin.',
   description = 'Returns the inverse bind matrix for a joint in the skin.',
   arguments = {
-    {
-      name = 'skin',
+    skin = {
       type = 'number',
       description = 'The index of a skin.'
     },
-    {
-      name = 'joint',
+    joint = {
       type = 'number',
       description = 'The index of a joint in the skin.'
     }
   },
   returns = {
-    {
-      name = '...',
+    ['...'] = {
       type = 'number',
       description = 'The 16 components of the 4x4 inverse bind matrix, in column-major order.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'skin', 'joint' },
+      returns = { '...' }
+    }
   }
 }

+ 8 - 4
api/lovr/data/ModelData/getSkinJoints.lua

@@ -2,17 +2,21 @@ return {
   summary = 'Get the joints in a skin.',
   description = 'Returns a table with the node indices of the joints in a skin.',
   arguments = {
-    {
-      name = 'skin',
+    skin = {
       type = 'number',
       description = 'The index of a skin.'
     }
   },
   returns = {
-    {
-      name = 'joints',
+    joints = {
       type = 'table',
       description = 'The joints in the skin.'
     }
+  },
+  variants = {
+    {
+      arguments = { 'skin' },
+      returns = { 'joints' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/ModelData/getTriangleCount.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The total number of triangles in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getTriangles',
     'ModelData:getVertexCount',

+ 8 - 4
api/lovr/data/ModelData/getTriangles.lua

@@ -11,20 +11,24 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'vertices',
+    vertices = {
       type = 'table',
       description = [[
         The triangle vertex positions, returned as a flat (non-nested) table of numbers.  The
         position of each vertex is given as an x, y, and z coordinate.
       ]]
     },
-    {
-      name = 'indices',
+    indices = {
       type = 'table',
       description = 'The vertex indices.  Every 3 indices describes a triangle.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'vertices', 'indices' }
+    }
+  },
   notes = 'After this function is called on a ModelData once, the result is cached.',
   related = {
     'ModelData:getTriangleCount',

+ 7 - 2
api/lovr/data/ModelData/getVertexCount.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The total number of vertices in the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'ModelData:getTriangles',
     'ModelData:getTriangleCount',

+ 7 - 2
api/lovr/data/ModelData/getWidth.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the width of the model, computed from its axis-aligned bounding box.',
   arguments = {},
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       description = 'The width of the model.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'width' }
+    }
+  },
   related = {
     'ModelData:getHeight',
     'ModelData:getDepth',

+ 7 - 2
api/lovr/data/Rasterizer/getAdvance.lua

@@ -6,10 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'advance',
+    advance = {
       type = 'number',
       description = 'The advance of the font, in pixels.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'advance' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/Rasterizer/getAscent.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'ascent',
+    ascent = {
       type = 'number',
       description = 'The ascent of the font, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'ascent' }
+    }
+  },
   related = {
     'Rasterizer:getDescent',
     'Font:getAscent'

+ 7 - 2
api/lovr/data/Rasterizer/getDescent.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'descent',
+    descent = {
       type = 'number',
       description = 'The descent of the font, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'descent' }
+    }
+  },
   related = {
     'Rasterzer:getAscent',
     'Font:getDescent'

+ 7 - 2
api/lovr/data/Rasterizer/getGlyphCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the number of glyphs stored in the font file.',
   arguments = {},
   returns = {
-    {
-      name = 'count',
+    count = {
       type = 'number',
       description = 'The number of glyphs stored in the font file.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'count' }
+    }
+  },
   related = {
     'Rasterizer:hasGlyphs'
   }

+ 7 - 2
api/lovr/data/Rasterizer/getHeight.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the height metric of the font, in pixels.',
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the font, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'Font:getHeight'
   }

+ 7 - 2
api/lovr/data/Rasterizer/getLineHeight.lua

@@ -5,12 +5,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The line height of the font, in pixels.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'Rasterizer:getHeight',
     'Font:getLineHeight',

+ 8 - 4
api/lovr/data/Rasterizer/hasGlyphs.lua

@@ -2,21 +2,25 @@ return {
   summary = 'Get whether the Rasterizer can rasterize a set of glyphs.',
   description = 'Check if the Rasterizer can rasterize a set of glyphs.',
   arguments = {
-    {
-      name = '...',
+    ['...'] = {
       type = '*',
       description = 'Strings (sets of characters) or numbers (character codes) to check for.'
     }
   },
   returns = {
-    {
-      name = 'hasGlyphs',
+    hasGlyphs = {
       type = 'boolean',
       description = [[
         true if the Rasterizer can rasterize all of the supplied characters, false otherwise.
       ]]
     }
   },
+  variants = {
+    {
+      arguments = { '...' },
+      returns = { 'hasGlyphs' }
+    }
+  },
   related = {
     'Rasterizer:getGlyphCount'
   }

+ 7 - 2
api/lovr/data/Sound/getBlob.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns a Blob containing the raw bytes of the Sound.',
   arguments = {},
   returns = {
-    {
-      name = 'blob',
+    blob = {
       type = 'Blob',
       description = 'The Blob instance containing the bytes for the `Sound`.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'blob' }
+    }
+  },
   notes = [[
     Samples for each channel are stored interleaved.  The data type of each sample is given by
     `Sound:getFormat`.

+ 7 - 2
api/lovr/data/Sound/getCapacity.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'capacity',
+    capacity = {
       type = 'number',
       description = 'The number of frames that can be written to the Sound.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'capacity' }
+    }
+  },
   related = {
     'Sound:getFrameCount',
     'Sound:getSampleCount',

+ 7 - 2
api/lovr/data/Sound/getChannelCount.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'channels',
+    channels = {
       type = 'number',
       description = 'The number of channels in the sound.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'channels' }
+    }
+  },
   related = {
     'Sound:getChannelLayout'
   }

+ 7 - 2
api/lovr/data/Sound/getChannelLayout.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the channel layout of the Sound.',
   arguments = {},
   returns = {
-    {
-      name = 'channels',
+    channels = {
       type = 'ChannelLayout',
       description = 'The channel layout.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'channels' }
+    }
+  },
   related = {
     'Sound:getChannelCount'
   }

+ 7 - 2
api/lovr/data/Sound/getDuration.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the duration of the Sound, in seconds.',
   arguments = {},
   returns = {
-    {
-      name = 'duration',
+    duration = {
       type = 'number',
       description = 'The duration of the Sound, in seconds.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'duration' }
+    }
+  },
   notes = 'This can be computed as `(frameCount / sampleRate)`.',
   related = {
     'Sound:getFrameCount',

+ 7 - 2
api/lovr/data/Sound/getFormat.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the sample format of the Sound.',
   arguments = {},
   returns = {
-    {
-      name = 'format',
+    format = {
       type = 'SampleFormat',
       description = 'The data type of each sample.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'format' }
+    }
+  },
   related = {
     'Sound:getChannelLayout',
     'Sound:getSampleRate'

+ 7 - 2
api/lovr/data/Sound/getFrameCount.lua

@@ -5,12 +5,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'frames',
+    frames = {
       type = 'number',
       description = 'The number of frames in the Sound.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frames' }
+    }
+  },
   notes = 'For streams, this returns the number of frames in the stream\'s buffer.',
   related = {
     'Sound:getDuration',

+ 7 - 2
api/lovr/data/Sound/getSampleCount.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the total number of samples in the Sound.',
   arguments = {},
   returns = {
-    {
-      name = 'samples',
+    samples = {
       type = 'number',
       description = 'The total number of samples in the Sound.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'samples' }
+    }
+  },
   notes = 'For streams, this returns the number of samples in the stream\'s buffer.',
   related = {
     'Sound:getDuration',

+ 7 - 2
api/lovr/data/Sound/getSampleRate.lua

@@ -6,10 +6,15 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'frequency',
+    frequency = {
       type = 'number',
       description = 'The number of frames per second in the Sound.'
     }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'frequency' }
+    }
   }
 }

+ 7 - 2
api/lovr/data/Sound/isCompressed.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'compressed',
+    compressed = {
       type = 'boolean',
       description = 'Whether the Sound is compressed.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'compressed' }
+    }
+  },
   related = {
     'Sound:isStream',
     'lovr.data.newSound'

+ 7 - 2
api/lovr/data/Sound/isStream.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns whether the Sound is a stream.',
   arguments = {},
   returns = {
-    {
-      name = 'stream',
+    stream = {
       type = 'boolean',
       description = 'Whether the Sound is a stream.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'stream' }
+    }
+  },
   related = {
     'Sound:isCompressed',
     'lovr.data.newSound'

+ 8 - 4
api/lovr/graphics/Buffer/clear.lua

@@ -5,20 +5,24 @@ return {
     cleared in a transfer pass using `Pass:clear`.
   ]],
   arguments = {
-    {
-      name = 'index',
+    index = {
       type = 'number',
       default = '1',
       description = 'The index of the first item to clear.'
     },
-    {
-      name = 'count',
+    count = {
       type = 'number',
       default = 'nil',
       description = 'The number of items to clear.  If `nil`, clears to the end of the Buffer.'
     }
   },
   returns = {},
+  variants = {
+    {
+      arguments = { 'index', 'count' },
+      returns = {}
+    }
+  },
   notes = [[
     Clearing a permanent buffer requires the byte offset and byte count of the cleared range to be a
     multiple of 4.  This will usually be true for most data types.

+ 7 - 2
api/lovr/graphics/Buffer/getFormat.lua

@@ -6,12 +6,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'format',
+    format = {
       type = 'table',
       description = 'The format of the Buffer.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'format' }
+    }
+  },
   example = [=[
     function lovr.load()
       buffer = lovr.graphics.newBuffer(1, { 'vec3', 'vec3', 'vec2' })

+ 7 - 2
api/lovr/graphics/Buffer/getLength.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the length of the Buffer.',
   arguments = {},
   returns = {
-    {
-      name = 'length',
+    length = {
       type = 'number',
       description = 'The length of the Buffer.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'length' }
+    }
+  },
   related = {
     'Buffer:getSize',
     'Buffer:getStride'

+ 7 - 2
api/lovr/graphics/Buffer/getPointer.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'pointer',
+    pointer = {
       type = 'lightuserdata',
       description = 'A pointer to the Buffer\'s memory.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'pointer' }
+    }
+  },
   related = {
     'Blob:getPointer'
   }

+ 7 - 2
api/lovr/graphics/Buffer/getSize.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the size of the Buffer, in bytes.  This is the same as `length * stride`.',
   arguments = {},
   returns = {
-    {
-      name = 'size',
+    size = {
       type = 'number',
       description = 'The size of the Buffer, in bytes.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'size' }
+    }
+  },
   related = {
     'Buffer:getLength',
     'Buffer:getStride'

+ 7 - 2
api/lovr/graphics/Buffer/getStride.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns the distance between each item in the Buffer, in bytes.',
   arguments = {},
   returns = {
-    {
-      name = 'stride',
+    stride = {
       type = 'number',
       description = 'The stride of the Buffer, in bytes.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'stride' }
+    }
+  },
   notes = [[
     When a Buffer is created, the stride can be set explicitly, otherwise it will be automatically
     computed based on the fields in the Buffer.

+ 7 - 2
api/lovr/graphics/Buffer/isTemporary.lua

@@ -3,12 +3,17 @@ return {
   description = 'Returns whether the Buffer is temporary.',
   arguments = {},
   returns = {
-    {
-      name = 'temporary',
+    temporary = {
       type = 'boolean',
       description = 'Whether the Buffer is temporary.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'temporary' }
+    }
+  },
   related = {
     'lovr.graphics.getBuffer'
   }

+ 7 - 2
api/lovr/graphics/Font/getDescent.lua

@@ -7,12 +7,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'descent',
+    descent = {
       type = 'number',
       description = 'The descent of the font.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'descent' }
+    }
+  },
   related = {
     'Rasterizer:getDescent',
     'Font:getAscent',

+ 7 - 2
api/lovr/graphics/Font/getHeight.lua

@@ -8,12 +8,17 @@ return {
   ]],
   arguments = {},
   returns = {
-    {
-      name = 'height',
+    height = {
       type = 'number',
       description = 'The height of the font.'
     }
   },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'height' }
+    }
+  },
   related = {
     'Rasterizer:getLeading',
     'Font:getLineSpacing',

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