0

I am working on a module which is able to automatically generate a developer document based on the hooks, menus, files and other attributes it holds.

Often when we install a new module, We need to search for the configuration options provided by it. So by automatically generating a document, this issue will be solved.

  • I started working on this based on clive's suggestion in the post (Get a particular module's information programmatically)

  • I could retrieve the menu links created by a module as clive suggested in that post.

  • To retrieve hooks used in a module, I used the PHP function token_get_all() to get all function used in a file and checked whether its a hook.

Now, I need some suggestions about what can you know by looking through a modules file. What else in a module file can help one understand a newly installed module better?

Is there any API's to get information about a hook from drupal.org?

2
  • This is a very similar feature that PHPstorm provide. Instead of a document you can click on a hook and it takes you to the api documentation. I think this is an amazing idea for a module. Do you have a sandbox at Drupal.org so we (or just me) can look at the module and maybe help. Apr 7, 2015 at 16:48
  • hey darol, here it is drupal.org/sandbox/pravin.ajaaz/2467369 . Sorry I don't pushed it to sandbox at that time. Jun 5, 2015 at 7:30

2 Answers 2

2

Now there is a module for that ;) It's the Developer Docs module.

Here's a brief description about it (from its project page):

Developer Docs is a module specially made for drupal developers (amateur). When a new module is installed, it is hard to find what changes it does unless we look into the code. This module provides an overview of "what it does" without looking into the code.

This Module generates a document automatically based on the drupal elements used in the module such as:

  • Administration menu
  • Hooks
  • Database Schemas
  • Themes
  • Variables
  • Blocks
  • Node types
  • Entity Types
  • Fields (Formatter, Widget)
  • Field Formatters
  • Field Widgets
  • Hooks Created

After enabling this module, list of installed modules will be available at admin/reports/developer-docs/

1

Check out d.o's API page. It exposes various node types they should let you do some meta analysis of module. I'm not sure if api.drupal.org has an exposed API to get info about each hook. That sounds like exactly what you're looking for.

Sounds like an ambitious and useful module! If it works out, it sounds like something that would be useful in Devel. You should take its modules' code to get some ideas. Perhaps ask its maintainers too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.