conditional? effects on design?

Simon,

Did you get a chance to look into the conditional I added to the schema?

Also, you mentioned it simplifies things. Am wondering with where we’re
at what a clean design for a CSL implementation (and maybe API)?

The API issue is important, BTW, in part because of intersections with
word-processors. Like OOo has a bib API; figuring out an API for this
processing is in part about figuring out how to fit it into OOo.

Was just looking again at how I had been doing the Ruby port, and
wondering is something simpler would work; like starting with …

reads a CSL file and creates an object

class CSL
attr_reader :meta, :general, :citation, :bibliography
def initialize(meta=[], general=[], citation=[], bibliography=[])
@meta = meta
@general = general
@citation = citation
@bibliography = bibliography
end
end

class Template
attr_reader :name, :fields
def initialize(name=nil, fields=[])
@name = name
@fields = fields
end
end

class Field
attr_reader :name, :style, :prefix, :suffix, :substitute
def initialize(name=nil, style=nil, prefix=nil, suffix=nil,
substitute=nil)
@name = name
@style = style
@prefix = prefix
@suffix = suffix
@substitute = substitute
end
end

Simon,

Did you get a chance to look into the conditional I added to the schema?

I haven’t gotten around to implement it yet (I’m quite busy at the moment),
but it looks fine.

Also, you mentioned it simplifies things. Am wondering with where we’re
at what a clean design for a CSL implementation (and maybe API)?

The API issue is important, BTW, in part because of intersections with
word-processors. Like OOo has a bib API; figuring out an API for this
processing is in part about figuring out how to fit it into OOo.

Was just looking again at how I had been doing the Ruby port, and
wondering is something simpler would work; like starting with …

reads a CSL file and creates an object

class CSL
attr_reader :meta, :general, :citation, :bibliography
def initialize(meta=[], general=[], citation=[], bibliography=[])
@meta = meta
@general = general
@citation = citation
@bibliography = bibliography
end
end

class Template
attr_reader :name, :fields
def initialize(name=nil, fields=[])
@name = name
@fields = fields
end
end

class Field
attr_reader :name, :style, :prefix, :suffix, :substitute
def initialize(name=nil, style=nil, prefix=nil, suffix=nil,
substitute=nil)
@name = name
@style = style
@prefix = prefix
@suffix = suffix
@substitute = substitute
end
end

My API is more of a mess than I’d like it to be, but I’d be happy if we
could develop a good object-oriented system to replace it that wouldn’t
result in too much of a speed hit. I would suggest that a standard API
separate the generation of the bibliography from the generation of
individual citations. To do this, the API would probably need to separate
the parsing of the CSL file from the creation of the citations and
bibliography as well.

In addition, the API should provide an easy way to create a system that
generates citations and updates the bibliography incrementally (if a user
creates a new citation from a GUI, it won’t be necessary to completely
regenerate all citations within the document). This functionality should not
be mandatory, and doesn’t even have to be formalized, but the model should
allow for such extension.

I’ll try to provide some more thoughts on this later.

Simon

Did you get a chance to look into the conditional I added to the
schema?

I haven’t gotten around to implement it yet (I’m quite busy at the
moment),
but it looks fine.

OK, when you get a break, we can just hook it up, integrate whatever
into the styles, and be done hopefully.

I would suggest that a standard API separate the generation of the
bibliography from the generation of individual citations. To do this,
the API would probably need to separate
the parsing of the CSL file from the creation of the citations and
bibliography as well.

Yeah, that’s what I was thinking.

Also, WRT to OOo, we had a discussion yesterday with some managers and
engineers at Sun, and we chatted just a short bit about the processing.
Basically, what they are thinking is that the formatter sends some
pre-rendered chunks (maybe even the final string) to Writer, which just
inserts it into the citation and bibliography fields.

But we need to figure out exactly how that works, so we can get the
proper citation rendering (in author-date styles, for example, ibid,
etc.).

In addition, the API should provide an easy way to create a system that
generates citations and updates the bibliography incrementally (if a
user
creates a new citation from a GUI, it won’t be necessary to completely
regenerate all citations within the document). This functionality
should not
be mandatory, and doesn’t even have to be formalized, but the model
should
allow for such extension.

I’ll try to provide some more thoughts on this later.

No rush; just want us to keep in view.

WRT to OOo, our process is basically a) finish the ODF metadata work,
and b) evaluate the existing bib API to see where we need it enhanced.
But b is not a huge rush given a.

Bruce