Adds a previewCitationCluster API, named after the similar method in citeproc-js.
From the draft README:
Preview citation clusters
Sometimes, a user wants to see how a cluster will look while they are editing it, before confirming the change.
let cites = [ { id: "citekey", locator: "45" }, { ... } ];
let positions = [ ... before, { id: 0, note: 34 }, ... after ];
let preview = driver.previewCitationCluster(cites, positions, "html");
The positions array is exactly like a call to setClusterOrder, except exactly one of the positions has an id of 0. This could either:
Replace an existing cluster's position, and preview a cluster replacement; or
Represent the position a cluster is hypothetically inserted.
If you passed only one position, it would be like previewing an operation like "delete the entire document and replace it with this one cluster". That would mean you would never see "ibid" in a preview. So for maximum utility, assemble the positions array as you would a call to setClusterOrder with exactly the operation you're previewing applied.
Adds a previewCitationCluster API, named after the similar method in citeproc-js.
From the draft README: