I have put up a quick gist to illustrate how you could quickly generate a style 
using CSL-Ruby. Now, honestly, I have used it mostly to test existing styles so 
I have not added a lot of convenience methods, but these could be added very 
quickly. Nevertheless, there are already a few features that show how this can 
be useful: for example, you could load the independent_parent of the style with 
a simple command. The parent would be loaded and parsed on the spot and you 
could make sure that certain metadata match, for example, or pull information 
from the related style. Furthermore, you can validate the style with one 
command before saving etc.

When you have a very clear template this may not help you so much, but if you 
want more flexibility I think there is a lot of potential there (as I said, I 
haven't used it much to generate styles, but all the groundwork has been laid, 
it is really just a matter of adding more syntactic sugar).

Another thing is that the template is essentially one-way, whereas you can 
parse the generated styles again with CSL-Ruby if you want to make adjustments 
later on, and so forth.

Anyway, I just wanted to throw this out there, because there's a lot of good 
stuff implemented in CSL-Ruby that I simply haven't had the time to document.

Here is the gist if you're curious:

https://gist.github.com/inukshuk/5265227



On Mar 28, 2013, at 1:35 PM, Charles Parnot wrote:

> CSL-Ruby looks very useful, but I don't know if it can be readily used as a 
> replacement for what the script currently does. The placeholder strings can 
> be anywhere in the template, and one would need to navigate all the XML 
> elements to look for those placeholders. Or else, we would have to define 
> what the different columns can be used for in the journal lists. The current 
> script don't care about the template format, and the output is only as valid 
> as the template itself.
> 
> Charles
> 
> On Mar 28, 2013, at 11:28 AM, Sylvester Keil <[email protected]> wrote:
> 
>> Hi Charles,
>> 
>> The script looks great! If you come up with more complex requirements or 
>> need more flexible templates you could also use CSL-Ruby – that's exactly 
>> the sort of thing it was written to do (generate/manipulate styles). If 
>> you're interested I could take a look over the weekend and adapt your script 
>> to use it? Let me know.
>> 
>> Sylvester
>> 
>> 
>> On Mar 28, 2013, at 10:28 AM, Charles Parnot wrote:
>> 
>>> This is great, Rintze, thanks so much for all the hard work! I agree with 
>>> all your comments too.
>>> 
>>> Regarding the script: it's a nice way to maintain dependent style in a more 
>>> controlled way. Even if updating the journal list (in tab-delimited text 
>>> files) and running the script can sometimes take longer than tweaking the 
>>> one affected style, it's still worth the extra effort, as it means better 
>>> maintained dependent in the future. I wonder if this logic could be pushed 
>>> further in the future, by having an even easier way to edit the dependent 
>>> list without having to touch any of the XML directly. Sometimes, the best 
>>> tool for the job is a spreadsheet (though Excel can be very dangerous to 
>>> use, as it tends to interpret ISSN as dates).
>>> 
>>> In any case, you can all take time to look into how the script works. You 
>>> can just edit the tab-delimited list of journals, and edit the template, 
>>> and then run the script. CSS files are created locally, and are then ready 
>>> to be copied into the CSL repo. I have just added better documentation on 
>>> how that works:
>>> 
>>> https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles
>>> 
>>> Charles
>>> 
>>> 
>>> On Mar 28, 2013, at 4:37 AM, Rintze Zelle <[email protected]> wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> Just an update of what I've been up to lately:
>>>> 
>>>> Over the past three months or so, I've checked all dependent styles to
>>>> see if I could identify their journals. I also checked if each journal
>>>> was still active, added missing ISSNs, marked up eISSNs as such, and
>>>> added default-locales and documentation links. This was prompted by
>>>> the rather poor state of all the "vancouver" dependents. Simon added
>>>> these a few years ago based on an official list
>>>> (http://www.icmje.org/journals.html), but it's become quite clear to
>>>> me that this list is poorly curated. E.g., we had a whole bunch of
>>>> styles for journals that were long discontinued (which went as far
>>>> back as the eighties), and I must have deleted over a 100 styles. Many
>>>> styles that had "vancouver" as the parent also needed to point to a
>>>> different Vancouver variant or a wholly different style.
>>>> It was rather labor intensive, but I think our dependent styles are
>>>> now in much better shape.
>>>> 
>>>> Going forward, I would like to become a bit more strict about the
>>>> dependent styles that go into the repository. I plan to write an
>>>> extension to the CSL schema so that we can use Travis CI to check for
>>>> additional requirements. I would like to require each dependent style
>>>> to have a default-locale (possible exceptions for multilingual
>>>> styles), a documentation link, and a self link. I also would like to
>>>> disallow having two (or more) instances of cs:issn, since generally
>>>> one should be a cs:eissn.
>>>> 
>>>> You might also have noticed that Charles added some Springer styles,
>>>> which bumped us to having over 4000 CSL styles (of which 800 are
>>>> independent). Charles has made a nice script that allows us to quickly
>>>> create dependent styles from just a template and a CSV file with (at a
>>>> minimum) journal titles and ISSNs (see
>>>> https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles
>>>> ). In addition to the Springer styles, Charles and I have prepared
>>>> metadata for over a dozen of other publishers. I hope we can get
>>>> similar data for other publishers (maybe Elsevier?).
>>>> 
>>>> Finally, today I added "self" links to all dependent styles. I did
>>>> this since Zotero 4.0 will offer automatic updating of CSL styles, and
>>>> will follow the "self" link of styles to find style updates.
>>>> 
>>>> Best,
>>>> 
>>>> Rintze
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>>>> Rise to greatness in Intel's independent game demo contest.
>>>> Compete for recognition, cash, and the chance to get your game 
>>>> on Steam. $5K grand prize plus 10 genre and skill prizes. 
>>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>>> _______________________________________________
>>>> xbiblio-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
>>> 
>>> --
>>> Charles Parnot
>>> [email protected]
>>> twitter: @cparnot
>>> http://mekentosj.com
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>>> Rise to greatness in Intel's independent game demo contest.
>>> Compete for recognition, cash, and the chance to get your game 
>>> on Steam. $5K grand prize plus 10 genre and skill prizes. 
>>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>>> _______________________________________________
>>> xbiblio-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
>> 
>> 
>> ------------------------------------------------------------------------------
>> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
>> Rise to greatness in Intel's independent game demo contest.
>> Compete for recognition, cash, and the chance to get your game 
>> on Steam. $5K grand prize plus 10 genre and skill prizes. 
>> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
>> _______________________________________________
>> xbiblio-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
> 
> --
> Charles Parnot
> [email protected]
> twitter: @cparnot
> http://mekentosj.com
> 
> 
> 
> ------------------------------------------------------------------------------
> Own the Future-Intel&reg; Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game 
> on Steam. $5K grand prize plus 10 genre and skill prizes. 
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> _______________________________________________
> xbiblio-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xbiblio-devel


------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
xbiblio-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel

Reply via email to