anoopkcn / obsidian-reference-map

Reference and citation map for literature review and discovery
GNU General Public License v3.0
195 stars 5 forks source link

Support for BibTeX .bib database file #15

Closed jsmm closed 1 year ago

jsmm commented 1 year ago

I am looking forward to use this plugin but my bibilography database is in a BibTeX .bib database file managed by BibDesk app.

Would it be possible to support this .bib file as well, as other reference plugins in the Obsidian, such as obsidian-pandoc-reference-list, do?

Thanks.

anoopkcn commented 1 year ago

Hi, At the moment, Reference Map doesn't support .bib files. However, it supports CSL JSON files from any reference manager(Zotero, Mendeley, papers, etc.). I don't know If BibDesk can export CSL JSON or not. If it's not a possibility, you can convert the .bib file using pandoc as follows:

pandoc "My Library.bib" -t csljson -o "My Library.json"

You can put the newly generated My Library.json file in the CSL JSON File Path setting in the Reference Map settings tab. Now you can reference items using the Ids in the JSON file as @id

davidjaggi commented 1 year ago

Would also like to see .bib files as many other obsidian plugins use it. So it would be more convenient than relying on separate files.

anoopkcn commented 1 year ago

I will implement it in the future(in a couple of weeks) but you can use this as a temporary solution.

jankap commented 1 year ago

I'm just curios, what's the advantage of the json format vs bib? Are there more information or is it easier to parse?

I also would like to see a .bib solution, one file less to be synced ;)

anoopkcn commented 1 year ago

Generally, JSON files are preferred since they are universal files. Therefore they have native support in Typescript and Javascript. For the bib file, I will have to write a parser and validator. There is a package called Citation.js, but the import cost for this is too high (for just a parser) also, the package doesn't have any type definitions. There is also a node package called @retorquere/bibtex-parser, which is what the citations plugin uses in obsidian. I could look into that.

anoopkcn commented 1 year ago

Hi @jsmm, @jankap, @davidjaggi, I implemented support for .bib files. It is available in the latest release.

anoopkcn commented 1 year ago

I am clossing this issue since the feature is implemented. If there are problems, please create a new bug report.