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:

Entity API

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

@defgroup entity_api

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, add

@ingroup entity_api

to their documentation headers. That will make these classes etc. show up on the Topic page on api.drupal.org.

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

Berdir’s picture

We'll need to decide if we only want to do a very very basic overview or or add more than that. Because there's a ton of stuff that could be added and would probably require multiple @defgroups so that it can be split into multiple pages (content and config entities for example).

I'm working on d.o documentation here: https://drupal.org/developing/api/entity

jhodgdon’s picture

Well, that's a good question. We definitely don't want to try to put everything from https://drupal.org/developing/api/entity into defgroups, I think. But we should have:
- A basic description of what "entities" are (and config vs. content entities) (one paragraph, with a few examples of each type, and maybe an explanation of how config entities differ from config that doesn't use entities), and maybe a quick note on when you would want to define your own type of entity vs. using an existing one or making an instance of an existing one vs. other types of plugins?
- An outline of what a module would need to do to define a content entity type -- which classes/interfaces they would need to extend/implement, and something about the annotation, and maybe either a link to a good example in Core or just say "Look for classes that extend this"
- An outline of what a module would need to do to define a config entity type -- which classes/interfaces they would need to extend/implement, something about annotation, and something about the config schema (or a link to the Config topic); also a link to a good example in Core or just say "Look for classes that extend this"
- A link to https://drupal.org/developing/api/entity and/or other pages in that section to get more information

So... I think the idea would be to provide the minimal information that someone who is willing to go look at examples and read other documentation would need, not a tutorial that goes in depth through every step, explains where to put the files, etc.

How's that for a plan?

jhodgdon’s picture

Issue tags: +beta target
jhodgdon’s picture

Status: Active » Postponed
Related issues: +#2216529: Fill in topic/@defgroup docs for Config and State System

This other issue #2216529: Fill in topic/@defgroup docs for Config and State System is adding some info to this topic, so probably best to wait until it's done.

jhodgdon’s picture

Status: Postponed » Active

That other patch landed. It added info on the config entities to the Entity topic; needs filling in for non-config entities.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon

I think this is the next thing to work on...

jhodgdon’s picture

Status: Active » Needs review
FileSize
11.39 KB

Here's a first pass. Note that the other issue linked above already added a bunch of stuff about config entities; this is filling in details for content entities, and for the general sections describing what an entity is, etc.

Berdir’s picture

Thanks!

Will review Asap and also ask @cgalli (who's working with me on an entity example module and documentation) to review it and possibly work on it.

Did you see the existing documention that was written at https://drupal.org/developing/api/entity?

jhodgdon’s picture

I didn't look at that as carefully as I probably should. I did link to that doc page/section in my patch though. That's kind of the objective of these @defgroup topic pages - give an overview, link in a few key classes/functions/whatever, and link to more comprehensive docs.

jhodgdon’s picture

FileSize
11.28 KB

Reroll for psr-4 and clean apply.

Can we get this reviewed, please? It would be good to get this in...

  • Commit 371e762 on 8.x by webchick:
    Issue #2216533 by jhodgdon: Fill in topic/@defgroup docs for Entity API...
webchick’s picture

Status: Needs review » Fixed

Thanks, jhodgdon. I don't see anything immediately glaring here, and the Entity API people are currently wrapped up on trying to get the Entity API, well, done. :)

Since these are "just" docs, and aren't going to break any code by committing them, and since this has sat at needs review for over 2 weeks, I'm comfortable committing this now, and doing subsequent refinement in follow-up patches.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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