mhonarc-users

Re: MHonArc customization question: archive name

1997-12-11 15:27:18
If I am creating an archive
      /path/to/this_archive/maillist.html     (and associated files)
I would like to be able to extract the name "this_archive" to put in the
<TITLE> of the date and thread indexes.
...
Do you have some variable to make it easy to do this?  Is it possible to
do this?

Nope.  There are 2 approaches you can try:

    1.  Modify MHonArc source.

    2.  Write a front end to do it for you.  I.e.  You can right a
        simple front end that extracts archive path argument to get
        the title, and then invoke mhonarc with the proper options.

        An untested example is attached to this message that may
        do what you want.

#!/usr/local/bin/perl
#
#       by Earl Hood, ehood(_at_)medusa(_dot_)acs(_dot_)uci(_dot_)edu (untested)

# Front end program to set title resources based upon destination
# archive name.  All arguments passed to program are passed directly
# to mhonarc.  If we call the program "mhaautotitle", an example
# invocation may be:
#
#           mhaautotitle -outdir /path/to/this-archive inbox

## Protect our variables by using our own namespace
package MhaFrontEnd;

## Pathname to mhonarc (CHANGE to fit your site)
$mhonarc = "/usr/local/bin/mhonarc";

## Loop thru @ARGV to find -outdir option
for ($i=0; $i <= $#ARGV; ++$i) {
    if ($ARGV[$i] eq '-outdir') {
        $archive = $ARGV[$i+1]; # Archive next argument
        last;
    }
}

## Determine title
$archive =~ s|.*/||;                # Name is assumed to be last component
                                    # of directory path.
$ttitle = "Thread Index for $archive";
$title = "Date Index for $archive";     # May need to change depending on
                                        # sort option

## Add title options to ARGV
unshift(@ARGV, "-title", $title, "-ttitle", $ttitle);

## Require MHonArc
require $mhonarc;

#END
        --ewh

P.S.  Please use the mhonarc mailing list for any questions.
<Prev in Thread] Current Thread [Next in Thread>
  • Re: MHonArc customization question: archive name, Earl Hood <=