On #2148255: [meta] Make better D8 api.d.o landing page, linked to high-level overview topics, and put it in Core api.php files, we made a patch that included a stub Topic page for api.drupal.org (i.e., a @defgroup) titled:
Extending Drupal

This can be found in file core/modules/system/core.api.php where it says

@defgroup extending

The documentation to go on this page needs to be written. The idea is:

a) Write a few paragraphs about the topic.

b) Link to more detailed documentation on
https://drupal.org/developing/api/8

c) If the more detailed documentation does not yet exist, create stub page(s), link to the stub pages, and add a note to this issue stating that the stub pages need to be filled out.

d) If the topic has related classes, interfaces, and functions -- appropriate for an overview -- add

@ingroup extending

to their documentation headers. That will make these classes etc. show up on the Topic page on api.drupal.org. Only include classes/functions that are appropriate for an overview page please!

For more info -- documentation standards for @defgroup/@ingroup:
https://drupal.org/coding-standards/docs#defgroup

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Issue tags: +beta target
jhodgdon’s picture

Assigned: Unassigned » jhodgdon

Actually this is probably the next one that should be written. I'll tackle tomorrow.

jhodgdon’s picture

Status: Active » Needs review
FileSize
7.21 KB

Here's a first pass on this docs. Reviews/criticism/suggestions welcome! I also made an edit of the Hooks topic, which was pretty outdated, and is referenced by this topic, and added a new topic for Plugins, which we didn't have.

jhodgdon’s picture

FileSize
7.23 KB

Oh. No one has reviewed this yet. Added one @see to the end of the hooks topic.

eojthebrave’s picture

Issue summary: View changes
Status: Needs review » Needs work

This is looking great. Thanks for taking the time to write this up and to update the existing hooks section. I have just a few comments, all of which are just my gut reaction to the documentation so feel free to ignore them if you don't agree. With the exception of one missing period, and what I think is a critical link that should be added. :)

  1. +++ b/core/includes/module.inc
    @@ -178,31 +178,46 @@ function module_uninstall($module_list = array(), $uninstall_dependents = TRUE)
    + * - Change the name of the function, substituting your module's short name
    + *   for the "hook" part of the sample function name. For instance, to implemnt
    + *   hook_batch_alter(), you would rename it to my_module_batch_alter().
    

    I think we need to make sure and explain "module's short name" and how I know what that is for my module. Might even be worthwhile to provide an example mapping "example_module.info" to example_module_batch_alter().

  2. +++ b/core/includes/module.inc
    @@ -178,31 +178,46 @@ function module_uninstall($module_list = array(), $uninstall_dependents = TRUE)
    + * To invoke a hook, use methods on
    

    Think it's worth adding something that explains why a module might want to "invoke" a hook? Making it possible for other module's to extend your own module, etc.

  3. +++ b/core/modules/system/core.api.php
    @@ -452,15 +452,63 @@
    + * @defgroup extending Extending and altering Drupal
    

    Missing period at end of line.

  4. +++ b/core/modules/system/core.api.php
    @@ -452,15 +452,63 @@
    + * Overview of add-ons and alteration methods for Drupal
    

    Missing period at end of line.

  5. +++ b/core/modules/system/core.api.php
    @@ -452,15 +452,63 @@
    + * @section extend_types Alteration mechanisms modules can use
    

    I think something like "Extending and Altering Drupal with Modules" or even just "Module basics" might be a better title for this section. Right now it doesn't tell me that this is also about "extending".

  6. +++ b/core/modules/system/core.api.php
    @@ -452,15 +452,63 @@
    + * Here is a list of the mechanisms and methods that modules can use to alter
    + * or extend Drupal's core behavior, or the behavior of other modules:
    

    This sentence can probably be simplified to just "Here is a list of ways that modules can alter or extend ...". It seems a little wordy as is. But that's just my gut reaction.

  7. +++ b/core/modules/system/core.api.php
    @@ -452,15 +452,63 @@
    + *   @link entity_api Entity API topic @endlink for more information. Note that
    + *   there are also entity hooks and plugin types that you can use to add
    + *   entity bundles or sub-types, alter display, etc.
    

    The note about sub-types and hooks doesn't seem necessary here. I feel like we can just explain that in the entity api docs.

+++ b/core/modules/system/core.api.php
@@ -452,15 +452,63 @@
+ * - Modules: Modules add to or alter the behavior and functionality of Drupal,
+ *   by using one or more of the methods listed in the section below.

I think we should add a link to https://drupal.org/developing/modules/8 in this section.

jhodgdon’s picture

FileSize
7.77 KB
4.59 KB

Many thanks for the good suggestions! Here's a new patch addressing all of the poins in #5, I think, except:
#3 - Incorrect, @defgroup line does not end in . -- see https://drupal.org/node/1354#defgroup
#5 - I decided it didn't really need a section header. This doc block is only 2 bullet lists anyway.

jhodgdon’s picture

Status: Needs work » Needs review
eojthebrave’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. Thanks for fixing up those couple of nit-picks.

jhodgdon’s picture

Issue summary: View changes

The issue summary got deleted in #5 by mistake ?!? whoops.

jhodgdon’s picture

Assigned: jhodgdon » Unassigned

Unassigning to avoid "jennifer is committing" vs. "jennifer did this patch" confusion in the RTBC committer queue.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

OMFG that is so much better I can't even explain it. I especially like having a nice list of "extension points" for Drupal 8, since this is a lot different than in 7 and below. Great work!

Committed and pushed to 8.x. Thanks!

jhodgdon’s picture

Assigned: Unassigned » webchick
Status: Fixed » Reviewed & tested by the community

This didn't actually get committed/pushed, I think?

  • Commit 633dd95 on 8.x by webchick:
    Issue #2216561 by jhodgdon: Fill in @defgroup/topic docs for Extending...
jhodgdon’s picture

Assigned: webchick » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks! That is more convincing (see #13). :)

Status: Fixed » Closed (fixed)

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