csl-lib /

Filename Size Date modified Message
55 B
1.9 KB
1.7 KB
CSL style library builder

This is a pair of scripts for reducing a batch of CSL styles to a set of
unique library snippets and related metadata, consisting of:

 * Macros
 * Sort blocks
 * Locale elements (options, term sets, date definitions)
 * Style-specific layout blocks for citation and bibliography,
   and any related options
 * Style metadata
 * Global style options
The script expects to find the full repository of CSL styles
as a sibling to this directory, at ../all-styles/csl.
All the script does at the moment is to extract the macros,
sort blocks and layouts from styles, and stash them in config 
files (under ./macros) or csl files (under the other directories).
The macro calls made within nodes are adjusted to call the
canonical name of the target macro.
It might be interesting to think about a purely template-driven
tool for generating the rough draft of styles, using existing
macros, and allowing WYSIWYG adjustment of node options, with
instant ttw preview of the result.  Stripping attributes does
result in a smaller number of unique nodes.  The shrinkage is
most evident for macros, but layouts also reduce a bit.  Some
editing of macros and layouts in the library for consistency
of coding style would certainly bring the numbers down further.
Currently, it looks like this

====================   ================   ==========
Node type              unstripped         stripped
====================   ================   ==========
layouts-citation       108                63
layouts-bibliography   160                151
macros                 805                412
sorts                  90                 29
====================   ================   ==========

Note that the ./scripts/build.py script does not work at all yet.
This is very early-days work, I'm just throwing it out there to
see if it stimulates any discussion.

Frank Bennett