Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer doc: script to auto generate list of available hooks in piwik #5684

Closed
mattab opened this issue Jun 30, 2008 · 8 comments
Closed
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.

Comments

@mattab
Copy link
Member

mattab commented Jun 30, 2008

The goal is to provide a documentation listing the hooks that plugin developers can use to enhance Piwik.
Each hook would be listed with the name, and a quick documentation of the parameters and data array (if any).

Tasks to do:
- decide on a naming convention for naming the hooks in Piwik #613
- how could we auto generate the documentation for the hooks? Example of [drupal list of hooks](http://api.drupal.org/api/group/hooks/6)
- Also provide a sample list of the hooks triggered
– on the dashboard homepage
– in a widget
– during archiving
This could be done by adding logging in the plugin hook handling code.

@robocoder
Copy link
Contributor

duped in #613

@mattab
Copy link
Member Author

mattab commented Jul 22, 2010

Not a critical doc to have, but would be nice for sure.

@mattab
Copy link
Member Author

mattab commented Sep 21, 2010

This could be maybe done as ant task in the build on the continuous build server piwik.org/qa/ ?

@mattab
Copy link
Member Author

mattab commented Mar 4, 2011

Maybe this could be done, by tagging the Hooks with a special PHP-doc tag, and then have phpdoc generate a doc for all the tags found... plus show the actual string of the event name in the code...

@robocoder
Copy link
Contributor

Would need a preprocessor as there's no existing doc tag to support this.

I'm looking at using a preprocessor for piwik.js, so might tackle this at the same time.

@mattab
Copy link
Member Author

mattab commented Mar 5, 2011

Cool vipsoft. I think a simple list of All hooks with a description (put in the comment), file & line number hook is sent from. This would be a good add to http://piwik.org/docs/plugins/

@robocoder
Copy link
Contributor

FYI

In Drupal, hooks are documented in dummy source files. They follow a convention where files are named modulename.api.php, and contain:

/**
 * phpdoc comments
 */
function hook_my_hook_name($parameters, ...) {
    /* example code */
}

WordPress hooks lack phpdocs and the same hook may be triggered in multiple places. To generate docs, one could grep for occurrences of:

do_action( 'the_hook_name', $parameters, ... );

@mattab
Copy link
Member Author

mattab commented Apr 5, 2014

Implemented :)

The list of events in Piwik is automatically generated at: http://developer.piwik.org/api-reference/events

If you have feedback or suggestion please comment!

@mattab mattab added this to the Future releases milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants