CSL.Output.Formats.prototype.org = {
.....
}
if (!z) {
z = Components.classes["@zotero.org/Zotero;1"].
getService(Components.interfaces.nsISupports).wrappedJSObject;
/* these must be initialized AFTER zotero is loaded */
easyKeyRe = z.Utilities.XRegExp("^(\\p{Lu}[\\p{Ll}_-]+)(\\p{Lu}\\p{Ll}+)?([0-9]{4})?");
alternateEasyKeyRe = z.Utilities.XRegExp("^([\\p{Ll}_-]+)(:[0-9]{4})?(\\p{Ll}+)?");
}
/ Not wrapped in an onLoad function call, because we want this
// in place _before_ Zotero is initialized.
var Zotero = Components.classes["@zotero.org/Zotero;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
var Components = Components.utils["import"]("resource://gre/modules/XPCOMUtils.jsm");
Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Components.interfaces.mozIJSSubScriptLoader)
.loadSubScript("chrome://zotero-processor/content/citeproc.js");
Zotero.CiteProc.CSL = CSL;
Actually writing a new format isn't really hard; I tried to parse & transform the generated HTML, but in the end found it much easier to write the format in the end. You can find mine here: https://github.com/ZotPlus/zotero-better-bibtex/blob/master/chrome/content/zotero-better-bibtex/schomd.coffee ; it's written in CoffeeScript, but you can pass that through the "Try CoffeeScript" online translator at http://coffeescript.org/ to create fairly clean javascript.
--
No particular reason, I hadn't considered people might be interested. I'll put together a pull request.
ODT is a lot more complicated. If this is intended to be pasted in somewhere you'd have to play nice with the existing document styles which you can't know.
Following up on a long-dead thread. Emiliano; many thanks for this. Is there any reason you haven't added markdown support to the upstream citeproc-js? Wouldn't it be great to have markdown export in citeproc? Anyway I will build an org-mode translator on this model sometime in the next week or so.
As Emiliano says, direct-to-odt for fully formatted cites would be hard. As far as I know, the attributes for the formatting elements are document-specific, declared in the document header. So an odt format in citeproc-js probably isn't something to attempt.
What you could do, though, is to slot in templates for live Zotero citations, in the same way that the ODF/RTF Scan plugin does. For that, you could either run the plugin code itself over the finished ODT document (which would require a separate connection to Zotero for the plugin code to work with), or push the field templates into the document directly by extending the org-mode ODT converter itself. If you can get the necessary IDs (library, item) and strings (prefix, suffix, locator) in the Emacs environment, the latter route seems like it might simplify things. (Seems like - I'm talking through my hat here, since I don't know enough of Emacs to have an actual opinion.)