Which tools do you use for style development? I’ve tried to configure VS Code so that it can validate CSL files… no success so far. So for the moment I’ll have to stay with Emacs, but perhaps there are easier solutions?
Been awhile since I’ve edited style files, but I was quite happy doing it in emacs.
Another good rng-validating xml editor, though not free, is Oxygen. May be easier to use for some.
I’ve been using Atom with linter-autocomplete-jing which does validate and even autocompletes (and, of course, you get excellent git integration as a freeby). Before that emacs with nxml mode and magit. Still occasionally use that.
Ok. So at the moment it seems to boil down to Emacs and Atom if you prefer free options. Thanks.
I was just playing with this and am really impressed with how far Atom and XML-edting on Atom has come.
So I created a CSL validation package here.
Two issues I could use help on:
- how to get it to validate also using the embedded schematron schema (the version in the package repo is updated per a PR I just submitted).
- how to auto apply the CSL grammar to all files with the csl extension (now, one has to manually select the correct “CSL Style” grammar).
It occurred to me if we could iron this out, we could promote this as the easiest and free approach to CSL editing/validation. Also works across the major platforms; Windows, Mac, Linux.
Very cool, thanks! I’ll have a look.
Concerning 2: I have this in my atom config:
"linter-autocomplete-jing":
rules: [
{
outcome:
schemaProps: [
{
lang: "rnc"
path: "c:/users/denis/.schema/csl/csl-mlz.rnc"
}
]
priority: 1
test:
pathRegex: "\\.csl$"
rootAttributes:
version: "1.1mlz1"
}
{
outcome:
schemaProps: [
{
lang: "rnc"
path: "c:/users/denis/.schema/csl/csl.rnc"
}
]
priority: 1
test:
pathRegex: "\\.csl$"
}
]
This selects the appropriate schema for files with the csl extension. Depending on the version attribute it will also use the CSL-M schema.
I can’t get that to work ATM. I also don’t know why I need to add that anyway, since Atom does understand the CSL extension.
Anyway, I’ve added these two issues to the README, and added one for future additions. It seems to me it would benefit from some templates and scripts to automate a few pain points in CSL creation and editing.
Well, I need it because I use CSL-M and CSL so I need to use the appropriate schema. But even without this, how is Atom able to locate the appropriate schema for a csl file?
My naive understanding was Atom knows csl files (see here), and I provided code to tell where the schema is for that file type.
But clearly I’m missing something.
I think Atom will treat csl files as xml files, but that doesn’t necessarily involve auto-completion or validation.
In case of interest for anybody, I’m using Vim together with citeproc-test-runner. Recently, I added a jing syntastic plugin for syntax checking in Vim.
My understanding is Atom will associate .csl extensions with the text.xml.csl
document type, and that my code then says how to validate that type.
But obviously I’m missing something.
This would work if the code included a resolvable schema url but it doesn’t. Therefore the editor can only check validity against generic XML.
The repo includes the schema, and the path to that schema
Oh, of course. My bad.
I, however, had problems validating against the rng files that I automatically created with trang.
That’s not the issue here though.
I only don’t currently have the association automatic; I have to manually select the “CSL Style” grammar from the UI. I want that to be set when I open a csl file.