daeh / zotero-markdb-connect

Zotero plugin that links your Markdown database to Zotero. Jump directly from Zotero Items to connected Markdown files. Automatically tags Zotero Items so you can easily see which papers you've made notes for.
MIT License
516 stars 8 forks source link

plugin cannot find notes in Obsidian folder #18

Closed erazlogo closed 2 years ago

erazlogo commented 2 years ago

So I linked the plugin to a folder in Obsidian "~/obsidian/cinema-project/1. Notes" but when I restart Zotero the message I get "no notes found." Is that because there is a space in the name of the folder? Thanks!

daeh commented 2 years ago

spaces in the path shouldn't be an issue. What's an example filepath to an existing Obsidian reading note? Will you generate a debugging log from the advanced settings and upload it here?

image
erazlogo commented 2 years ago

here is the log. I am trying to find all notes where in YAML there is a valid citekey field--there are 517 notes and most of them have the citekey field in YAML. I don't have literature notes, I include source data for every note from the source. thanks!

{ "version": "0.0.15", "zoteroVersion": "6.0.2", "isMac": true, "isLinux": false, "isWin": false, "prefs": { "matchstrategy": "bbtcitekey", "sourcedir": "/Users/er/obsidian/cinema-project/1. Notes", "filefilterstrategy": "default", "filepattern": "^@.+\.md$", "zotkeyregex": "local::.+\/items\/(\w+)\)", "metadatakeyword": "citekey" }, "config": { "matchstrategy": "bbtcitekey", "sourcedir": "/Users/er/obsidian/cinema-project/1. Notes", "filefilterstrategy": "default", "filepattern": "^@.+\.md$", "zotkeyregex": "local::.+\/items\/(\w+)\)", "metadatakeyword": "citekey", "tagstr": "obsidian_notes", "vaultresolution": "path", "vaultname": "cinema-project", "bbtinstalled": [ true ], "checkSetting": true }, "results": { "cleanrun": true, "ndataKeys": 0 } }

daeh commented 2 years ago

what's the path to one of the MD files in ~/obsidian/cinema-project/1. Notes/ that is associated with a Zotero item? Go ahead and upload the contents of the MD file too.

erazlogo commented 2 years ago

~/obsidian/cinema-project/1. Notes/a silent nazi and a soviet film at nuremberg.md

here is the entire file:

--- type: "journalArticle" author: "Douglas, Lawrence" title: "The Shrunken Head of Buchenwald: Icons of Atrocity at Nuremberg" publication: "Representations" date: "1998-01-01" online: "online" local: "local" citekey: "[@douglasShrunkenHeadBuchenwald1998]" --- Lawrence Douglas, "The Shrunken Head of Buchenwald: Icons of Atrocity at Nuremberg," Representations (1998) online local

source/secondary

Index

[[1945.11.20-1946.10.06 Nuremberg Trials]] [[Nuremberg]] [[Original German Eight-Millimeter Film of Atrocities Against the Jews 1945]] [[The Atrocities by the German Fascist Invaders in the U.S.S.R. (1945)]]

Connections

[[soviet interpreters at nuremberg trials]] [[possible film translation at nuremberg]] [[nuremberg interpreter translates films for stalin]]

Note

49 Almost immediately on the heels of the display of the shrunken head on the afternoon of 13 50 December 1945, the prosecution showed the court a brief documentary film, one that strengthened and complicated the rhetoric of atavism. Following assistant prosecutor William Walsh's description of how the Nazis "lighted and fanned" the "flame of prejudice" against the Jews, the prosecution submitted what at the time was described as "perhaps one of the most unusual exhibits that will be presented during the Trial": a silent film, unambiguously entitled, "Original German Eight-Millimeter Film of Atrocities Against the Jews."41 Shot with a home camera, its celluloid partially burned, and with a running time of only ninety seconds, the film presented such a confusing and disturbing set of images that it had to be shown twice in rapid succession. It revealed, according to Walsh, "the extermination of a ghetto by Gestapo agents, assisted by military units."42

"Atrocities Against the Jews" is an active document of violence. In its hurried register, naked and half-naked women are seen chased through cobbled streets littered with fallen bodies. A man, bleeding from a head wound, is viciously beaten. A woman is dragged by her hair over a curb (fig. 6). The shots are skewed and 51 blurred by the notion of the camera, suggesting the agitation of the hand that did the filming, and it is this disturbed quality, as much as the images themselves, that accounts for the film's power Yet as terrifying as the film is, it does not seem to describe an organized effort of extermination. Rather, its horrific images suggest the passion and violence of a mob run amok. 53 Responsible specifically for submitting evidence of crimes against humanity, Smirnov began his presentation by using the familiar rhetoric of atavism, referring to the Nazis' "cannibal theories of racism" and the "cannibalistic theories of German fascism."52 And like the Americans, Smirnov turned to documentary film to support his case, screening "The Atrocities by the German Fascist Invaders in the U.S.S.R.," a movie that, in the words of one observer, showed "piles of corpses dwarfing those in Dachau and Buchenwald."53

daeh commented 2 years ago

You should read the documentation about how to configure the settings on the homepage.

The default expectation is that your reading notes all begin with @{{citekey}}, e.g. @douglasShrunkenHeadBuchenwald1998.md. If you'd like your MD files to be named differently, you can define a custom regex pattern using the "Custom File Filter": If you want the plugin to try to match all of the files in that folder, just use .+\.md$

image

In order for the plugin to get the bbtcitekey from the MD file's metadata, it needs to be formatted like the example in the documentation. In your case:

---
type: "journalArticle"
author: "Douglas, Lawrence"
title: "The Shrunken Head of Buchenwald: Icons of Atrocity at Nuremberg"
publication: "Representations"
date: "1998-01-01"
citekey: douglasShrunkenHeadBuchenwald1998
---

# Lawrence Douglas, "The Shrunken Head of Buchenwald: Icons of Atrocity at Nuremberg," Representations (1998) online local

#source/secondary

...

If you fix (1) the Custom File Filter setting and (2) the citekey field of the MD metadata, you should be in good shape.

erazlogo commented 2 years ago

It worked, thank you! Sorry for the question--I don't understand regex very well so would not have been able to change it correctly myself in the settings.

I have 45000+ Zotero items and it didn't take a long time at all to mark 351 items.

I did get an error for the notes that did not have a citekey - "Unable to parse 84 of 517 notes" - could that possibly be suppressed? If you search all notes within a folder there is always bound to be several without a citation.

I also got this error: "sliceObj Error: 92" Not sure what that is, but it may be useful for you.

Thanks again!

daeh commented 2 years ago

Thanks for the benchmark. I haven't tested the plugin with a database that large so it's great to know that it works ok.

The 2 recommended strategies are:

(1) use a file naming pattern that unique to your reading notes. The citations plugin suggests @{{citekey}}.

(2) use a separate folder for your reading notes.

Either strategy will let this plugin differentiate reading-notes (which it should try to link to zotero items) from other MD files (which it should not try to link to zotero items). Otherwise, the plugin doesn't know which files should be associated with Zotero items and which should be ignored.

(The "sliceObj Error" just means that it found MD files using the "Custom File Filter" that could not be match to a Zotero item.)

daeh commented 2 years ago

closing but feel free to reopen if you want to describe a use-case that should be supported.