jgm/citeproc

Use citeproc for style development

Closed this issue · 11 comments

Could it be possible to use citeproc for style development? Say, use a bunch of tests and check whether the output of a given style matches the expected output.

Thanks. I'll have a look into this. That looks pretty useful. I actually wanted to build something similar using shelltestrunner, but I'm on Windows and my Haskell installation refuses to compile it...

Anyway, I'm still thinking this could be something for citeproc to provide natively, given that it already supports citeproc-js's test format.

Note that I am not very satisfied with the test file being in HTML, for it requires to track the changes in the HTML writer and to update the test file accordingly. Using a combination of an HTML file for visualizing the result and native or json output for testing may be better.

I've now built a simple python script for this. It tests against the output of markdown-citations.

jgm commented

That seems an appropriate solution -- should we close this?

We could. But maybe you have a better idea how this could be supported?

jgm commented

No, but I probably don't quite understand what you're trying to do. In any case, it doesn't sound like the kind of thing that should be built into this library.

The idea would be similar to what https://github.com/cormacrelf/jest-csl and https://github.com/juris-m/citeproc-test-runner provide. You can define test cases for a given style and test whether the style conforms to the tests. So, when developping styles you always know if your style is already or not. And it you make changes, you can always be sure that you don't break things.

If you think this is out of scope, we can close the issue, I was thinking it might already be possible to run the processor against a test suite given that this library already supports the format defined in the test-suite.

jgm commented

This should be quite easy already using the citeproc executable and a little shell scripting. See its man page.

Ok. Sounds reasonable. I'll have a look.

How can you build the library as an executable? The readme says I should build it with the executable flag. But how?

Found it:

stack build --flag citeproc:executable