From 7a6db5704bd7ef4ac775224b0879b05220f0d0a6 Mon Sep 17 00:00:00 2001 From: pbldp <> Date: Fri, 25 Jan 2002 23:04:44 +0000 Subject: [PATCH] Release 0.19 Add a new tool for fixing left/right quotes Modified Files: Linux+IPv6-HOWTO.lyx runsgmlfix.sh sgmllyxtabletagfix.pl Added Files: sgmllyxquotefix.pl --- .../Peter-Bieringer/Linux+IPv6-HOWTO.lyx | 49 +++++++++++++++++-- LDP/users/Peter-Bieringer/runsgmlfix.sh | 3 +- LDP/users/Peter-Bieringer/sgmllyxquotefix.pl | 47 ++++++++++++++++++ .../Peter-Bieringer/sgmllyxtabletagfix.pl | 14 ++++-- 4 files changed, 105 insertions(+), 8 deletions(-) create mode 100755 LDP/users/Peter-Bieringer/sgmllyxquotefix.pl diff --git a/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.lyx b/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.lyx index e5445d7f..34368dc8 100644 --- a/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.lyx +++ b/LDP/users/Peter-Bieringer/Linux+IPv6-HOWTO.lyx @@ -49,8 +49,8 @@ on> \layout SGML - Release 0.18.3 2002-01-25 PB See + Release 0.19 2002-01-25 PB See \begin_inset LatexCommand \ref[revision history]{revision-history} \end_inset @@ -380,6 +380,48 @@ SGML generation \layout Standard SGML is generated using export function in LyX. +\layout Standard + +Also some fixes are have to be made to create proper SGML code (see also + here for the Perl programs +\begin_inset LatexCommand \url[LDP-CVS / users / Peter-Bieringer]{http://cvsview.linuxdoc.org/index.cgi/users/Peter-Bieringer/?cvsroot=Linuxdoc} + +\end_inset + +): +\layout Itemize + +Export of LyX table does not create proper +\begin_inset Quotes sld +\end_inset + +colspan +\begin_inset Quotes srd +\end_inset + + tags - tool for fixing: +\begin_inset Quotes sld +\end_inset + +sgmllyxtabletagfix.pl +\begin_inset Quotes srd +\end_inset + + +\layout Itemize + +LyX sometimes uses special left/right entinities for qoutes instead the + normal one, which will still exist in generated HTML. + Some browers don't parse this very well (known: Opera 6 TP 2 or Konqueror) + - tool for fixing: +\begin_inset Quotes sld +\end_inset + +sgmllyxquotefix.pl +\begin_inset Quotes srd +\end_inset + + \layout Subsection On-line references to the HTML version of this HOWTO (linking/anchors) @@ -8147,7 +8189,8 @@ Revision history Releases 0.x \layout Description -0.18.3 2002-01-25/PB: Add two German books +0.19 2002-01-25/PB: Add two German books, fix quote entinities in exported + SGML code \layout Description 0.18.2 2002-01-23/PB: Add a FAQ on the program chapter diff --git a/LDP/users/Peter-Bieringer/runsgmlfix.sh b/LDP/users/Peter-Bieringer/runsgmlfix.sh index 3bafb7a1..b0b12505 100755 --- a/LDP/users/Peter-Bieringer/runsgmlfix.sh +++ b/LDP/users/Peter-Bieringer/runsgmlfix.sh @@ -14,6 +14,7 @@ FILE_LYX="Linux+IPv6-HOWTO.lyx" FILE_TMP="tmp.sgml" PROG_FIX_TABLETAG="sgmllyxtabletagfix.pl" +PROG_FIX_QUOTE="sgmllyxquotefix.pl" if [ "$FILE_LYX" -nt "$FILE_SGML" ]; then echo "ERR : LyX file '$FILE_LYX' is newer than SGML file '$FILE_SGML' - forgot to export?" @@ -31,7 +32,7 @@ if [ -f "$FILE_TMP" ]; then fi echo "INF : Fix SGML now" -cat "$FILE_SGML" | ./$PROG_FIX_TABLETAG >$FILE_TMP +cat "$FILE_SGML" | ./$PROG_FIX_TABLETAG | ./$PROG_FIX_QUOTE >$FILE_TMP echo "INF : Remove old SGML file '$FILE_SGML'" rm "$FILE_SGML" diff --git a/LDP/users/Peter-Bieringer/sgmllyxquotefix.pl b/LDP/users/Peter-Bieringer/sgmllyxquotefix.pl new file mode 100755 index 00000000..241a7f83 --- /dev/null +++ b/LDP/users/Peter-Bieringer/sgmllyxquotefix.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl +# +# $Id$ +# +# SGML LyX qoute entinity fix tool +# +# (P) & (C) 2002 by Peter Bieringer +# +# Published under the GNU GPL licence +# +# Takes SGML output exported by LyX and fix a bug regarding quote entinities +# Don't know the reason what causes this, but it is wrong. +# +# Replaces: +# “ -> " +# ” -> " +# +# Changes: +# 20020125: Initial release +# +# Known bugs: +# Entinity must be in one line + +print STDERR "INF : Replacing special quotes entinities\n"; + +while () { + my $line = $_; + chomp $line; + + #print "$line"; + #print "\n"; + + if ($line =~ /“/) { + print STDERR "<"; + # Substitute + $line =~ s/“/"/g; + }; + if ($line =~ /”/) { + print STDERR ">"; + # Substitute + $line =~ s/”/"/g; + }; + + + print $line . "\n"; +}; +print STDERR "finished\n"; diff --git a/LDP/users/Peter-Bieringer/sgmllyxtabletagfix.pl b/LDP/users/Peter-Bieringer/sgmllyxtabletagfix.pl index 5ad088d5..70628235 100755 --- a/LDP/users/Peter-Bieringer/sgmllyxtabletagfix.pl +++ b/LDP/users/Peter-Bieringer/sgmllyxtabletagfix.pl @@ -16,9 +16,12 @@ # + # # Changes: -# 20020119: Initial release +# 20020119/PB: Initial release +# 20020125/PB: Minor review # +print STDERR "INF : Fix 'colspec' lines\n"; + while () { my $line = $_; chomp $line; @@ -27,11 +30,14 @@ while () { #print "\n"; if ($line =~ /^$/) { + print STDERR "C"; - # Substitute '/>' with '>' - $line =~ s/\/>$/>/g; + # Substitute '/>' with '>' + $line =~ s/\/>$/>/g; + }; }; print $line . "\n"; }; +print STDERR "\n";