kerko
kerko copied to clipboard
Have multiple biblografical reference citation Styles
Change to allow to configure multiple citation styles and display them separately
for that added on a new extractor a call to zotero api getting the 'bib' for all styles configured.
also changed the setting definition for csl_style from str to List
Any advice or changes to the logic is welcome.
Thanks for submitting this PR, and sorry for taking such a long time before reviewing it.
Providing multiple citation formats would be a valuable feature. However, that is a risky proposal because each additional CSL style requires an extra round of Zotero API calls, and synchronization times are already quite lengthy with large Zotero libraries. So far, I have stayed away from that feature mainly for that reason.
Because additional citation formats have to be requested in separate rounds of API calls, there are also risks for inconsistencies, e.g., if someone has edited an item between the "kerko sync cache" time and the extra citation format API calls. Perhaps not a huge issue, but still something to consider.
As it stands, the PR cannot be merged for a few reasons:
- Many changes (typos in comments, code formatting, "brand" configuration, default value changes), some of which I find questionable, are unrelated to the proposed feature and would be best handled by separate PRs.
- Names of CSL styles are hardcoded ("APA", "ABNT").
- This is the biggest issue: Zotero API calls for retrieving the citation formats are performed from an extractor. That architecture has a few unfortunate consequences:
- Kerko normally performs all Zotero API calls at "sync cache" time only (see synchronization). But extractors run at "sync index" time. If an extractor uses the Zotero API, then one can no longer change certain configuration parameters and rebuild the search index to apply the changes without having to wait for the Zotero API. This is extremely significant when working with large libraries.
- Zotero API calls are performed item by item, because extractors are called for individual items. If the library has 10k items, there will be 10k additional individual API calls per additional CSL style. That is unlike Kerko's "sync cache" process, which normally requests batches of 100 items (maximum allowed by Zotero), and that saves a huge amount of synchronization time.
- Zotero API calls are performed on each item, even when that item has not changed since last sync. This arises from a weakness of Kerko's "sync index" process, which always runs through the whole (cached) library, unlike the "sync cache" process, which is incremental, only retrieving new or updated items from Zotero. Another reason for not calling the Zotero API at "sync index" time.