Godot: Add linking to <member> and <signal> elements in the classes XML files

Created on 10 Sep 2017  路  9Comments  路  Source: godotengine/godot

Godot 3.0

Currently, people are only able to use [method method_name] (for linking methods) and [type_name] (for linking types) in the classes.xml document. Because of the growth of elements in the new version however, it would be effective to add a corresponding [member member_name] link as well.

documentation enhancement junior job editor

Most helpful comment

Hi

I'll try to do this

All 9 comments

FYI, I added this as an issue in docs: https://github.com/godotengine/godot-docs/issues/459 . Not sure which is the more appropriate place.

@cbscribe yours is more detailed, but I think it belongs to this repo (since this must be implemented in EditorHelp).

OK, I'll paste it here for easy reference:

Currently in the docs, we can write [method Node.foo] to link to a class method. Now that 3.0 has member variables which will be replacing many of the methods, we need to be able to link to them as well.

Format can follow method:

Tag | Effect | Usage | Result
-- | -- | -- | --
[member Class.membername] | Link to another class's member | See [member Node2D.position]. | See聽:ref:position <class_node2d_position>.

We also need references to enums to avoid this PREFIX_* thing. For example, [enum Timer.TimerProcessMode] or [enum TimerProcessMode] (we could make it search the enum in the class before searching for global enums when the class name is not specified).

we could make it search the enum in the class before searching for global enums when the class name is not specified

Yes, that's also how [method some_method] and [method SomeClass.some_method] operate. The same logic can be used for [member some_member] and [member SomeClass.some_member] too.

Note that for each case (member and enum hyperlinks), it has to be implemented in the editor (likely DocData for the parsing and EditorHelp for the linking) and in the makerst.py script (parsing and hyperlink creation).

Hi

I'll try to do this

I've handled the makerst.py part for [member] and [signal], not yet for [enum] as we don't properly document enums as a separate entity yet in the docs.

The support of [member] and [signal] in the in-engine help is still unimplemented.

I'll open a new issue regarding enums documentation, as currently we don't do anything with this metadata.

Was this page helpful?
0 / 5 - 0 ratings