New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to citations/bibliography rather than links #24

Open
retorquere opened this Issue Feb 6, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@retorquere
Copy link
Contributor

retorquere commented Feb 6, 2019

I'm interested in adding the possibility to have the ODF-scanner use the Zotero-embedded citeproc to create a finalized document; not to remove the existing functionality to create a Zotero-compatible document but so that I can use Word-online + ODF scan without requiring the use of Word to finalize the document. Would this be:

  • feasible?
  • desirable?

and if so, can you point me to the part of the code that does the current replacement?

@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Feb 6, 2019

It'd definitely be desirable, but it wouldn't be easy. Currently the thing that makes the tool uncomplicated is that it doesn't need to talk to Zotero at all during the scan. All the citation data is added when setting a citation style in LibreOffice. The scan just converts the markers to LO Reference Marks with Zotero format and Zotero item.uris that allow for updating.

The relevant function is here: https://github.com/Juris-M/zotero-odf-scan-plugin/blob/master/chrome/content/rtfScan.js#L271

Hope you like regular expressions ;)

@retorquere

This comment has been minimized.

Copy link
Contributor

retorquere commented Feb 6, 2019

The talking to Zotero bit isn't really too hard. Is https://github.com/Juris-M/zotero-odf-scan-plugin/blob/master/chrome/content/rtfScan.js#L512 the central function that orchestrates the finding and replacing, and https://github.com/Juris-M/zotero-odf-scan-plugin/blob/master/chrome/content/rtfScan.js#L594 the part that does the actual replacements?

If I may ask, why use regexes when FF has XML/XPath functionality built in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment