Skip to main content
University of Glasgow
A-Z : ACADEMIC DEPARTMENTS | SERVICES | STAFF |
Faculty of Information and Mathematical Systems > School of Computing Science
Download MIF scripts Browse source code Read documentation

MIF scripts

I made these scripts for a friend of mine, who's a technical author. Here's her documentation:

 

Prerequisites:

Perl installed (I have downloaded it from www.activestate.com/Products/ActivePerl). For other platforms, see CPAN.

Platform:

Any platform supported by Perl.

Limitations:

Two Perl scripts:

1. check_codes.pl: Checks whether the tags are nested properly and whether the start and end tags match up in pairs.

2. split_mif.pl: Generates a separate MIF file for each of the tags.

Inserting tags in your FrameMaker document:

To check the syntax of your document:

  1. Save the FrameMaker document as MIF in the same folder as the Perl script.
  2. Open the check_codes.pl script in a text editor.
  3. Enter the name of the MIF file as value for the variable 'my $inputfile'. Example: To check the file 'User_Guide_Part3.mif', set the value of the variable 'my $inputfile' to 'User_Guide_Part3.mif': (line 2 of the script, ignoring comments)
    my $inputfile='User_Guide_Part3.mif';
  4. Save and close the script.
  5. Double-click the Perl script. The file 'check_MIF_codes_log.txt' will be generated.
  6. Open 'check_MIF_codes_log.txt' and check whether no syntax problems have been reported. If there are syntax problems, fix them in the FramMaker file and repeat steps 1 to 6. If there are no syntax problems, you can generate the product-specific documents.

To generate the product-specific documents:

  1. Open the split_mif.pl script in a text editor.
  2. Enter the name of the MIF file as value for the variable 'my $inputfile'.
    Example:
    To generate product-specific documents for the file 'User_Guide_Part3.mif', set the value of the variable 'my $inputfile' to 'User_Guide_Part3.mif':
  3. (line 4 of the script, ignoring comments)
    my $inputfile='User_Guide_Part3.mif';
  4. Enter the tags you have used as value for the variable 'my @codes'.
    Example:
    To generate documents for each of the tags TA, TB and TC, set the value of the variable 'my @codes' to 'TA TB TC': (line 2 of the script, ignoring comments)
    my @codes= qw(TA TB TC);
  5. Save and close the script.
  6. Double-click the Perl script.
    The script will generate a MIF file for each of the tags.

    Example:
    User_Guide_Part3_TA.fm
    User_Guide_Part3_TB.fm
    User_Guide_Part3_TC.fm

Note: This script has been written for a specific situation. If you would like the script to be extended, please contact me. If several people would find a feature useful, I'm willing to do further work on it.

Last modified: Mon 10 Jan 2005 12:44 GMT