Index: README.txt
===================================================================
RCS file: /cvs/drupal/contributions/modules/api/README.txt,v
retrieving revision 1.5
diff -u -p -r1.5 README.txt
--- README.txt 6 Mar 2006 16:33:13 -0000 1.5
+++ README.txt 14 Jun 2010 06:33:51 -0000
@@ -4,6 +4,9 @@ It is designed to assume the code it doc
and supports the following Doxygen constructs:
@mainpage
@file
+ @section
+ @subsection
+ @ref
@defgroup
@ingroup
@addtogroup (as a synonym of @ ingroup)
Index: api.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/api/api.module,v
retrieving revision 1.88.2.34
diff -u -p -r1.88.2.34 api.module
--- api.module 24 Aug 2009 03:33:48 -0000 1.88.2.34
+++ api.module 14 Jun 2010 06:33:51 -0000
@@ -11,6 +11,9 @@
* and supports the following Doxygen constructs:
* \@mainpage
* \@file
+ * \@section
+ * \@subsection
+ * \@ref
* \@defgroup
* \@ingroup
* \@addtogroup (as a synonym of \@ ingroup)
@@ -42,6 +45,9 @@ function api_help($path, $arg) {
- @mainpage
- @file
+ - @section
+ - @subsection
+ - @ref
- @defgroup
- @ingroup
- @addtogroup (as a synonym of @ ingroup)
Index: parser.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/api/parser.inc,v
retrieving revision 1.41.2.16
diff -u -p -r1.41.2.16 parser.inc
--- parser.inc 7 Aug 2009 07:14:58 -0000 1.41.2.16
+++ parser.inc 14 Jun 2010 06:33:52 -0000
@@ -500,6 +500,32 @@ function api_format_documentation($docum
// Site URLs.
$documentation = preg_replace('/' . API_RE_TAG_START . 'link \/([a-zA-Z0-9_\/-]+) (.*?) ' . API_RE_TAG_START . 'endlink/', str_replace('%24', '$', l('$2', '$1')), $documentation);
+ // Process sections, subsections and references.
+ $regexp = '/' . API_RE_TAG_START . 'section ([a-zA-Z0-9_-]+) (.*)/';
+ preg_match_all($regexp, $documentation, $section_matches, PREG_SET_ORDER);
+ if (!empty($section_matches)) {
+ $documentation = preg_replace($regexp, '$2
', $documentation);
+ }
+ $regexp = '/' . API_RE_TAG_START . 'subsection ([a-zA-Z0-9_-]+) (.*)/';
+ preg_match_all($regexp, $documentation, $subsection_matches, PREG_SET_ORDER);
+ if (!empty($subsection_matches)) {
+ $documentation = preg_replace($regexp, '$2', $documentation);
+ }
+ if (!empty($section_matches) || !empty($subsection_matches)) {
+ // References must refer to a valid section or subsection in order to be
+ // replaced.
+ $search = array();
+ $replace = array();
+ foreach (array_merge($section_matches, $subsection_matches) as $match) {
+ array_shift($match);
+ $id = array_shift($match);
+ $caption = array_shift($match);
+ $search[] = '@ref ' . $id;
+ $replace[] = '' . $caption . '';
+ }
+ $documentation = str_replace($search, $replace, $documentation);
+ }
+
// Process the @see tag
$documentation = preg_replace('/\n' . API_RE_TAG_START . 'see (.*[^.])\.?/', 'See also
$1
', $documentation);