We have 3 topics on api.drupal.org for Drupal 8 related to annotations. They need a little bit of work:

a) The "Annotations" topic needs to be moved from file core/modules/system/system.api.php into core/modules/system/core.api.php.

b) The "context definition plugin metadata" topic needs to have a better title (probably "Annotation for context definition") and a one-line description added to the top. See
https://www.drupal.org/node/1354#defgroup
for syntax.

c) The "Translatable plugin metadata" topic needs to have a better title (probably "Annotation for translatable text") and a one-line description added to the top. Again, see
https://www.drupal.org/node/1354#defgroup
for syntax.

d) The "Annotations" topic needs to have @see references to the other two, and the other two need to have @see references to the main Annotations topic. To make an @see reference, all you need is the machine name of the topic/group. So if the doc block says "@defgroup annotation", then the reference would say "@see annotation". @see lines should go at the end of a documentation block.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Anyone want to do this?

gauravkhambhala’s picture

Assigned: Unassigned » gauravkhambhala
gauravkhambhala’s picture

a) The "Annotations" topic needs to be moved from file core/modules/system/system.api.php into core/modules/system/core.api.php.

Patch does this job.

b) The "context definition plugin metadata" topic needs to have a better title (probably "Annotation for context definition") and a one-line description added to the top. See
https://www.drupal.org/node/1354#defgroup
for syntax.

Patch does this job except "a one-line description added to the top" Could you guide me with the text here.

c) The "Translatable plugin metadata" topic needs to have a better title (probably "Annotation for translatable text") and a one-line description added to the top. Again, see
https://www.drupal.org/node/1354#defgroup
for syntax.

Patch does this job except "a one-line description added to the top" Could you guide me with the text here.

d) The "Annotations" topic needs to have @see references to the other two, and the other two need to have @see references to the main Annotations topic. To make an @see reference, all you need is the machine name of the topic/group. So if the doc block says "@defgroup annotation", then the reference would say "@see annotation". @see lines should go at the end of a documentation block.

Patch does this job.

er.pushpinderrana’s picture

Status: Active » Needs review

@gauravkhambhala, thankyou for contribution.

You should change Status to Need Review after uploading the patch so that your patch get through Test bot.

gauravkhambhala’s picture

@er.pushpinderrana Thank you for the tip. I know this. I did not think the patch had everything, there will be more to it once my queries get answers. Anyway I will add another patch and get it reviewed again than.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patch!

Both core.api.php and system.api.php ended up with:

\ No newline at end of file

in your patches. You just need to go into your editor at the end of both of those files and hit "Enter" and save.

For one-line descriptions... I would suggest:

context topic:
Describes how to use ContextDefinition annotation.

translatable topic:
Describes how to use Translation annotation for translatable user-interface text.

One more note: There should not be a blank line between the @defgroup line and the @{ line, so could you remove those in the context and translation topics?

Thanks -- the rest of the patch looks great!

gauravkhambhala’s picture

Status: Needs work » Needs review
FileSize
5.61 KB

Thank you for the inputs. Here is the updated patch.

Status: Needs review » Needs work

The last submitted patch, 7: 2299677-fix-up-annotation-related-topics_1.patch, failed testing.

er.pushpinderrana’s picture

Status: Needs work » Needs review
FileSize
5.73 KB

Just rerolled #7 patch as it unable to apply.

jhodgdon’s picture

Status: Needs review » Needs work

Ah, I guess my suggestion for the "one-line" description for the translation topic is more than one line:

+ * Describes how to use Translation annotation for translatable user-interface
+ * text.

How about:

Describes how to put translatable UI text into annotations.

Other than that, looks good, thanks for the teamwork!

er.pushpinderrana’s picture

Thanks jhodgdon!
Please review updated patch, as incorporated #10 changes.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 1371390 and pushed to 8.0.x. Thanks!

  • alexpott committed 1371390 on 8.0.x
    Issue #2299677 by er.pushpinderrana, gauravkhambhala | jhodgdon: Fix up...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.