Cleanup of styles in the Zotero Style Repository

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/7838
https://www.zotero.org/trac/log?rev=7844&stop_rev=7840
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), 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/..csl
rintze@ubuntu:~/Desktop/styles/csl$ grep '
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

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

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

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?

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/6074

Rintze

Is the code for that hook in the SVN?

Rintze

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

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

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

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 (
https://github.com/ajlyon/zotero-bits/issues) still planned for 2.1?

Rintze

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.):

Feel free (anyone) to add your thoughts.

Bruce