Godot: Some formatting in built-in docs is missing

Created on 27 Mar 2019  路  7Comments  路  Source: godotengine/godot

Godot version:
3.1

Issue description:
image

The built-in docs, while are nicely formatted, have some issues that make them less readable. The most major one is that code blocks aren't formatted at all. They are displayed as plain indistinguishable text (just see above).

From minor ones, seems like things like bold text, and probably italic too, aren't supported.

documentation enhancement editor

Most helpful comment

I saw a beautiful doc using godot.

image

LFJPJ17

from Rpg in a box https://www.rpginabox.com/development-update-as-of-3-28-18/

All 7 comments

Yeah italic and bold seems to be unsupported, also I think [code]-tagged words should have a different color

yeah, would be amazing =].

would also be a feature for RTL as well (new bbcode, which can be used as other things, not just code formatting)

I saw a beautiful doc using godot.

image

LFJPJ17

from Rpg in a box https://www.rpginabox.com/development-update-as-of-3-28-18/

The offline doc reader Zeal displays html pages and can even apply a dark theme. The open source code may be a source of inspiration.

One of the main ways to improve documentation readability would be to limit the displayed width to a reasonable value (regardless of the editor window width), and center it if there's any space left. Lines that are too long become difficult to read, which is especially noticeable on a 2560脳1440 display at 100% scaling. This should be easy to implement using an anchored container.

I want to comment about the example screenshot from set_drag_forwarding. Sorry that this is kind of offtopic, but I feel it's necessary.

This method's description is not language agnostic. We cannot translate the _fw suffix thing to C#, for example, as it uses CamelCase (another example is D, which uses pascalCase AFAIK).

Instead the description should be something like this:

Forwards the handling of this control's drag and drop to [code]target[/code] control.
Forwarding for the methods [method get_drag_data], [method can_drop_data], and [method drop_data] can be implemented with [method get_drag_data_fw], [method can_drop_data_fw], and [method drop_data_fw] respectively.

We made it translatable to other languages by using method references for the _fw methods. The information about the additional from_control argument and the code examples would be moved to the description of each of the _fw methods.

_There is still the target parameter being referenced with a code tag. We should implement a paramref tag for these cases._

It looks like there is no method bind for the *_fw though so these method references won't work right now. We should bind get_drag_data_fw, can_drop_data_fw and drop_data_fw as virtual methods.

Although my focus here was on the language agnostic aspect of the docs, I have to say this change would also be an improvement for GDScript. The current one is not good.

To make inline code blocks ([code]鈥/code]) stand out more (like on the online class reference), we could add a subtle background to them. To do this, we'd probably need to extend RichTextLabel so it supports something like a [background=color] tag. We could then add it automatically to [code] blocks during the rendering step.

This can have many other uses, such as highlighting inline key names in games.

Was this page helpful?
0 / 5 - 0 ratings