diff scripts/mkdoc.pl @ 23393:675ad11b5c05

recognize docstrings for +package functions * scripts/mkdoc.pl: Emit package.name as function name for +package/name.m files.
author John W. Eaton <jwe@octave.org>
date Thu, 13 Apr 2017 10:23:26 -0400
parents 092078913d54
children
line wrap: on
line diff
--- a/scripts/mkdoc.pl	Wed Apr 12 16:55:19 2017 -0700
+++ b/scripts/mkdoc.pl	Thu Apr 13 10:23:26 2017 -0400
@@ -49,9 +49,21 @@
       || $paths[-1] !~ s/(\.in|)\.m$//i)  # skip non m-files, and remove extension
     { next MFILE; }
 
-  ## @classes will have @class/method as their function name
-  my $fcn = $paths[-2] =~ m/^@/ ? File::Spec->catfile (@paths[-2, -1])
-                                : $paths[-1];
+  my $fcn;
+  if ($paths[-2] =~ m/^@/)
+    {
+      ## @classes will have @class/method as their function name
+      $fcn = File::Spec->catfile (@paths[-2, -1]);
+    }
+  elsif ($paths[-2] =~ m/^\+/)
+    {
+      ## +package functions have package.name their function name
+      $fcn = substr ($paths[-2], 1) . "." . $paths[-1];
+    }
+  else
+    {
+      $fcn = $paths[-1];
+    }
 
   my @help_txt = gethelp ($fcn, $full_fname);
   next MFILE unless @help_txt;