Format and syntax

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

๐ŸŸข fully supported

๐ŸŸ  partially supported

๐Ÿ”ด not supported

BlocksMarkdownDescription

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