Format and syntax

This guide explains what syntax you can use to format the documentation for NativeDB.

🟢 fully supported

🟠 partially supported

🔴 not supported

Blocks
Markdown
Description

Paragraph

🟢​​

Some text

Basic block to show text.

Code

🟢​​

`content`

Useful to highlight arguments of a function. Note: it doesn't support complex code block with a language (like ```lua ```).

URL

🟢

[label](https://)

You can add URL link with a label. URL must starts with https://.

Lists

🟠​

  • - Item A

  • - Item B

  1. 1. Item 1

  2. 2. Item 2

You can add ordered lists, unordered lists and tasks lists. In all cases, they will be visible as unordered lists using - as a prefix.

Note: you must not add newlines per item. It is not supported for now and formatting will not work as expected in NativeDB.

Markdown example will look like this: - Item A - Item B - Item 1 - Item 2 - Item T - Item D

Bold / Italic

🔴​

**bold**

*italic*

Headers

🔴

# H1 ## H2 ### H3

Hint

🔴

{% hint %} {% endhint %}

Class reference

🟢

[ClassName]

Write the native name / alias name of a class between brackets ([]). NativeDB will automatically format it as a link to navigate to the class.

Property reference

🟢

[this.prop] [ClassName.prop]

When documenting a class, you can reference its own properties using this. followed by the name of the property.

You can also reference properties of other classes using ClassName. instead of this..

It must be surrounded by brackets ([]) in both cases.

Function reference

🟢

[this.GetStuff] [ClassName.SetStuff]

When documenting a class, you can reference its own functions using this. followed by the name of the function. You can also reference functions of other classes using ClassName. instead of this.. It must be surrounded by brackets ([]) in both cases.

Enum / Bitfield reference

🟢

[Enum.Value] [Bitfield.Value]

You can reference value of an enum and value of a bitfield.

Don't hesitate to look at other classes to see how the syntax is used, and how it looks like in NativeDB. If you are not sure, you can always come and ask on Discord.

Example

The following example is only made to show all possible syntax options. There is nothing related to the game:

# FigTree

## Description

It is made of branches and leaves. A [FigBranch] can spawn up to 5 other branches. 
It can also grow [FigFruit], up to 16 on a single branch.

See also [Wikipedia](https://en.wikipedia.org/wiki/Fig).

## Functions

#### GetAge() -> Uint32

UTC timestamp in seconds.

Same as [this.age].

#### GrowFruits(opt probability: Float) -> array:handle:FigFruit

`probability` can be between 0.0 and 1.0 (default is 0.5):
- 0.0 grows zero fruits.
- 1.0 grows fruits on all branches based on their capacity.

Last updated