Closed (fixed)
Project:
Examples for Developers
Version:
7.x-1.x-dev
Component:
Other
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Apr 2010 at 19:42 UTC
Updated:
17 Oct 2014 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rfayIn addition, I think a docs section would be good - a set of pages explaining what each module is about
Comment #2
johnalbinSince we're now including the examples module in the api.drupal.org docs, we desperately need a Table of Contents or something to make it easy to navigate all of the examples in this project.
Then the docs at contributions/docs/developer can point to the index page included with this project.
Comment #3
johnalbinHere's a patch that moves the links from developer/index.php into an examples.index.php.
Once this is in, we can modify the developer/index.php to just use this syntax to link to this module's examples.index.php file.
Comment #4
rfayWorks for me. Committed to CVS HEAD. http://drupal.org/cvs?commit=365672
Thanks for your contribution here and in the other issue as well.
Still lots of work to do on this issue, so leaving "Needs work"
Comment #5
rstamm commenteda base module is a good idea which provides a main landing page (text and list of enabled example modules) and maybe some base functionalities for the example modules, such as a main menu entry and main permission.
patch is an example for a base module.
Comment #6
dave reidWe can probably scan module files and their .info properties for example modules instead of relying on a new hook, which might confuse people using these examples as base code.
Comment #7
rfay@davereid, I agree: We want to keep the examples as lean as possible, focusing on communicating about the API at hand, and not introduce new ones just to make this module itself work well.
I'd rather have a static list of module entry points (that got updated when new things were added) than something that adds a hook. I don't think it would be too hard.
Scanning the info files would be OK; not sure we actually have to do that work.
Comment #8
codewaggle commentedWhere is "contributions/docs/developer" located?
I tried "http://drupal.org/contributions/docs/developer" and got "Page not found".
Comment #9
rfay@codewaggle, it's in CVS, so cvs.drupal.org/cvs/contributions/docs/developer
Currently, examples gets checked out into that neighborhood so that API module can index it.
Comment #10
codewaggle commented@rfay, Thanks.
Looks like the paths have been changed a bit, but this pointed me in the right direction.
cvs.drupal.org/cvs/contributions/docs/developer
was redirected to
http://drupalcode.org/cvs/contributions/docs/developer (404 error)
I tried
http://drupalcode.org/
and was redirected to
http://drupalcode.org/viewvc/drupal/
The contributions folder is listed there.
Comment #11
rstamm commentedya, to keep the base module more simple and examples without the special hook is better. we can add a separate custom hook example later.
examples getting more and more with the time, maybe it's good the if the base module provides a separate examples menu block like the devel module.
Comment #12
ilo commentedjust as a reminder: I'm starting to have the feeling the we should sepparate in some way core/api examples than other 'features' examples like token, or any of the features awaiting in the issue queue..
Comment #13
rfayIMO as a general rule no contrib features should go into Examples. I am *way* into using or creating other projects. The only two exceptions to this are VT and Token, which have exact analogs in D7.
I don't even want a CCK field example in here, but would love to create another project for that.
Examples is for core features. Have to draw the line somewhere :-)
Comment #14
ilo commentedwhat if these non-core examples go to a documentation page in the corresponding project documentation page (so it must exists)? cck, ctools, there are a few in the issue queue as features to be included into examples.
Comment #15
rfayIMO examples should go into projects where they can be maintained, as this project has amply demonstrated. It's just that non-core can't go here. But it's easy enough to create new projects. There *is* a views_example project, and I so dearly want API examples to go into that, and I think the maintainer is open to it. I would hope for other examples of the type. And we could certainly link to them. And then eventually we'll get an "example" taxonomy term for projects.
Comment #16
ilo commentedThat is a good idea, +1!.
On the other hand, about organizing this project:
Examples integration in api.drupal.org for D6 and D7 are different:
- D6 shows a list of links, each link pointing to an example module
- D7 shows a single link to an additional page.
Just testing, I've found extremelly dificult to reach the "examples" project navigating the documentation section of d.o. I had to click several links until I finally found the api.drupal.org link.
I agree with rfay at #1 that we may introduce a documentation page describing what each example module does, and link that page at: http://drupal.org/developing/modules . Other possible place where a link to that documentation page makes sense is here: http://drupal.org/node/326 (Working with the Drupal API)
You know, my english is not the best, I'm spanish, so.. anybody wants to review/rewrite it if I do write that documentation page?
Comment #17
rfayActually, we're in charge of the initial link; it's just edited via CVS. It just hasn't been properly handled. And we should have a basic landing page as part of this module that's maintained here.
I think we should probably have a root "examples" module that just turns on the /examples menu router item and explains what this is all about. And it could/should have a more informative landing page built in for API.d.o.
Comment #18
mile23I give you: http://api.drupal.org/api/examples/6
http://api.drupal.org/api/drupal doesn't have a direct link to examples. Also, I think it would be better for the main API page to simply link to the top Examples group as one item, rather than try to link to all the individual modules. Given the evolving nature of these docs, it's less work at that level.
The real problem is that Drupal doxygen brings all the groups up to the front page, ignoring the heirarchy. So if the canonical link is /api/examples, it gives you the main examples group and all the subgroups in a big long list. Confusing. But it gives links so you can browse the files and functions and constants, which is probably valuable.
I don't mind bombing through a bunch of this doxygen commenting task, but I want to be going in the right direction. Anyone see any other problems with the way the D6 examples API page is going?
Comment #19
mile23Hah. Meant to post the comment on this thread: #767204: API.drupal.org: Rework Doxygen comments so people can navigate the comments
But I guess it still works here.
Comment #20
mile23I made an .info and .module file for D7, and removed the .index.php file. Eventually we patch against core for a link from api.drupal.org, for the examples group.
This can be a basic template for how sub-modules can document themselves.
Comment #21
dashohoxha commentedI think that for a beginner to Drupal (as I am) it is a bit difficult to find the way around the examples. It is not so clear which example to study first and which later. After looking at some of them, it became clear to me that there are some prerequisites (dependencies), although each of the examples is supposed to be stand-alone. For example menus are used in almost all examples, so it could be better if menu_example is studied first.
There may be other dependencies like this as well. It might be a good idea if these dependencies are somehow documented. Or it may be even better if there is a suggested order of studying the examples.
Comment #22
mile23I'm calling this closed. Most of the ideas raised here have been implemented for 7.x and moving forward to 8.x.
We currently have #2209627: [meta] Module Checklist for Examples for contributors, and #1007276: [policy, no patch] Comaintainer practices and procedures for co-maintainers.