Parse and display .info files as files

Migrated issue

Reported by: dman

I've just spent (quite) a while trying to build in the ability to list and browse by module for my own contrib mirror.
Currently it's been quite frustrating because I can only find things by : searching, clicking to a function name, clicking back to the containing file, scanning the functions in that file. :-/
This also misses out on module extras declared in .inc and related files.

I could almost do it by defining each module as a topic/group, but that seemed lots of busy-work, and we've got .info files there already, being ignored.

I just want:
- a list of module names
- - a list of documented items within that module
Much more browsable.

Soo... So far I've been able to:

  • Define a new object type 'project' ... because drupal.org/projects include modules, themes and profiles, and each has a .info file, and I can't tell the difference between themes and projects
  • Get *.info files scanned and parsed, creating new items, very much like a 'file' or 'group'.
  • Create a new page callback that lists them!
  • Create individual pages for each info item, displaying a small amount of info extracted from the file. :-)

Pretty good.
But I'm having trouble linking the project/info overview with its content items. Clearly I'd want my project/module to have references to all the contained files and functions (and docs and templates).
Also the theme_ functions collected as special module-docs would be very good!

I can't quite trust just linking all files in the same folder as the info file as members of that project. It's probably right, but not always, in the case of packages. Still, I can live with some false positives.
I can't trust function name prefixes either.

What I'm wondering is

  • Does anyone know how I should better establish these references?
  • Should I make these references in the database at scan time (and is {api_reference_storage} appropriate for that job)
  • or should I do a reverse lookup based on filepath when rendering the project page.

Is this just too hard? I've gone a long way in patching this in... but am stuck at this point where it's all supposed to come together.

Ideas?