Skip to content

Commit

Permalink
[TASK] Move rest link chapters on separate pages
Browse files Browse the repository at this point in the history
  • Loading branch information
linawolf committed Jul 31, 2024
1 parent 7964663 commit 995bd38
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
70 changes: 70 additions & 0 deletions Documentation/Reference/ReStructuredText/Links/Api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
:navigation-title: API links

.. _links-api:

================================================
API links: More information on TYPO3 PHP classes
================================================

At https://api.typo3.org/ all classes and interfaces of the
TYPO3 Core are listed with their public members and descriptions. The API
itself also links to the source code on GitHub. You can use implicit and
explicit links to these:

.. contents::

.. _links-api-explicit:

Explicit links to api.typo3.org
===============================

.. literalinclude:: _Api.rst.txt

The links then look like this:

.. include:: _Api.rst.txt

Explicit links can use the interlink scheme to link to different TYPO3 versions.
If not specified they also link to the :confval:`guides-extension-typo3-core-preferred`.

If you want to link directly to the source files on GitHub, you can use the
:ref:`:t3src: text role <linking-core-source>`.

.. _links-api-fqn:

Implicit links to fully-qualified names
=======================================

Implicit links have the advantage that they show more information about the
class or interface in a popover while they still offer a link to the API.

.. literalinclude:: _ApiImplicit.rst.txt

The links then look like this:

.. include:: _ApiImplicit.rst.txt

As you can see, only links to the namespace `/TYPO3/CMS` can be linked to the
API. We do display general information about some other namespaces that are
commonly used in TYPO3 development. Example namespaces should always start with
`\MyVendor\`. Use `\MyVendor\MyExtension\` for extensions and
`\MyVendor\MySitepackage\` for sitepackages.

Implicit links are always referring to your
:confval:`guides-extension-typo3-core-preferred` as set in the
:ref:`guides.xml <guides-xml>`.

.. _links-api-short:

Links to the API with the short class name
==========================================

Using the text role `php-short` you can display the short name of the class
or interface withing the text. Other then that it works just like the
:ref:`:php: <links-api-fqn>` text role.

.. literalinclude:: _ApiShort.rst.txt

The links then look like this:

.. include:: _ApiShort.rst.txt
7 changes: 7 additions & 0 deletions Documentation/Reference/ReStructuredText/Links/_Api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. Explicit links
* :api-class:`\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer`
* :api-class:`In main <api-dev:\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer>`
* :api-class:`In 11.5 <api-11:\TYPO3\CMS\Extbase\Routing\ExtbasePluginEnhancer>`
* :api-class:`\TYPO3\CMS\Core\EventDispatcher\EventDispatcher
<api:\TYPO3\CMS\Core\EventDispatcher\EventDispatcher>`
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.. Implicit links using the :php: text role:
* :php:`\TYPO3\CMS\Adminpanel\Controller\AjaxController`
* :php:`\TYPO3\CMS\Core\Http\Dispatcher`
* :php:`\TYPO3\CMS\Adminpanel\ModuleApi\ContentProviderInterface`
* :php:`\TYPO3\CMS\Backend\Search\LiveSearch\SearchDemand\DemandPropertyName`
* :php:`\TYPO3\CMS\Backend\Form\Behavior\OnFieldChangeTrait`
* :php:`\Psr\Log\LoggerInterface`
* :php:`\TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper`
* :php:`\MyVendor\MyExtension\FooBar`
* :php:`\Foo\Bar\Something`

.. prevent help text being displayed
`This\Is\No\Class`
11 changes: 11 additions & 0 deletions Documentation/Reference/ReStructuredText/Links/_ApiShort.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. Short PHP class names, still linking to the API:
* :php-short:`\TYPO3\CMS\Adminpanel\Controller\AjaxController`
* :php-short:`\TYPO3\CMS\Core\Http\Dispatcher`
* :php-short:`\TYPO3\CMS\Adminpanel\ModuleApi\ContentProviderInterface`
* :php-short:`\TYPO3\CMS\Backend\Search\LiveSearch\SearchDemand\DemandPropertyName`
* :php-short:`\TYPO3\CMS\Backend\Form\Behavior\OnFieldChangeTrait`
* :php-short:`\Psr\Log\LoggerInterface`
* :php-short:`\TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper`
* :php-short:`\MyVendor\MyExtension\FooBar`
* :php-short:`\Foo\Bar\Something`

0 comments on commit 995bd38

Please sign in to comment.