Skip to content

Commit

Permalink
WIP: Update classref links for new 'api' cross-reference role
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga committed Mar 17, 2020
1 parent 448cae0 commit 4650b43
Show file tree
Hide file tree
Showing 137 changed files with 1,390 additions and 1,390 deletions.
14 changes: 7 additions & 7 deletions community/contributing/updating_the_class_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,19 @@ Godot's class reference supports BBcode-like tags. They add nice formatting to t
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| Tag | Effect | Usage | Result |
+===========================+================================+===================================+===================================================+
| [Class] | Link a class | Move the [Sprite]. | Move the :ref:`class_sprite`. |
| [Class] | Link a class | Move the [Sprite]. | Move the :ref:`api:class_sprite`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [method methodname] | Link to a method in this class | Call [method hide]. | See :ref:`hide <class_spatial_method_hide>`. |
| [method methodname] | Link to a method in this class | Call [method hide]. | See :ref:`hide <api:class_spatial_method_hide>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [method Class.methodname] | Link to another class's method | Call [method Spatial.hide]. | See :ref:`hide <class_spatial_method_hide>`. |
| [method Class.methodname] | Link to another class's method | Call [method Spatial.hide]. | See :ref:`hide <api:class_spatial_method_hide>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [member membername] | Link to a member in this class | Get [member scale]. | Get :ref:`scale <class_node2d_property_scale>`. |
| [member membername] | Link to a member in this class | Get [member scale]. | Get :ref:`scale <api:class_node2d_property_scale>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [member Class.membername] | Link to another class's member | Get [member Node2D.scale]. | Get :ref:`scale <class_node2d_property_scale>`. |
| [member Class.membername] | Link to another class's member | Get [member Node2D.scale]. | Get :ref:`scale <api:class_node2d_property_scale>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [signal signalname] | Link to a signal in this class | Emit [signal renamed]. | Emit :ref:`renamed <class_node_signal_renamed>`. |
| [signal signalname] | Link to a signal in this class | Emit [signal renamed]. | Emit :ref:`renamed <api:class_node_signal_renamed>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [signal Class.signalname] | Link to another class's signal | Emit [signal Node.renamed]. | Emit :ref:`renamed <class_node_signal_renamed>`. |
| [signal Class.signalname] | Link to another class's signal | Emit [signal Node.renamed]. | Emit :ref:`renamed <api:class_node_signal_renamed>`. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
| [b] [/b] | Bold | Some [b]bold[/b] text. | Some **bold** text. |
+---------------------------+--------------------------------+-----------------------------------+---------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion development/cpp/custom_godot_servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ object-oriented C code.
References
~~~~~~~~~~~

- :ref:`RID<class_rid>`
- :ref:`RID<api:class_rid>`
- `core/rid.h <https://github.com/godotengine/godot/blob/master/core/rid.h>`__

Registering the class in GDScript
Expand Down
4 changes: 2 additions & 2 deletions development/cpp/custom_modules_in_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ Remember to:
But this is not all, depending what you do, you will be greeted with
some (hopefully positive) surprises.

- If you inherit from :ref:`class_Node` (or any derived node type, such as
- If you inherit from :ref:`api:class_Node` (or any derived node type, such as
Sprite), your new class will appear in the editor, in the inheritance
tree in the "Add Node" dialog.
- If you inherit from :ref:`class_Resource`, it will appear in the resource
- If you inherit from :ref:`api:class_Resource`, it will appear in the resource
list, and all the exposed properties can be serialized when
saved/loaded.
- By this same logic, you can extend the Editor and almost any area of
Expand Down
2 changes: 1 addition & 1 deletion development/cpp/custom_resource_format_loaders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ data types. If not, refer to this guide :ref:`doc_custom_modules_in_c++`.
References
~~~~~~~~~~

- :ref:`ResourceLoader<class_resourceloader>`
- :ref:`ResourceLoader<api:class_resourceloader>`
- `core/io/resource_loader.cpp <https://github.com/godotengine/godot/blob/master/core/io/resource_loader.cpp>`_

What for?
Expand Down
6 changes: 3 additions & 3 deletions development/cpp/object_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object class
General definition
------------------

:ref:`Object <class_object>` is the base class for almost everything. Most classes in Godot
:ref:`Object <api:class_object>` is the base class for almost everything. Most classes in Godot
inherit directly or indirectly from it. Objects provide reflection and
editable properties, and declaring them is a matter of using a single
macro like this.
Expand Down Expand Up @@ -232,7 +232,7 @@ Adding signals to a class is done in ``_bind_methods``, using the
References
----------

:ref:`Reference <class_reference>` inherits from Object and holds a
:ref:`Reference <api:class_reference>` inherits from Object and holds a
reference count. It is the base for reference counted object types.
Declaring them must be done using Ref<> template. For example:

Expand All @@ -255,7 +255,7 @@ References:
Resources:
----------

:ref:`Resource <class_resource>` inherits from Reference, so all resources
:ref:`Resource <api:class_resource>` inherits from Reference, so all resources
are reference counted. Resources can optionally contain a path, which
reference a file on disk. This can be set with ``resource.set_path(path)``.
This is normally done by the resource loader though. No two different
Expand Down
2 changes: 1 addition & 1 deletion getting_started/editor/command_line_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Command line reference
+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``--main-pack <file>`` | Path to a pack (.pck) file to load. |
+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``--render-thread <mode>`` | Render thread mode ('unsafe', 'safe', 'separate'). See :ref:`Thread Model <class_ProjectSettings_property_rendering/threads/thread_model>` for more details. |
| ``--render-thread <mode>`` | Render thread mode ('unsafe', 'safe', 'separate'). See :ref:`Thread Model <api:class_ProjectSettings_property_rendering/threads/thread_model>` for more details. |
+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``--remote-fs <address>`` | Remote filesystem (``<host/IP>[:<port>]`` address). |
+------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
Expand Down
6 changes: 3 additions & 3 deletions getting_started/editor/unity_to_godot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ Unity can handle script serialization in two ways:

Godot also has a built-in script serialization system, but it works only explicitly.
You can serialize any serializable type (:ref:`built-in and various engine types <doc_binary_serialization_api>`,
including :ref:`class_Array` and :ref:`class_Dictionary`) using the ``export`` keyword.
including :ref:`api:class_Array` and :ref:`api:class_Dictionary`) using the ``export`` keyword.
See the :ref:`exports documentation <doc_gdscript_exports>` for details.

Unity also has a data type called ``ScriptableObject`` used to serialize custom asset objects.
Its equivalent in Godot is the base class for all resources: :ref:`class_Resource`.
Creating a script that inherits :ref:`class_Resource` will allow you to create custom serializable objects. More information about resources can be found :ref:`here <doc_resources>`.
Its equivalent in Godot is the base class for all resources: :ref:`api:class_Resource`.
Creating a script that inherits :ref:`api:class_Resource` will allow you to create custom serializable objects. More information about resources can be found :ref:`here <doc_resources>`.

Using Godot in C++
------------------
Expand Down
2 changes: 1 addition & 1 deletion getting_started/scripting/c_sharp/c_sharp_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ As you can see, functions normally in global scope in GDScript like Godot's
``print`` function are available in the ``GD`` class which is part of
the ``Godot`` namespace. For a list of methods in the ``GD`` class, see the
class reference pages for
:ref:`@GDScript <class_@gdscript>` and :ref:`@GlobalScope <class_@globalscope>`.
:ref:`@GDScript <api:class_@gdscript>` and :ref:`@GlobalScope <api:class_@globalscope>`.

.. note::
Keep in mind that the class you wish to attach to your node should have the same
Expand Down
4 changes: 2 additions & 2 deletions getting_started/scripting/c_sharp/c_sharp_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ It is possible to bind values when establishing a connection by passing an objec
minusButton.Connect("pressed", this, "ModifyValue", new object[] { -1 });
}
Signals support parameters and bound values of all the `built-in types <https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table>`_ and Classes derived from :ref:`Godot.Object <class_Object>`.
Signals support parameters and bound values of all the `built-in types <https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table>`_ and Classes derived from :ref:`Godot.Object <api:class_Object>`.
Consequently, any ``Node`` or ``Reference`` will be compatible automatically, but custom data objects will need to extend from `Godot.Object` or one of its subclasses.

.. code-block:: csharp
Expand Down Expand Up @@ -224,7 +224,7 @@ Full list of defines

* One of ``GODOT_X11``, ``GODOT_WINDOWS``, ``GODOT_OSX``, ``GODOT_ANDROID``, ``GODOT_HTML5``,
or ``GODOT_SERVER`` depending on the OS. These names may change in the future.
These are created from the ``get_name()`` method of the :ref:``OS <class_OS>`` singleton,
These are created from the ``get_name()`` method of the :ref:``OS <api:class_OS>`` singleton,
but not every possible OS the method returns is an OS that Godot with Mono runs on.

When **exporting**, the following may also be defined depending on the export features:
Expand Down
14 changes: 7 additions & 7 deletions getting_started/scripting/cross_language_scripting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Instantiating C# nodes from GDScript

Using C# from GDScript doesn't need much work. Once loaded
(see :ref:`doc_gdscript_classes_as_resources`) the script can be instantiated
with :ref:`new() <class_CSharpScript_method_new>`.
with :ref:`new() <api:class_CSharpScript_method_new>`.

::

Expand All @@ -97,14 +97,14 @@ Instantiating GDScript nodes from C#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From the C# side, everything work the same way. Once loaded, the GDScript can
be instantiated with :ref:`GDScript.New() <class_GDScript_method_new>`.
be instantiated with :ref:`GDScript.New() <api:class_GDScript_method_new>`.

.. code-block:: csharp
GDScript MyGDScript = (GDScript) GD.Load("res://path_to_gd_file.gd");
Object myGDScriptNode = (Godot.Object) MyGDScript.New(); // This is a Godot.Object
Here we are using an :ref:`class_Object` but you can use type convertion like
Here we are using an :ref:`api:class_Object` but you can use type convertion like
explained in :ref:`doc_c_sharp_features_type_conversion_and_casting`.

Accessing fields
Expand Down Expand Up @@ -133,8 +133,8 @@ Accessing GDScript fields from C#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As C# is statically typed, accessing GDScript from C# is a bit more
convoluted, you will have to use :ref:`Object.Get() <class_Object_method_get>`
and :ref:`Object.Set() <class_Object_method_set>`. The first argument is the name of the field you want to access.
convoluted, you will have to use :ref:`Object.Get() <api:class_Object_method_get>`
and :ref:`Object.Set() <api:class_Object_method_set>`. The first argument is the name of the field you want to access.

.. code-block:: csharp
Expand All @@ -147,7 +147,7 @@ and :ref:`Object.Set() <class_Object_method_set>`. The first argument is the nam
Keep in mind that when setting a field value you should only use types the
GDScript side knows about.
Essentially, you want to work with built-in types as described in :ref:`doc_gdscript` or classes extending :ref:`class_Object`.
Essentially, you want to work with built-in types as described in :ref:`doc_gdscript` or classes extending :ref:`api:class_Object`.

Calling methods
---------------
Expand All @@ -174,7 +174,7 @@ Calling GDScript methods from C#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To call GDScript methods from C# you'll need to use
:ref:`Object.Call() <class_Object_method_call>`. The first arguments is the
:ref:`Object.Call() <api:class_Object_method_call>`. The first arguments is the
name of the method you want to call. The following arguments will be passed
to said method.

Expand Down
4 changes: 2 additions & 2 deletions getting_started/scripting/gdscript/gdscript_advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ too. Some Examples:
In GDScript, only base types (int, float, string and the vector types)
are passed by value to functions (value is copied). Everything else
(instances, arrays, dictionaries, etc) is passed as reference. Classes
that inherit :ref:`class_Reference` (the default if nothing is specified)
that inherit :ref:`api:class_Reference` (the default if nothing is specified)
will be freed when not used, but manual memory management is allowed too
if inheriting manually from :ref:`class_Object`.
if inheriting manually from :ref:`api:class_Object`.

Arrays
------
Expand Down
Loading

0 comments on commit 4650b43

Please sign in to comment.