# Cleanup of styles in the Zotero Style Repository

**URL:** <https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940>\
**Category:** CSL Development\
**Created:** [January 27, 2011, 7:19pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940 "2011-01-27T19:19:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [January 27, 2011, 7:19pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/1 "2011-01-27T19:19:57Z")

</div>

I modified some CSL styles in the Zotero Style Repository to make sure that  
a) style filenames only use lowercase roman letters (a-z), digits (0-9) and  
single hyphens (-), and  
b) the style ID and (for independent styles) link match the style filename

[https://www.zotero.org/trac/changeset/7837](https://www.zotero.org/trac/changeset/7837)  
[https://www.zotero.org/trac/changeset/7838](https://www.zotero.org/trac/changeset/7838)  
[https://www.zotero.org/trac/log?rev=7844&stop\_rev=7840](https://www.zotero.org/trac/log?rev=7844&stop_rev=7840)  
[https://www.zotero.org/trac/changeset/7857](https://www.zotero.org/trac/changeset/7857)

The downside of changing style IDs is that styles lose automatic updating  
and are duplicated when reinstalled (the reason why Dan reverted my changes  
to the default MHRA without bibliography style:  
[https://www.zotero.org/trac/changeset/7850](https://www.zotero.org/trac/changeset/7850)), but this should be a relatively  
minor inconvenience for dev styles.

We can’t really catch these issues through validation, but it might be  
worthwhile to write a script to automate the process so we can catch this  
for future commits. This time, I followed the following steps:

Select independent and dependent styles with non-conforming filenames:  
rintze@ubuntu:~/Desktop/styles/csl$ find . -maxdepth 2 -name  
’_[^a-z0-9-]_.\*’

Output the style filename and ID element (matching was done in Excel):  
rintze@ubuntu:~/Desktop/styles/csl$ grep '  
[http://www.zotero.org/styles/](http://www.zotero.org/styles/)._’ .csl  
rintze@ubuntu:~/Desktop/styles/csl$ grep '  
 [http://www.zotero.org/styles/](http://www.zotero.org/styles/).’ ./dependent/_.csl \> output.txt  
(for the dependent styles, my terminal window buffer couldn’t hold all the  
output, so I sent it to a text file)

Output the style filename and link element for independent styles (matching  
was done in Excel):  
rintze@ubuntu:~/Desktop/styles/csl$ grep ‘\<link href="[^=]\*/\>’ \*.csl

Rintze

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [January 27, 2011, 7:45pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/2 "2011-01-27T19:45:02Z")

</div>

Perhaps going forward with hg/git, we could just have a little  
pre-commit hook to check this (perhaps limited to new files?)?

---

<div class="post-metadata">

**Author:** ![Dan\_Stillman](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@Dan\_Stillman](https://discourse.citationstyles.org/u/Dan_Stillman)\
**Post date:** [January 27, 2011, 8:23pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/3 "2011-01-27T20:23:05Z")

</div>

We can definitely check this in a pre-commit hook in the Zotero SVN. We  
already have a hook that rejects a few things.

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [January 27, 2011, 9:43pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/4 "2011-01-27T21:43:17Z")

</div>

> We can definitely check this in a pre-commit hook in the Zotero SVN. We  
> already have a hook that rejects a few things.

And how about moving the styles out of the Zotero SVN? Or to put this  
differently, what is holding that back?

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [January 27, 2011, 9:55pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/5 "2011-01-27T21:55:41Z")

</div>

I think Simon previously had some troubles with using svn:externals to get  
the CSL locale files from Bitbucket:

[https://www.zotero.org/trac/changeset/6055](https://www.zotero.org/trac/changeset/6055)  
[https://www.zotero.org/trac/changeset/6074](https://www.zotero.org/trac/changeset/6074)

Rintze

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [January 27, 2011, 9:39pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/6 "2011-01-27T21:39:01Z")

</div>

Is the code for that hook in the SVN?

Rintze

---

<div class="post-metadata">

**Author:** ![Sean\_Takats](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sean\_Takats](https://discourse.citationstyles.org/u/Sean_Takats)\
**Post date:** [January 28, 2011, 7:06am UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/7 "2011-01-28T07:06:57Z")

</div>

We need to think about how we’re going to shut down commit on our side and, more important, how we’re going to start pulling from an external repository on an automatic or manual basis. Since this will affect both server and client code, it’s nontrivial. We’re currently finalizing 2.1 and also still bringing the new backend architecture online, so we’re not going to be able to do anything with CSL for a couple of weeks. -Sean

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [January 28, 2011, 2:18pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/8 "2011-01-28T14:18:47Z")

</div>

OK, no problem.

In somewhat related news, I played a bit with the github csl/styles  
issue tracker, and added a few labels to manage:

[https://github.com/citation-style-language/styles/issues](https://github.com/citation-style-language/styles/issues)

I could imagine it’d be easy to start with this (point Zotero and  
Mendeley users here for style requests or bug reports) and to extend  
later to a dedicated web UI: “report issue with this style” link on a  
style page, which then feeds it to the issue tracker.

Bruce

---

<div class="post-metadata">

**Author:** ![Rintze\_Zelle](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.citationstyles.org/rintze_zelle/32/175_2.png) [@Rintze\_Zelle](https://discourse.citationstyles.org/u/Rintze_Zelle)\
**Post date:** [January 28, 2011, 2:19pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/9 "2011-01-28T14:19:02Z")

</div>

> We need to think about how we’re going to shut down commit on our side and,  
> more important, how we’re going to start pulling from an external repository  
> on an automatic or manual basis. Since this will affect both server and  
> client code, it’s nontrivial.

The drawback of sticking with the Zotero Style Repository is that as we get  
to 2.1 final, more and more people will start contributing CSL 1.0 styles to  
take advantage of CSL 1.0 features not available in automatically updated  
styles. If these styles are committed to the Style Repository, they will  
need a different filename and ID from the matching CSL 0.8 style, which is  
rather messy.

> We’re currently finalizing 2.1 and also still bringing the new backend  
> architecture online, so we’re not going to be able to do anything with CSL  
> for a couple of weeks.

Does this mean you’re close to moving from beta’s to release candidates? If  
so, is the reworking of the Zotero data model (  
[Issues · zotero/zotero-bits · GitHub](https://github.com/ajlyon/zotero-bits/issues)) still planned for 2.1?

Rintze

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [January 28, 2011, 3:18pm UTC](https://discourse.citationstyles.org/t/cleanup-of-styles-in-the-zotero-style-repository/940/10 "2011-01-28T15:18:23Z")

</div>

I’ve started a placeholder page on the wiki to try to work out these  
policies (what happens when we have a 1.1 CSL release? how do we deal  
with dependent styles? etc.):

> **[citation-style-language/styles](https://github.com/citation-style-language/styles/wiki)**
>
> Official repository for Citation Style Language (CSL) citation styles. - citation-style-language/styles

Feel free (anyone) to add your thoughts.

Bruce
