Open reox opened 2 years ago
This is an essential feature to integrate seamlessly JabRef database with logseq.
For reference, the code in JabRef that handles file fields is this one: https://github.com/JabRef/jabref/blob/4230b5d177c43360c4c26ce003db0a661dc71d63/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java#L15
Besides parsing the pdf file path, I think logseq-citation-manager could append page url (created by command Create Inline Link to Lit Note) or block url (created by command Create Inline Literature Note) to the comment field of .bib file, such as [Logseq Notes](logseq://graph/Logseq?page=citekey)
.
This markdown format can be identified and displayed in preview window by JabRef, which creates bi-directional links.
Jabref writes some meta information in the file field as
for example a PDF file without a description:
This however does not work well together with this plugin, as in the template expansion the full content of the file entry is used. Would it be possible to split up the string and provide separate template variables to be able to format the correct link? Note, that in the
description
andactual file
also colons can appear, but are escaped with\
, for example:I guess one option would be here: https://github.com/sawhney17/logseq-citation-manager/blob/f5988dbfc17cac5b9e26051f3910483798879518/src/utils.ts#L77-L87 to use a regex like
((\\:)|[^:])*
to check if there are multiple matches. Or is this actually something that should be directed to the bibtex parser https://github.com/retorquere/bibtex-parser ?