zotero-markdb-connect icon indicating copy to clipboard operation
zotero-markdb-connect copied to clipboard

matching via filename (without @) does not work for me

Open fruchtblase opened this issue 3 years ago • 3 comments

Dear @daeh,

for some reason the plugin won't work for me. The correct md files get picked up by the regex, and the corresponding citekeys are given to the plugin by bbt, but the don't get matched. Am I doing something wrong or is this a bug?

MarkDBConnect-debug.txt

Kind regards fruchtblase

fruchtblase avatar Jul 25 '22 09:07 fruchtblase

hi @fruchtblase you have configuration issues. First off, the file filter you're using, \d{4}.md, is not doing what you think it's doing. Try using:

^.+\d{4}\.md

Since you're using a file pattern that doesn't start with @, the BBT citekeys will need to be in the MD notes' metadata. So you'll need to specify the meta-data keyword for the BBT citekey. For instance, the file trucInterdisciplinaryInfluencesBehavioral2021.md could begin with:

---
citekey: trucInterdisciplinaryInfluencesBehavioral2021
---

note body

in which case the metadata keyword would be citekey. If you have any trouble with that, please upload one of your MD notes and I'll give you advice on how configure the frontmatter.

daeh avatar Jul 25 '22 16:07 daeh

thanks for the quick reply! looks like I misunderstood the readme, i thought that it is possible match on filenames (sans @) without relying on metadata.

fruchtblase avatar Jul 25 '22 16:07 fruchtblase

I understand how the readme could lead to that confusion.

But yeah, when you use a custom file filter, the BBT citekey will need to come from the metadata. Let me know if that doesn't resolve the issue.

daeh avatar Jul 25 '22 16:07 daeh

Would love to see this issue resolved as using non-unicode character like @ in filenames may lead to issues

tim-hilde avatar Oct 21 '22 12:10 tim-hilde

The Alfred workflow Supercharged Citation Picker by pseudometa also shows if there is a markdown literature note corresponding to an entry: https://github.com/chrisgrieser/alfred-bibtex-citation-picker#literature-note-actions. Maybe this helps to implement it into this plugin.

Sorry for cross posting, wasn't sure where it fits best

tim-hilde avatar Dec 10 '22 09:12 tim-hilde

Hi @tim-hilde — I'm not sure I understand the issue that you're trying to resolve. Can you explain your use case?

I left this issue open for the OP to report back if getting the citekey from the metadata resolved their issue.

Are you saying that you want the ability to match notes based on filenames and not yaml front matter? If so, can you tell me why specifying the citekey in a note's metadata isn't a solution for you?

It would not be hard to implement file-name based citekey extraction with a user-defined regex expression. I just haven't seen a use case that warrants the extra complexity it would add to the plugin configuration. But I'm open to it if you can help me understand why it's necessary.

daeh avatar Dec 10 '22 19:12 daeh

Sorry if I didn't make myself clear enough. My use case is that I have markdown files that have just the citekey as a name. Without the @ that is needed for the matching via filename.

Sure, I could add the citekey to the front matter of all my hundreds of notes, but I don't see a strong reason to do that if there would be a rather easy way to stick to my workflow.

tim-hilde avatar Dec 11 '22 15:12 tim-hilde

If putting the citekey in metadata, can the file title be anything?

ASchanke avatar Jan 12 '23 10:01 ASchanke

@ASchanke if the citekey comes from the metadata, the file name is quite flexible. The markdown database application and file system imposes naming constraints, but this plugin should not.

daeh avatar Jan 15 '23 01:01 daeh

closed by 3fff8d34f7ff00e0a18d7bff8c099892fcba9f8f

daeh avatar Jan 15 '23 16:01 daeh