argenos / zotero-mdnotes

A Zotero plugin to export item metadata and notes as markdown files
https://argenos.github.io/zotero-mdnotes/
GNU General Public License v3.0
1.34k stars 81 forks source link

Only "Batch export to markdown" gives me expected behaviour of copying the content of highlights and notes into markdown file #55

Closed danieltomasz closed 3 years ago

danieltomasz commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

I don't know if it is a bug or a feature - but if it is a feature it isn't intuitive to me. I have used zotflie to "Export Annotations" Only "Batch export to markdown" gives me expected behaviour of copying the content of highlights and notes into markdown file.

Extracted Annotations (2020-05-12)

"(Yellow) - The concept of "Truth" needs a different definition in biology compared to physics. The mathematical laws of the universe do not vary according to the seasons or the number of hours since a good meal. Maxwell's equations for electromagnetic wave propagation are not influenced by cultural background or by genetic disorders" (Cohen 2017:80)

aaaaa (note on p.80)

"(Red) - The purpose of this paper is to discuss some issues related to replications in thefield of cognitive electrophysiology, which generally refers to using the brain's electromagneticfields in order to understand aspects of cognition and how cognitive processes are implemented by neural circuits in the brain. " (Cohen 2017:80)

Expected behavior "Export to markdown" will copy content of the highlights and annotation to markdown note.

The effect should be something like that

## Highlights and Annotations

> "**(Yellow)** - The concept of "Truth" needs a different definition in biology compared to physics. The mathematical laws of the universe do not vary according to the seasons or the number of hours since a good meal. Maxwell's equations for electromagnetic wave propagation are not influenced by cultural background or by genetic disorders" ([Cohen 2017:80](zotero://open-pdf/library/items/FLQZ3X3K?page=1))

aaaaa ([note on p.80](zotero://open-pdf/library/items/FLQZ3X3K?page=1))

> "**(Red)** - The purpose of this paper is to discuss some issues related to replications in thefield of cognitive electrophysiology, which generally refers to using the brain's electromagneticfields in order to understand aspects of cognition and how cognitive processes are implemented by neural circuits in the brain. " ([Cohen 2017:80](zotero://open-pdf/library/items/FLQZ3X3K?page=1))

Should I use templates to use this result?

Desktop (please complete the following information):

OS: [MacOS Big Sur] Zotero version: [v5.0.93] Mdnotes version: [ v0.1.2] Zotfile version: [v5.0.16] BetterBibtex version: [v5.2.89]

argenos commented 3 years ago

Exporting to markdown depends on your settings and what you have selected. The menus are unfortunately not context-aware right now, so there's a small cheatsheet at the top of the README I have a feeling that you have "Split files", and you're selecting the top-level item. That will only export the metadata (using the templates). If you want to export a note, the Zotero note should be selected.

danieltomasz commented 3 years ago

thanks for the explanation ! I have file organisation : single file and yes, I tried to export parent item, when exporting note it works as expected.

In case I want to export item metadata and content of the note (annotations and highlights) in one file should I use Zotero Note Template.md template and {{noteContent}}? I see the discussion here https://github.com/argenos/zotero-mdnotes/issues/44 and I will try to learn something from it.

argenos commented 3 years ago

Ah indeed! I'm working on something to make the single file option more intuitive. The menus don't make a lot of sense for it right now.

danieltomasz commented 3 years ago

Great! As your plugin become more popular this will be indeed welcomed :)

argenos commented 3 years ago

I haven't had much time to work on this lately, but I want to gather some feedback regarding the single file export here, particularly if this is a black and white thing. I'm trying to add a different menu for the Single file exports, and I'm wondering if any of the other options make sense:

image

Hoping that you don't mind being pinged: @pcuellar, @ScriBanana, @brimwats

pcuellar commented 3 years ago

I personally think it will be much easier to have a single template where users can add/remove the options that suit them best. Mdnotes and Standalone templates are basically the same. Zotero note template is almost the same as Zotero metadata, except for the {{noteContent}}field. A single template with each field explained, will allow users to easily choose what data they want on export. Maybe even have several templates if they need to.

argenos commented 3 years ago

Those options make sense for the multi-file export (which is what I use and I’m more familiar with)

Here I’m just wondering if you (those using single files) ever need to export just one Zotero note (nothing related to the parent item) or just the metadata alone, without the notes. Basically, are all your exports covered with a single template?

pcuellar commented 3 years ago

Gotcha! It does for me. I can put in/out whatever data I need. Personally, I prefer the single file export and edit out what I don't need in the export.

brimwats1 commented 3 years ago

Well first, the titles/names are kinda confusing, maybe something like

  1. Export citation as a markdown note
  2. Export Zotero Note as a markdown note
  3. Export a combined markdown note

I also prefer just a single file that I can update (and then reexport) as needed. I don't edit these notes once they are in obsidian, they just work as a inspiration/graphing repository.

I would also prefer an template where I could just pick and choose what would end up in the note or not, or I'm happy to customize it if that's impractical.

argenos commented 3 years ago

:+1: Alright, depending on the feedback I might be able to push something soon (I hope!) for this that makes the menus a bit less confusing. I'll update the docs too on what templates are relevant.

Export citation as a markdown note Export Zotero Note as a markdown note

These two should be covered by the Export to markdown menu, depending on whether you chose the note or the item (each of those two options would need their separate templates: in this case Zotero Metadata Template, Zotero Note Template). I might leave this menu in.

I think it makes sense to rename Export as single file to Create full export note to keep it short and let the tooltip specify Export an item's metadata and notes as a single file. I'll also make the standalone note menu optional for everyone (not just single file).

As for the single template, I'm not sure if this will be entirely possible without entirely new syntax. I gave a small explanation of why in #44:

{{noteContent}} indeed only works with the Zotero Note template (see here), the main reason is that note content refers to the particular note you're trying to export. In a single file setting, with an item that has more than one note that would be a bit ambiguous, i.e. the content of which note?

The way this currently works is that Zotero Note Template lets you order/customize the contents of the notes. During export, notes belonging to that item are processed one by one and the string with all the notes is added to the combined file wherever the {{notes}} placeholder is in. The easiest thing, for now, is to use the Mdnotes Default Template for the combined notes and customize note contents in the Zotero Note Template (what most of you are doing at the moment). In practice this would mean that:

I need to think about the syntax to reduce the number of templates a bit more, so I'll probably add that in a separate release. Let me know if you have a better idea to handle this!

brimwats1 commented 3 years ago

sounds great!

jrennstich commented 3 years ago

Thanks so much for looking into this!

argenos commented 3 years ago

v0.1.3 should be released in a few minutes with the changes we discussed above. Let me know if that helps!

I've also updated the documentation, particularly the file organization section in the config page. I might not have caught all the places where this needs to be updated, so feel free to open a new issue or PR if you catch something else I missed.

pcuellar commented 3 years ago

I just updated my configurations, this flows really nice. Muchas gracias for all this work @argenos!

argenos commented 3 years ago

Good to hear! I'll close this based on the feedback I got already, but let me know if anything pops up!