Skip to content

Instantly share code, notes, and snippets.

@Anaminus
Created June 22, 2020 14:31
Show Gist options
  • Select an option

  • Save Anaminus/e867da542f7046f4f12cdd64c11c3b12 to your computer and use it in GitHub Desktop.

Select an option

Save Anaminus/e867da542f7046f4f12cdd64c11c3b12 to your computer and use it in GitHub Desktop.
Template for formatting ModuleScript descriptions.
--[[
ModuleName
A short description of the module.
SYNOPSIS
-- Lua code that showcases an overview of the API.
local foobar = ModuleName.TopLevel("foo")
print(foobar.Thing)
DESCRIPTION
A detailed description of the module.
API
-- Describes each API item using Luau type declarations.
-- Top-level functions use the function declaration syntax.
function ModuleName.TopLevel(thing: string): Foobar
-- A description of Foobar.
type Foobar = {
-- A description of the Thing member.
Thing: string,
-- Each distinct item in the API is separated by \n\n.
Member: string,
}
]]
-- Implementation of ModuleName.
local ModuleName = {}
function ModuleName.TopLevel(thing)
return {
Thing = thing,
Member = "",
}
end
return ModuleName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment