shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU shishi branch, master, updated. shishi-1-0-2-43-gcac0e3c


From: Mats Erik Andersson
Subject: [SCM] GNU shishi branch, master, updated. shishi-1-0-2-43-gcac0e3c
Date: Thu, 10 Jul 2014 20:17:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU shishi".

http://git.savannah.gnu.org/cgit/shishi.git/commit/?id=cac0e3c7d14f16a361386ccdc0f80a8300e3b638

The branch, master has been updated
       via  cac0e3c7d14f16a361386ccdc0f80a8300e3b638 (commit)
      from  4977a26d2b25c8d19cac6609b0f650c25480ddec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cac0e3c7d14f16a361386ccdc0f80a8300e3b638
Author: Mats Erik Andersson <address@hidden>
Date:   Tue Jul 8 23:58:15 2014 +0200

    gdoc: Fine tuning of text and texinfo mode.
    
    Indent text mode paragraphs.  In texinfo mode,
    prevent line breaks in parameter phrase; avoid
    blank lines between parameter descriptions.
    Coding style: avoid eval, prefer hash referencing.

-----------------------------------------------------------------------

Summary of changes:
 doc/gdoc   |   81 +++++++++++++++++++++++++++++++++++++-----------------------
 lib/init.c |    6 ++--
 2 files changed, 53 insertions(+), 34 deletions(-)

diff --git a/doc/gdoc b/doc/gdoc
index 254b25e..9391f45 100755
--- a/doc/gdoc
+++ b/doc/gdoc
@@ -178,7 +178,6 @@ my %highlights_html = (
        $type_struct    => '<i>$1</i>',
        $type_param     => '<tt><b>$1</b></tt>',
 );
-my $blankline_html = '</p><p>';
 
 my %highlights_texinfo = (
        $type_constant  => '@code{$1}',
@@ -186,7 +185,6 @@ my %highlights_texinfo = (
        $type_struct    => '@code{$1}',
        $type_param     => '@var{$1}',
 );
-my $blankline_texinfo = '';
 
 my %highlights_tex = (
        $type_constant  => '{\\it $1}',
@@ -194,9 +192,6 @@ my %highlights_tex = (
        $type_struct    => '{\\it $1}',
        $type_param     => '{\\bf $1}',
 );
-# Ideally this value should be place on the line preceding
-# the detected empty line.  Then '\\' would be ideal.
-my $blankline_tex = '\newline';
 
 # sgml, docbook format
 my %highlights_sgml = (
@@ -207,7 +202,6 @@ my %highlights_sgml = (
        $type_env       => '<envar>$1</envar>',
        $type_param     => '<parameter>$1</parameter>',
 );
-my $blankline_sgml = "</para><para>";
 
 # these are pretty rough
 my %highlights_man = (
@@ -216,7 +210,6 @@ my %highlights_man = (
        $type_struct    => '\\fB$1\\fP',
        $type_param     => '\\fI$1\\fP',
 );
-my $blankline_man = '';
 
 # text-mode
 my %highlights_text = (
@@ -225,8 +218,26 @@ my %highlights_text = (
        $type_struct    => '$1',
        $type_param     => '$1',
 );
-my $blankline_text = '';
 
+my %highlights_master = (
+       docbook => \%highlights_sgml,
+       html    => \%highlights_html,
+       man     => \%highlights_man,
+       sgml    => \%highlights_sgml,
+       tex     => \%highlights_tex,
+       texinfo => \%highlights_texinfo,
+       text    => \%highlights_text,
+);
+
+my %blankline = (
+       docbook => '</para><para>',
+       html    => '</p><p>',
+       man     => '',
+       sgml    => '</para><para>',
+       tex     => '\newline',
+       texinfo => '',
+       text    => '',
+);
 
 sub usage {
     print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex | 
-texinfo  -listfunc ]\n";
@@ -238,10 +249,11 @@ sub usage {
     exit 1;
 }
 
-my %highlights = %highlights_man;
-my $blankline = $blankline_man;
-
 $output_mode = "man";
+
+my %highlights = %{$highlights_master{'man'}};
+my $blankline = $blankline{'man'};
+
 $modulename = "API Documentation";
 $sourceversion = strftime "%Y-%m-%d", localtime;
 
@@ -257,8 +269,9 @@ sub set_output_mode {
 
     # Pass the selected mode to state parameters.
     $output_mode = $mode;
-    eval "\%highlights = \%highlights_$mode";
-    eval "\$blankline = \$blankline_$mode";
+    %highlights = %{$highlights_master{$output_mode}}
+       if defined $highlights_master{$output_mode};
+    $blankline = $blankline{$mode};
 }
 
 my %opts = ( # Output modes
@@ -329,7 +342,7 @@ sub dump_section {
 
 sub repstr {
     my ($pattern, $repl, $match1, $match2, $match3, $match4) = @_;
-    my ($output, $return);
+    my ($output);
 
     $output = $repl;
     $output =~ s,\$1,$match1,g;
@@ -337,20 +350,12 @@ sub repstr {
     $output =~ s,\$3,$match3,g;
     $output =~ s,\$4,$match4,g;
 
-    # Try two different quoting forms to circumvent collisions.
-    # The standard delimiter '/' corrupts end marks in HTML and XML.
-    if ($output =~ m/]/) {
-       eval "\$return = q#$output#";           # Is '|' any safer?
-    } else {
-       eval "\$return = q[$output]";           # Prefer brackets.
-    }
-
     if ($verbose > 1) {
        print STDERR "Pattern $pattern matched with \$1='$match1' \$2='$match2' 
\$3='$match3' \$4='$match4'\n",
-               "\tReplacement $repl produces $output, interpolated as 
$return\n";
+               "\tReplacement $repl produces $output\n";
     }
 
-    return $return;
+    return $output;
 }
 
 sub just_highlight {
@@ -409,6 +414,9 @@ sub output_texinfo {
     $count = 0;
 
     foreach my $parameter (@{$args{'parameterlist'}}) {
+       # Encapsulate parameter as non-breakable phrase.
+       print '@w{';
+
        # Variadic arguments carry no type.
        print $args{'parametertypes'}{$parameter}, " "
            if $args{'parametertypes'}{$parameter};
@@ -417,6 +425,8 @@ sub output_texinfo {
        print $args{'arraylength'}{$parameter}
            if $args{'arraylength'}{$parameter};
 
+       print '}';      # Close the protected phrase.
+
        if ($count != $#{$args{'parameterlist'}}) {
            $count++;
            print ", ";
@@ -424,12 +434,17 @@ sub output_texinfo {
     }
     print ")\n";
 
+    # Insert line breaks only between arguments, not after, not before.
+    my $interbreak = 0;
+
     foreach my $parameter (@{$args{'parameterlist'}}) {
+       print '@*'      if $interbreak;
+       $interbreak++;
+
        if ($args{'parameters'}{$parameter}) {
            print '@var{', $parameter, '}: ';
 
            output_highlight($args{'parameters'}{$parameter});
-           print "\n";
        }
     }
 
@@ -881,23 +896,27 @@ sub output_text {
        output_highlight($args{'parameters'}{$parameter});
     }
 
+    print "\n" if scalar @{$args{'parameterlist'}};
+
     foreach my $section (@{$args{'sectionlist'}}) {
        print " $section:\n";
-       print "    -> ";
-       output_highlight($args{'sections'}{$section});
+
+       # Minimal indentation inside section name.
+       my $visual = just_highlight($args{'sections'}{$section});
+       $visual =~ s|^(.+)|  $1|mg;
+
+       #print '    ->';
+       print $visual, "\n";
     }
-    print "\n";
 }
 
 ##
 # generic output function - calls the right one based
 # on current output mode.
 sub output_function {
-#    output_html(@_);
-    eval "output_".$output_mode."(address@hidden);";
+    eval 'output_' . $output_mode . '(@_);';
 }
 
-
 ##
 # takes a function prototype and spits out all the details
 # stored in global arrays/hashes.
diff --git a/lib/init.c b/lib/init.c
index c83e258..8ec413a 100644
--- a/lib/init.c
+++ b/lib/init.c
@@ -340,7 +340,7 @@ shishi_init (Shishi ** handle)
 
 /**
  * shishi_init_with_paths:
- * @handle: Pointer to a Shishi handle created by this call .
+ * @handle: Pointer to a Shishi handle created by this call.
  * @tktsfile: Filename of ticket file, or %NULL.
  * @systemcfgfile: Filename of system configuration, or %NULL.
  * @usercfgfile: Filename of user configuration, or %NULL.
@@ -376,7 +376,7 @@ shishi_init_with_paths (Shishi ** handle,
 
 /**
  * shishi_init_server:
- * @handle: Pointer to a Shishi handle created by this call .
+ * @handle: Pointer to a Shishi handle created by this call.
  *
  * Creates a Shishi library handle, using shishi_server(), and reads
  * the system configuration file.  The path to the system configuration
@@ -410,7 +410,7 @@ shishi_init_server (Shishi ** handle)
 
 /**
  * shishi_init_server_with_paths:
- * @handle: Pointer to a Shishi handle created by this call .
+ * @handle: Pointer to a Shishi handle created by this call.
  * @systemcfgfile: Filename of system configuration, or %NULL.
  *
  * Creates a Shishi library handle, using shishi_server(), and reads


hooks/post-receive
-- 
GNU shishi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]