public inbox for docbook-tools-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Edward C. Bailey" <ed@redhat.com>
To: <docbook-tools-discuss@sourceware.cygnus.com>
Subject: Re: Docbook in Red Hat 7.1
Date: Tue, 24 Apr 2001 13:17:00 -0000	[thread overview]
Message-ID: <lflmoqjbnt.fsf@pigdog.meridian.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0104220958260.4069-100000@pto.sslug>

[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]

>>>>> "Peter" == Peter Toft <pto@sslug.dk> writes:

Peter> On 21 Apr 2001, Edward C. Bailey wrote:
...
>>  I've done a bit with it (I hacked up a new frontend and backend for jw
>> that uses collateindex.pl and did some cursory testing under the 7.1
>> beta).  I've done tried it on the gold bits yet; after I give it a try,
>> I'll post it here if you like...

Peter> It sure would be nice to know how to get RH 7.1 docbook tools to
Peter> work - so please do :) Using collateindex.pl seems to be
Peter> non-trivial.

It's not that bad, really.  Basically you run your SGML through jade once
to get an HTML index file; then you run collateindex.pl against this,
creating a DocBook index.  Finally, you run your SGML (including the
newly-generated index) through jade one last time.

Some notes on these scripts:

    o Minimal testing, blah, blah, blah, it's somewhat stupid, blah, blah,
      blah, works for me, blah, blah, blah... :-)

    o Usage is:

<path-to-script>/flo-db2indexed-html <SGML-file>.sgml

    o Puts final output in a subdirectory called <SGML-file>

    o Assumes the following entity definition and reference is in the SGML
      file:

<!ENTITY GENERATED-INDEX SYSTEM "generated-index.sgml">

      And where ever you want the index to appear:

&GENERATED-INDEX;

      (The script will recreate generated-index.sgml each time it runs; the
      first time jade runs there will be no file by this name, so you'll
      see an error.)

    o Assumes that any graphics referenced in the SGML reside in a
      subdirectory called "figs".  This subdirectory is copied into the
      <SGML-file> subdirectory, so the entire <SGML-file> directory tree
      can be tarred up, and dropped on a website, ready to go...

    o flo-db2indexed-html refers to a .dsl file that we've hacked, but this
      should be removable so the default DSSSL is used instead.

I think that's about it...

                                Enjoy,

                                    Ed


[-- Attachment #2: flo-db2indexed-html --]
[-- Type: text/x-shellscript, Size: 1115 bytes --]

#! /bin/sh

# Make sure we have an absolute path to the backend and stylesheet, as
# jw doesn't like relative paths...

STUFFPATH=`dirname $0`
if [ -n "${STUFFPATH##/*}" ]
then
    STUFFPATH=$PWD/$STUFFPATH
fi

# Figure out what our output directory should be called.  Note that we
# also check to see if the user explicitly specified an output directory,
# in which case we'll use their choice...

O_OPTION=0
for i in "$@"
do
    if [ $O_OPTION = "1" ]
        then
            OUTPUTDIR=$i
            O_OPTION=0
        fi
    if [ $i = "-o" ]
        then
            O_OPTION=1
        fi
done

# See if the user specified an output directory...

if [ -z $OUTPUTDIR ]
    then
# Nope -- default to the name of the SGML file...
        OUTPUTDIR="`echo $i | sed 's,\.sgml$,,;s,\.sgm$,,'`"
    fi

# Nuke the output directory (if it exists); jw will create it for us...

if [ -d $OUTPUTDIR ]
    then
	echo -n "Cleaning out $OUTPUTDIR..."
	rm -rf $OUTPUTDIR
	echo "Done!"
    fi

jw -f docbook \
    -b $STUFFPATH/flo-indexed-html \
    -d $STUFFPATH/stylesheets/flo-redhat-html.dsl \
    -o $OUTPUTDIR \
    $*

[-- Attachment #3: flo-indexed-html --]
[-- Type: text/plain, Size: 2190 bytes --]

# Based on original from Eric Bischoff <eric@caldera.de>

# Create an HTML document with index and figures in place.
# This is done by:

# 1. Converting from SGML to HTML
# 2. Generating an SGML index based on the HTML
# 3. Converting from SGML to HTML (taking into account the index this time)
# 4. Copying figures from original source tree into the output directory

# The end result is a directory tree ready for publishing/packaging/whatever...

# Magic variables.  I feel uncomfortable about the version number in these
# paths, but feel even more uncomfortable wildcarding it... :-(

HTML_STYLESHEET=/usr/share/sgml/docbook/dsssl-stylesheets-1.59/test/docbook.css
ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets-1.59/images/*.gif

FINAL_INDEX=generated-index.sgml
INDEXFILE=INDEX$$

# Convert to HTML, generating the HTML.index file that we'll use to
# create an SGML index...

echo Running $SGML_JADE...

$SGML_JADE -t sgml -V html-index $SGML_ARGUMENTS

# Generate the index, fixing up the problem of bogus empty closing tags (</>)...

echo Indexing...
perl /usr/bin/collateindex.pl -g -o ../$FINAL_INDEX HTML.index

# Not sure if these are still needed; when we first tried collateindex;
# it threw "</>" in the generated index in certain cases...

cat ../$FINAL_INDEX | sed 's,^[        ]*</>[  ]*$,,' > ../$INDEXFILE
mv -f ../$INDEXFILE ../$FINAL_INDEX

# Nuke the HTML.index file; we don't need it anymore...

rm -f HTML.index

echo Rerunning $SGML_JADE...

$SGML_JADE -t sgml $SGML_ARGUMENTS

echo -n "Copying cascading stylesheet and admon graphics..."
cp ${HTML_STYLESHEET} ./
mkdir ./stylesheet-images
cp ${ADMON_GRAPHICS} ./stylesheet-images/
echo "Done!"

if [ -d ../figs/ ]
    then
        echo -n "Moving figures..."
        (cd ../ ; tar cf - figs/) | (tar xf -)
        echo "Done!"
        echo -n "Cleaning CVS..."
        find ./figs/ -type d -name "CVS"|xargs rm -rf
        echo -n "EPS..."
        find ./figs/ -type f -name "*eps"|xargs rm -f
        echo -n " .xvpics..."
        find ./figs/ -type d -name ".xvpics"|xargs rm -rf
        echo -n "directories..."
        find ./figs/ -type d -empty|xargs rm -rf
        echo "Done!"
    fi
# 
exit 0

  reply	other threads:[~2001-04-24 13:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-21 14:35 Peter Toft
2001-04-21 14:39 ` Mark Galassi
2001-04-21 14:45   ` Peter Toft
2001-04-21 15:35   ` Tim Waugh
2001-04-21 17:48     ` Edward C. Bailey
2001-04-22  1:05       ` Peter Toft
2001-04-24 13:17         ` Edward C. Bailey [this message]
2001-04-26 10:26           ` Wookey
2001-04-26 12:00             ` Peter Toft
2001-04-27 12:01             ` Peter Toft
2001-04-30  2:22               ` Wookey
2001-04-26 11:47           ` Peter Toft
2001-04-26 11:54             ` Edward C. Bailey
2001-04-26 15:05               ` Hugo van der Kooij
2001-04-26 17:34                 ` Edward C. Bailey
2001-04-29  8:15                   ` Hugo van der Kooij
2001-04-26  3:04       ` Eric Bischoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lflmoqjbnt.fsf@pigdog.meridian.redhat.com \
    --to=ed@redhat.com \
    --cc=docbook-tools-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).