add doxygen definition for group forms to form.inc

pwolanin - November 26, 2007 - 03:37
Project:Drupal
Version:6.x-dev
Component:forms system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Per suggestion by merlinofchaos - much of Drupal core has been updated (especially by Crell, and also by me and others) so that form builder functions are denoted with @ingroup forms. The only problem - this group is not defined in the doxygen, so the group does not appear on the API site as was intended.

Attached patch is my wild stab at this - someone who knows more about doxygen should take a look.

AttachmentSize
forms-groups.patch858 bytes

#1

webchick - November 26, 2007 - 04:00
Status:patch (code needs review)» patch (code needs work)

Woo, documentation. Could we please have an example in here too? The description itself is a bit jargon-y.

I found this in user_pass() which seems like it'd work as an example:

<?php
/**
* Form builder; Request a password reset.
*
* @ingroup forms
* @see user_pass_validate().
* @see user_pass_submit().
*/
?>

#2

Crell - November 26, 2007 - 04:30

I am not a Doxygen expert so I don't know if the above will work as intended, but +1 if it does. :-) (I don't know how to test this without setting up a full api.module site.)

I don't think we can do comments within comments, so I don't know how to properly format an example here. However, I would suggest a text change:

"All core modules should declare their form builder functions..." should not say just core. Contrib should be held to the same standards as core, including the OCD use of API documentation. :-) "All modules should declare..."

#3

Crell - November 26, 2007 - 04:30
Priority:minor» normal

Also setting to normal, since a large chunk of api.drupal.org not working as desired is non-minor.

#4

pwolanin - November 27, 2007 - 01:15
Status:patch (code needs work)» patch (code needs review)

well, looks like my WAG about escaping the @ was correct for the doxygen standard: http://www.stack.nl/~dimitri/doxygen/commands.html#cmdat

but as far as I can tell, the api module doesn't support escaping:

$documentation = preg_replace('!@see ([a-zA-Z0-9_]+) (.*?) \n!', str_replace('%24', '$', l('$2', 'api/group/$1/'. $branch_name)), $documentation);

so, the attached patch references a couple example functions but doesn't try to spell it out.

AttachmentSize
forms-groups-195283-4.patch977 bytes

#5

drumm - December 5, 2007 - 18:04
Status:patch (code needs review)» patch (code needs work)

The two groups with similar identifiers might be a bit confusing.

Since there is a description of how to do something, an example would be good. Some user-facing documentation, in addition to the instructuions for core developers, would be good.

Use one space between sentences, not two.

Go ahead and write the documentation as it should be. Not properly parsing escaped @ is a bug and should be fixed in API module instead of degrading documentation quality to work around it.

#6

pwolanin - December 20, 2007 - 23:06

The choice of group "forms" was not mine - I could even roll a patch to make it "form-builders" or some such?

#7

pwolanin - January 11, 2008 - 02:53
Status:patch (code needs work)» active (needs more info)

per a long-ago IRC conversation with drumm and comments above, renaming the "form" group to "form_api" and adding more to the docs.

AttachmentSize
forms-groups-195283-7.patch1.34 KB

#8

pwolanin - January 11, 2008 - 02:54
Status:active (needs more info)» patch (code needs review)

oops

#9

pwolanin - January 20, 2008 - 02:42

removing the word "core" per Crell above.

AttachmentSize
forms-groups-195283-9.patch1.33 KB

#10

chx - January 20, 2008 - 17:20
Status:patch (code needs review)» patch (reviewed & tested by the community)

I think this is good to go.

#11

Gábor Hojtsy - January 21, 2008 - 15:17
Status:patch (reviewed & tested by the community)» fixed

Comitted, thanks.

#12

Anonymous (not verified) - February 4, 2008 - 16:06
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.