Commit 1371390f authored by alexpott's avatar alexpott

Issue #2299677 by er.pushpinderrana, gauravkhambhala | jhodgdon: Fix up...

Issue #2299677 by er.pushpinderrana, gauravkhambhala | jhodgdon: Fix up annotation-related topics a bit.
parent b1899dc0
......@@ -10,9 +10,10 @@
use Drupal\Component\Annotation\Plugin;
/**
* @defgroup plugin_context context definition plugin metadata
*
* @defgroup plugin_context Annotation for context definition
* @{
* Describes how to use ContextDefinition annotation.
*
* When providing plugin annotations, contexts can be defined to support UI
* interactions through providing limits, and mapping contexts to appropriate
* plugins. Context definitions can be provided as such:
......@@ -47,6 +48,9 @@
* "album" = @ContextDefinition("entity:node", label = @Translation("Album"))
* }
* @endcode
*
* @see annotation
*
* @}
*/
......
......@@ -11,9 +11,10 @@
use Drupal\Core\StringTranslation\TranslationWrapper;
/**
* @defgroup plugin_translatable Translatable plugin metadata
*
* @defgroup plugin_translatable Annotation for translatable text
* @{
* Describes how to put translatable UI text into annotations.
*
* When providing plugin annotation, properties whose values are displayed in
* the user interface should be made translatable. Much the same as how user
* interface text elsewhere is wrapped in t() to make it translatable, in plugin
......@@ -38,6 +39,7 @@
* context is supported.
*
* @see i18n
* @see annotation
* @}
*/
......
......@@ -1573,3 +1573,54 @@ function hook_display_variant_plugin_alter(array &$definitions) {
/**
* @} End of "addtogroup hooks".
*/
/**
* @defgroup annotation Annotations
* @{
* Annotations for class discovery and metadata description.
*
* The Drupal plugin system has a set of reusable components that developers
* can use, override, and extend in their modules. Most of the plugins use
* annotations, which let classes register themselves as plugins and describe
* their metadata. (Annotations can also be used for other purposes, though
* at the moment, Drupal only uses them for the plugin system.)
*
* To annotate a class as a plugin, add code similar to the following to the
* end of the documentation block immediately preceding the class declaration:
* @code
* * @ContentEntityType(
* * id = "comment",
* * label = @Translation("Comment"),
* * ...
* * base_table = "comment"
* * )
* @endcode
*
* Note that you must use double quotes; single quotes will not work in
* annotations.
*
* Some annotation types, which extend the "@ PluginID" annotation class, have
* only a single 'id' key in their annotation. For these, it is possible to use
* a shorthand annotation. For example:
* @code
* * @ViewsArea("entity")
* @endcode
* in place of
* @code
* * @ViewsArea(
* * id = "entity"
* *)
* @endcode
*
* The available annotation classes are listed in this topic, and can be
* identified when you are looking at the Drupal source code by having
* "@ Annotation" in their documentation blocks (without the space after @). To
* find examples of annotation for a particular annotation class, such as
* EntityType, look for class files that have an @ annotation section using the
* annotation class.
*
* @see plugin_translatable
* @see plugin_context
*
* @}
*/
......@@ -2867,50 +2867,3 @@ function hook_config_schema_info_alter(&$definitions) {
/**
* @} End of "addtogroup hooks".
*/
/**
* @defgroup annotation Annotations
* @{
* Annotations for class discovery and metadata description.
*
* The Drupal plugin system has a set of reusable components that developers
* can use, override, and extend in their modules. Most of the plugins use
* annotations, which let classes register themselves as plugins and describe
* their metadata. (Annotations can also be used for other purposes, though
* at the moment, Drupal only uses them for the plugin system.)
*
* To annotate a class as a plugin, add code similar to the following to the
* end of the documentation block immediately preceding the class declaration:
* @code
* * @ContentEntityType(
* * id = "comment",
* * label = @Translation("Comment"),
* * ...
* * base_table = "comment"
* * )
* @endcode
*
* Note that you must use double quotes; single quotes will not work in
* annotations.
*
* Some annotation types, which extend the "@ PluginID" annotation class, have
* only a single 'id' key in their annotation. For these, it is possible to use
* a shorthand annotation. For example:
* @code
* * @ViewsArea("entity")
* @endcode
* in place of
* @code
* * @ViewsArea(
* * id = "entity"
* *)
* @endcode
*
* The available annotation classes are listed in this topic, and can be
* identified when you are looking at the Drupal source code by having
* "@ Annotation" in their documentation blocks (without the space after @). To
* find examples of annotation for a particular annotation class, such as
* EntityType, look for class files that have an @ annotation section using the
* annotation class.
* @}
*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment