From: Bruce D'A. <bd...@gm...> - 2006-09-19 19:24:46
|
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 |