[xml/sgml-commit] [SCM] linuxdoc-tools package for Debian. branch, experimental, updated. debian/0.9.50-10-g3b6c937

Agustin Martin Domingo agmartin at debian.org
Sun Jun 15 23:35:41 UTC 2008


The following commit has been merged in the experimental branch:
commit 5f96f08ee166eed0765ab676be3fa16c475e0619
Author: Agustin Martin Domingo <agmartin at debian.org>
Date:   Mon Jun 16 01:16:02 2008 +0200

    Use article, report or book as textclass. Use LyX-Code. Support chapt.
    
    * No longer use linuxdoc as textclass, modern lyx does not support it.
      Use plain article, report or book instead. Since none of them
      support verbatim layout, use LyX-Code instead. Also add chapt to lyx
      mapping file.
    * Move $lyxheader to $lyxout
    * Better scoping for $OUTPUT

diff --git a/lib/dist/fmt_lyx.pl b/lib/dist/fmt_lyx.pl
index bce204e..7ca7c76 100644
--- a/lib/dist/fmt_lyx.pl
+++ b/lib/dist/fmt_lyx.pl
@@ -1,8 +1,6 @@
 #
 #  fmt_lyx.pl
 #
-#  $Id: fmt_lyx.pl,v 1.1.1.1 2001/05/24 15:57:40 sano Exp $
-#
 #  Lyx-specific driver stuff
 #
 #  Copyright © 1996, Cees de Groot
@@ -85,7 +83,6 @@ $lyx->{postASP} = sub {
 # -----------------------------------------------------------------------
 #  Take the sgmlsasp output, and make something useful from it.
 # -----------------------------------------------------------------------
-  my $OUTFILE;
   my $INFILE         = shift;
   my $lyxfile        = "$global->{filename}.lyx";
   my $nbsp           = chr(160);
@@ -99,11 +96,10 @@ $lyx->{postASP} = sub {
   my $intag;
   my $intt;
   my $tscreen;
-  my $lyxout         = '';
-  my $lyxheader      = "#This file was created by LinuxDoc-SGML
+  my $lyxout         = "#This file was created by LinuxDoc-SGML
 #(conversion : Frank Pavageau and Jose' Matos)
 \\lyxformat 2.15
-\\textclass linuxdoc
+\\textclass \@textclass\@
 \\language default
 \\inputencoding default
 \\fontscheme default
@@ -129,7 +125,8 @@ $lyx->{postASP} = sub {
     chomp;
 
     if ( /^\@(article|book|report)\@/ ) {
-      $lyxout = $lyxheader;
+      my $class = $1;
+      $lyxout =~ s/\@textclass\@/$class/;
     } # Itemize; Enumerate and Description. $indent_level counts the level
     elsif( /^\@itemize\@/ ) {           # --- Itemized list begins
       $indent_level++;
@@ -197,7 +194,7 @@ $lyx->{postASP} = sub {
       if ( $intag ) {
 	s/\s+/\n\\protected_separator\n/g unless m/^\\(family|series|shape)/;
       } elsif ( $verbatim ) {
-	$_ = "\\layout Verbatim\n$_";
+	$_ = "\\layout LyX-Code\n$_";
       } elsif ( $inheading) {
 	s/\s+/ /g;
       }
@@ -225,7 +222,7 @@ $lyx->{postASP} = sub {
   $lyxout =~ s/\\end_deeper/\\end_deeper\n/gms;
 
   # Print result
-  open ($OUTFILE, "> $lyxfile")
+  open (my $OUTFILE, "> $lyxfile")
     or die "fmt_lyx::postASP: Could not open \"$lyxfile\" for writing. Aborting ...";
   print $OUTFILE $lyxout;
   close $OUTFILE;
diff --git a/lib/dist/linuxdoc-tools/lyx/mapping b/lib/dist/linuxdoc-tools/lyx/mapping
index 617e342..8bc598c 100644
--- a/lib/dist/linuxdoc-tools/lyx/mapping
+++ b/lib/dist/linuxdoc-tools/lyx/mapping
@@ -57,6 +57,9 @@
 			"\\end_inset\n"	+
 </toc>
 
+<chapt>		+	"\\layout Chapter"	+
+</chapt>
+
 <sect>		+	"\\layout Section"	+
 </sect>
 

-- 
linuxdoc-tools package for Debian.



More information about the debian-xml-sgml-commit mailing list