Документ взят из кэша поисковой машины. Адрес оригинального документа : http://hea.iki.rssi.ru/conf/hea2007/bp-0.2.97/gen/README
Дата изменения: Wed Mar 13 10:22:32 1996
Дата индексирования: Tue Oct 2 00:35:36 2012
Кодировка:

Поисковые слова: ngc 5128

This is the new output format generator.

First, we have a new way of handling output formats. It works as such:

The user will ask for format "output:html" with option "style=booklist".
This does the following:

a) tocanon is unsupported. This is an output format.

b) The "output" module's broken out format is the canon format. So the
fromcanon and explode routines do nothing but return what they are
given.

c) The style module will return a single string. Not only are the
special characters in canon format (i.e. we just leave them alone
since that is what we were given), but the formatting characters are
also canon meta characters.

d) The implode routine does the work of calling the actual style module.
It also handles special things such as stripping extra spaces, and
inserting HTML extras.

f) The normal conversion routines will take care of converting the
canon code to whatever charset was asked for, such as HTML.

Secondly, we have a scheme for generating the style files from generic
descriptions. These contain little or no code, but mainly describe the
output desired. The parts are:

1. bp-s-booklist.gen
This file is written by the user. This contains instructions and
perhaps some code describing the output format. It takes as input
a record in canon format. All charset information is in HTML (because
people are more familiar with HTML than canon, and it's easier to read).

2. genmod.pl
This program turns (1) the gen file into (3) a perl module. It
is in charge of converting the HTML codes from the gen file into
the proper canon codes.

3. bp-s-booklist.pl
This is the code generated by (2) genmod. It will convert a canon
record into an output string. The charset used is canon.

4. bp-output.pl
A new format module. This module is in charge of calling the style
modules.


To summarize, here is what we have:

+----------------------------------------------+
| genmod |
| bp-s-booklist.gen --------> bp-s-booklist.pl |
+----------------------------------------------+
/\ ||
2 || || 3
canon || || canon
record || || string
|| \/
+-------+ 1 record +--------------+
infile>>|.......|-------------->|.. . |
| bp.pl | | bp-output.pl |
ofile<<<|.. ..|<--------------|......... |
+-------+ 4 string +--------------+
/\ ||
6 || || 5
HTML || || canon
string || || string
|| \/
+---------------+
| bp-cs-html.pl |
+---------------+


Ideally, we could write programs to convert to/from other reference programs
output formats. For instance, products like EndNote contain a number of
files that describe how to output in 200+ different journal formats.

This method can also be used to create very simple output converters. A
simple refer converter might have something like:

TYPE: article
TEXT
[%A 'Authors']
[%T 'Title']
[%J 'Journal']
[%V 'Volume']
[%N 'Number']
[%D 'date']
ETEXT

which makes it almost trivial to generate simple output in many formats.