Lua SDK Documentation errors and potential improvements

Hi folks!

Congrats on SDK 3.1.0!

Minor feedback about the 3.1.0 docs:

  1. Copy pasta error under playdate.sound.instrument s/sequence/instrument/

    playdate.sound.sequence:stop([when]) change to:
    playdate.sound.instrument:stop([when])

    playdate.sound.sequence:isPlaying() change to:
    playdate.sound.instrument:isPlaying()

    descriptions also need to updated

  2. playdate.sound.micinput.recordToSample(buffer, completionCallback, purpose)
    Everywhere else you use reason not purpose. Rename to be consistent.

  3. Not sure if the docs for the actual playdate.sound.sequence:stop() were supposed to be updated (to add when like above) but it remains unchanged.

This is in addition the previously reported docs issues reported in

I've combined all of the issues reported in that post as a single list (and checked off completed items).

  • Add the missing method parameter to playdate.network.http:query(method, path, [headers], [data]).
  • Remove the duplicate playdate.graphics.setClipRect(rect) signature from the setClipRect(x, y, width, height) entry.
  • Correct the eight-row sprite stencil signature to playdate.graphics.sprite:setStencilPattern(row1, row2, row3, row4, row5, row6, row7, row8).
  • Correct the table-based sprite stencil signature to playdate.graphics.sprite:setStencilPattern(pattern).
  • Remove the braces from the eight-argument sprite:setStencilPattern(row1, row2, row3, row4, row5, row6, row7, row8) signature.
  • Add optional curvature to playdate.sound.synth:setADSR(attack, decay, sustain, release, [curvature]).
  • Add optional xOffset and yOffset parameters to playdate.ui.crankIndicator:getBounds([xOffset, yOffset]) and document them.
  • Give playdate.sound.controlsignal:setScale(scale) its own method entry, anchor, and description.
  • Give playdate.sound.controlsignal:setOffset(offset) its own method entry, anchor, and description.
  • Use the correct scale parameter name for playdate.sound.controlsignal:setScale(scale).
  • Use the correct offset parameter name for playdate.sound.controlsignal:setOffset(offset).
  • Give playdate.sound.lfo:setScale(scale) its own method entry, anchor, and description instead of combining it with setDepth(depth).
  • Give playdate.sound.lfo:setOffset(offset) its own method entry, anchor, and description instead of combining it with setCenter(center).
  • Use the correct scale parameter name for playdate.sound.lfo:setScale(scale).
  • Use the correct offset parameter name for playdate.sound.lfo:setOffset(offset).
  • Correct playdate.ui.gridview.getSectionHeaderHeight() to the instance method playdate.ui.gridview:getSectionHeaderHeight().
  • Replace the Unicode ellipsis in playdate.ui.gridview:setNumberOfRows(…​) with ASCII ....
  • Document timer properties as instance properties rather than class properties.
  • Document frame-timer properties as instance properties rather than class properties.
  • Add () to playdate.keyboard.keyboardDidShowCallback().
  • Add () to playdate.keyboard.keyboardDidHideCallback().
  • Document playdate.keyboard.keyboardWillHideCallback(confirmed) with its Boolean argument.
  • Add () to playdate.keyboard.keyboardAnimatingCallback().
  • Add () to playdate.keyboard.textChangedCallback().
  • Document playdate.timer.timerEndedCallback(...) with its possible arguments.
  • Document playdate.timer.updateCallback(...) with its possible arguments.
  • Document playdate.frameTimer.timerEndedCallback(...) with its possible arguments.
  • Document playdate.frameTimer.updateCallback(...) with its possible arguments.

If it would be helpful, I'd be happy to provide explicit diffs for my suggestions, but I don't know whether the SDK docs are maintained manually as HTML or if they are generated from some other source material.

Happy to help.