Constructed types do not (yet) have generated information on their API, so they have to be described manually. This issue explores how type documents should be formatted to accommodate this.
One decision for each option.
Sample of a type document, with details of each option.
# Summary
Describes a 3D position and orientation.
# Details
This section describes the type in detail.
## Constructors
This section lists the type's constructors, if applicable.
# Constructors
Possible alteration: Top-level sections. This would require extra logic from
rbxapiref, but may be cleaner in the long run.
### `CFrame.new(): CFrame`
Instead of C syntax, types use left-to-right (L2R) syntax. This may be adapted
later to match the syntax of the upcoming Typed Lua.
### `CFrame.new()`
Possible alteration: Omit the return type on constructors, since it should be
obvious what they return.
### `CFrame.new(): CFrame` {#ctor-empty}
Possible alteration: explicitly identify each constructor. This uses
non-standard markdown, but rbxapiref can render it. Requires coming up with a
name for each constructor.
<h3 id="ctor-empty"><code>CFrame.new(): CFrame</code></h3>
Possible alteration: Use literal headings to retain some compatibility with
other markdown parsers. May still have problems on some parsers. e.g. GitHub
produces permalinks from the content of the heading regardless of the `id`
attribute.
`CFrame.new()`
Possible alteration: Use code inline instead of heading.
CFrame.new()
Possible alteration: Use code block instead of heading.
### `CFrame.new(position: Vector3): CFrame`
Description.
### `CFrame.new(position: Vector3, lookAt: Vector3): CFrame`
Description.
### `CFrame.new(x: number, y: number: z: number): CFrame`
Description.
### `CFrame.new(x: number, y: number, z: number, r00: number, r01: number, r02: number, r10: number, r11: number, r12: number, r20: number, r21: number, r22: number): CFrame`
Description.
### `CFrame.new(x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22: number): CFrame`
Possible alteration: Parameter grouping: unspecified parameter type has the next
specified type. Less verbose, but also less clear.
## Properties
This section lists the type's properties, if applicable.
## Fields
Possible alteration: Named "Fields" instead. Constructed types behave distinctly
from classes, so it's probably a good idea to use different terminology to
encourage this distinction.
### `CFrame.X: number`
Description
### `X: number`
Possible alteration: Exclude variable. Nothing to disambiguate. Less noisy, less redundant.
### `CFrame.Y: number`
Description.
### `CFrame.Z: number`
Description.
## Functions
This section lists the type's functions, if applicable.
## Methods
Possible alteration: Named "Methods" instead. See Fields.
## `CFrame:Inverse(): CFrame`
Description.
## `Inverse(): CFrame`
Possible alteration: Exclude variable.
## `CFrame:Lerp(goal: CFrame, alpha: number): CFrame`
Description.
## `CFrame:ToWorldSpace(): CFrame`
Description.
## `CFrame:GetComponents(): (x: number, y: number, z: number, r00: number, r01: number, r02: number, r10: number, r11: number, r12: number, r20: number, r21: number, r22: number)`
Description.
## `CFrame:GetComponents(): (x, y, z, r00, r01, r02, r10, r11, r12, r20, r21, r22: number)`
Possible alteration: Grouped parameter types.
## Operators
This section lists the type's operators, if applicable.
### `CFrame * CFrame : CFrame`
Description.
### `CFrame * Vector3 : Vector3`
Description.
### `CFrame + Vector3 : CFrame`
Description.
### `CFrame - Vector3 : CFrame`
Description.
# Examples
This section provides usage examples of the type.
Constructed types do not (yet) have generated information on their API, so they have to be described manually. This issue explores how type documents should be formatted to accommodate this.
Summary of options:
One decision for each option.
Sample
Sample of a type document, with details of each option.
CFrame.md