The Drupal core examples have moved out of the contrib/documentation and into http://drupal.org/project/examples. Can we

  • get API module to process them there (in http://drupal.org/project/examples), please?
  • Please turn off API module's processing of the examples in contrib/documentation, at least for D6+

Thanks!
-Randy

Comments

rfay’s picture

Project: Drupal.org site moderators » Drupal.org infrastructure
Component: API.drupal.org » api.drupal.org

Moving to infrastructure, as I think that's where it's supposed to be.

A note: Should we get rid of the API.drupal.org component in webmasters? Or are there times that webmasters would be the right place?

drumm’s picture

There are comments, to be moderated, so there are webmaster issues.

Good change, but I want to make sure redirects get put in place so links keep working. The HEAD version of API has some mostly-done code to handle projects, which could put this at http://api.drupal.org/api/examples/path--to--module/example.module.

Can this wait a week or two? If a stopgap is needed, the examples can be checked out under the existing drupal root.

rfay’s picture

Yes, this can wait a week or two. Thanks for working on it!

rfay’s picture

@drumm, thanks for your work on this.

Any progress on getting there?

drumm’s picture

I imported files to a separate project on my local install. The configuration is

Project: examples
URL label: 6
Page label: Examples 6

Viewing a file works .../api/examples/batch_example--batch_example.module/6. Links to functions do not work, so #179062: handle duplicate function names should be fixed. I was hoping to save that for the next release cycle, but it should be done.

rfay’s picture

Hoping that we can get api.d.o pointed at examples module soon. This causes a bit of confusion - people are seeing the old, old stuff in api.d.o, but there is current, maintained code in the Examples modules.

Thanks for your help on this.
-Randy

rfay’s picture

Thanks for your work on this. We just got pinged on this again. We're kind of between a rock and a hard place because there's no way to fix problems in the D6/D7 api examples. #724254: Create new Form Example module for D6 and D7 including multistep

jhodgdon’s picture

drumm: It looks like that blocking issue about duplicate names has been fixed... Can this migration happen now?

We also need to get rid of the old example modules in the CVS contrib repository -- they are not being maintained.

Would it also be possible to move the globals.php and index.php from the contrib doc repository (possibly under different names, such as modules/system/globals.api.php, modules/system/index.api.php) into the core repository? And I think the conditions have been met to get rid of the theme.php file that is there?

Or should I file a separate issue on those changes?

johnalbin’s picture

Looking at all the files in /cvs/drupal-contrib/contributions/docs/developer/

  • example.profile — should be removed when this issue is resolved.
  • examples/* — should be removed when this issue is resolved.
  • theme.php — should be removed after #716496: Theme functions group needs some updates is done, because then that file will be 100% redundant with better docs in core. I'll monitor that file as part of #716496: Theme functions group needs some updates.
  • topics/* — lots of good stuff that's too big for core.
  • globals.php — shouldn't its contents be in one of the *.api.php files in core? Separate issue if it isn't already.
  • index.php — again, could be moved to core in a separate issue, but given that topics directory will likely remain out of core, I think index.php should stay outside of core too. Otherwise, we'd have to update core just to get a topics page added to the index.
jhodgdon’s picture

Title: Make Api module process examples module » Use examples from Examples for Developers project on api.drupal.org
Project: Drupal.org infrastructure » Drupal.org site moderators
Component: api.drupal.org » API.drupal.org

About every day or two I triage issue reports from api.drupal.org about the examples, many of which have already been fixed in the Examples for Developers project.

So I'm just wondering if we can get api.drupal.org to use the Examples for Devlopers now? Or are there still reasons we can't do this?

drumm’s picture

Project: Drupal.org site moderators » Drupal.org infrastructure
Component: API.drupal.org » api.drupal.org
Assigned: Unassigned » drumm
Status: Active » Needs review

I switched this over for the Drupal 7 docs. It should parse in the next few minutes. If nothing weird happens, the other versions can go too.

Please paste full URLs for any HTTP redirects that should be put in place.

rfay’s picture

Yeah!

We'll also want to fiddle with the contributions/docs/developer/index.php. Of course it needs a bit of love anyway.

@drumm: Examples module is only for 6 and 7, so we won't want to remove the old docs examples from earlier versions.

rfay’s picture

Just took a look, and this is looking great for D7. I think we can go ahead with D6.

Thanks!

rfay’s picture

Status: Needs review » Needs work

One glitch:

If you go to the D7 index.php, and click on the block example:
http://api.drupal.org/api/drupal/developer--contributions--modules--exam...

It goes to the right code, but you end up in the context of D6, so further searches don't work.

My bet is that this is redirect stuff and has nothing to do with the api module.

Key is updating the pointers in the index.php. I'll try to do that today.

Edit: If you go to the main D7 api page and enter block_example.module, it takes you to the correct code, but you end up in D6 land. The same is true if you enter ajax_example.module into the search box. You get to the right code, but end up in D6 context.

rfay’s picture

I updated the D7 contributions/docs/developer/index.php to include the various example modules. It probably needs some more love.

Want to take a look at it @jhodgdon?

jhodgdon’s picture

Status: Needs work » Needs review

rfay: re #14, that is true of *any* file. I thought I had filed an issue on this on either the API module or d.o webmasters queue a while back, but I cannot locate it right now... For instance, if you go to the t() page and then click on the link to bootstrap.inc you get to:
http://api.drupal.org/api/drupal/includes--bootstrap.inc/7
which as you can see, has all the D6 tabs/search stuff displayed. It's a bug. I've just filed a new issue:
#761414: D6 left blocks display when on a D7 file

I did take a look at the example pages, and they looked fine to me. I don't know that we need to include pointers to every example module on index.php?

Anonymous’s picture

I didn't find the issue jhodgdon is referring to, but I found a previously open one: #366571: api.drupal.org links are correct in pages, but all links redirect to Drupal 6 api page.

johnalbin’s picture

#724508: Left blocks are wrong version when looking at a file page shows that the d6 left-side blocks appearing on D7 pages is fixed in the HEAD version of API.module; we just need to wait "until its ready" to be deployed on the site.

I don't know that we need to include pointers to every example module on index.php?

On the Examples project page, I see 17 example modules. I agree with jhodgdon, that's definitely way too many to include on the contributions/docs/developer/index.php page; it would make the examples push the "in-depth discussions" section way to the bottom of the page where most would have to scroll to see it.

What if the examples project itself included an index of all the example modules? Then the developer/index.php could point at the examples project's index.

rfay’s picture

@JohnAlbin, @jhodgdon, I don't have any vested interest in what goes into the index.php. I think it should be updated, and in fact I updated it with all the modules. But it just needed updating. I think it needs a general update - there are many important things that aren't there, and some unimportant things that are.

What if the examples project itself included an index of all the example modules? Then the developer/index.php could point at the examples project's index.

I opened #761334: Organize Examples in a way that the whole project can be understood with exactly that thought. I think it's the right thing to do.

drumm’s picture

I fixed up some issues with D7 and got D6 going. May take a few hours to fully update.

drumm’s picture

Status: Needs review » Fixed
rfay’s picture

Thanks, drumm! Lots of favorable reactions to this. Much appreciated.

Status: Fixed » Closed (fixed)

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