Zotero plugin to export metadata and notes to markdown

I’ve seen a few people here use Zotero. I ended up writing a plugin to export metadata and annotations much like the zotero-roam-export plugin. It’s sort of made for my own workflow, but I thought I’d leave it here in case someone finds it useful: https://github.com/argenos/zotero-mdnotes

What I use the plugin for:

  • Extract metadata from the item and export the highlights from the PDFs using Zotfile (similar to zotero-roam-export ) and save them in markdown files. I get one file for each item selected. Originally I was using a single file per reference, but I’ve found it better to have more atomic notes, and I extract highlights based on color as described here. The metadata file contains links to the highlights/annotations. All those files are saved to a folder in my vault, and I can (optionally) choose to use cite keys (using Better Bibtex) as file names e.g. doe2020aaaa-zotero.md
  • Create a file for my own notes based on the naming above (minus the suffix) doe2020aaaa.md , and transcludes the metadata and adds a header for my notes. This is the one I use to link when I refer to the whole paper and as a sort of table of contents around specific ideas of that paper, i.e. I can “cite” the paper as [[doe2020aaaa]] .
  • Add all those files as linked attachments to the Zotero item, so that if I double click the markdown note is opened with the default markdown app from Zotero (if eventually the URL protocol is implemented, then the link can easily be switched to include obsidian:// ). This basically lets me go from one app to the other. In Obsidian, in the doe2020aaaa file I can write my own notes, and in preview mode I can also click on a link in that opens Zotero and selects the right item. In Zotero I can double click to edit my notes, or open it in Obsidian.

Disclaimer: it’s probably buggy, hacky, etc. I’m not really a javascript developer, I just wanted to automate that a bit.

29 Likes

Thanks very much for the plugin. It works perfectly. Thanks too for the useful notes on your workflow both here and in Zotero best practices.

Such a pleasure to be able to sync both these excellent programs and arrive at a more or less seamless workflow.

1 Like

Hello arg,
this is an amazing contribution. Because of the automatic backlink between notes feature of Zotero, I am considering using Zotero for my Zettelkasten. I just want to be sure that If I want to move my notes in the future to Obsidian or Zettlr, I will be able to do so.

I just installed it alongside these other plugins:

  • Better BibTex for Zotero
  • Zotero LibreOffice Integration
  • Zotfile
  • Zutilo Utility for Zotero
    on a machine running Ubuntu 18.04 and Zotero 5.0.89

I have not been able to export notes though. I select the destination folder and then nothing happens. Do you have any clue about what is going on?

Hi @ToniB, I suspect it’s related to what is being chosen. Unfortunately, I haven’t been able to make the menus context-aware yet (I am planning to add notifications for success/errors, but it’s going to take a little while). At the very top of the readme, there is a link of what needs to be selected for the menus to work: cheatsheet.

Let me know if that doesn’t work out for you! Feel free to reach out in the #academia channel in the Discord server too!

Hey @argentum I finally figure it out thanks to your comment. The problem is that I was trying to export standalone notes. When I export notes inside items, then it works perfectly.

By exporting some I noticed that the “relate” field is not kept in the md note (as a link to those notes), which I guess makes sense because that note could not exist if and I do not create it as well. Since that field is gold, I will not use Zotero as a Zettelkasten tool, yet your script is still pretty cool and I will use it for other ends in my workflow. Thank you again!

Oh yeah, at the moment I haven’t looked into those! Feel free to open an issue for them though, I think they might be easy to add. Would you place them below the H1 header of the md file?

Disclaimer: I do have a few pending requests, and it might take me a little time to get to all of them, but I’ll definitely take a look!

So cool ! I find this function so hard and I also very like the dark mode of zotero as you show in github, can you share it ? Thanks very much!

On linux is possible to set dark theme to some of the applications by choosing dark system theme, other way around is to copy css theme

Hey all,

I was wondering if anyone could give me any guidance. I have installed Zotfile, made relevant notes/highlights and extracted annotations into a note in Zotero. But I cannot export that zotero note to markdown, no option is available upon right click.

Is there something I have done in the install? I have removed and re-installed but same issue.

Running off Mac BigSur 11.1

Thanks in advance!

Hi @Dan_Martin77! You have to install the mdnotes plugin for that (it’s not part of Zotfile).

Thank you so much. How naive of me.

Appreciate your support/patience!

1 Like

It would be great to have notes auto exported from Zotero and auto-imported in Obsidian. Anyone have some ideas on how to do this? I do not want to go through the entire process of exporting, saving in a location, then opening them and copying them into obsidian.

Why don’t you export directly to your obsidian vault? (That’s what I do). No way to automate the extraction, that I know of, but you can for sure reduce the number of steps so it’s barely noticeable.

1 Like

I’m having an issue that is just baffling me. I’ve just set up mdnotes along with Cat’s suggested workflow, and it works except that the exported annotations don’t include blockquotes. I’m running the current beta of Zotero and the dev build of Zotfile, which I figure might be causing the issue, but if there’s something I’m missing in the config I’d really appreciate the help.

Are you using the latest mdnotes build (alpha4)?

1 Like

Aha! I was on 0.1.3; just downloaded alpha 4 and blockquotes appear to be working. Thanks for the help and the excellent plugin!

1 Like

On my export Im not getting the page of the annotation linked. Im using the zotero-beta pdf tools.
image

You won’t get links with the Zotero beta. Please see Zotero with integration of pdf.js - already available in Beta - #2 by argentum

2 Likes

Hi, newbie here.

I managed to get zotfile to extract notes by color in Zotero via Manage Attachments > Extract Annotations following your post, yet I can’t make it work via Mdnotes > Extract to markdown. Nothing happens.

Using last zotero version in windows 10.

Plus, how should I set the default folder directory to export the markdown files for it to be the same folder the pdf is set in?

Thanks a lot!