Godot Version
4.6.1
Question
I’m trying to include codeblocks with example usage in the class documentation for a GDExtension but am having formatting issues. I’m using this as a guide:
However I have formatting problems when the code block is not a full function. I have the following codeblock:
[codeblock lang=gdscript]
var sum = Summator.new()
sum.sum_changed.connect(on_sum_changed)
sum.add(5)
sum.add(7)
var total = sum.get_total()
# prints 12
print(total)
[/codeblock]
But it produces this:
However if i do it as the whole ready:
[codeblock lang=gdscript]
func _ready() → void:
var sum = Summator.new()
sum.sum_changed.connect(on_sum_changed)
sum.add(5)
sum.add(7)
var total = sum.get_total()
# prints 12
print(total)
[/codeblock]
It then aligns correctly:
Does anyone know if it is possible to just use a snippet in a code block or does it have to be a whole function, or do I have a format issue?

