daeh/zotero-markdb-connect
Tentang
Plugin Zotero yang menghubungkan basis data Markdown Anda ke Zotero. Langsung beralih dari Item Zotero ke file Markdown yang terhubung. Secara otomatis memberi tag pada Item Zotero agar Anda dapat dengan mudah melihat makalah mana yang sudah Anda beri catatan.
Data dan analisisPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- +1
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliMarkDB-Connect (Zotero Markdown DataBase Connect)
- Scans your Markdown database and adds a colored tag to associated Zotero items.
- Jump to Markdown notes from the contextual menu of Zotero items.
- Supports various Markdown databases, including Obsidian, logseq, and Zettlr.
- Zotero 10 compatible.

This is a plugin for Zotero, a research source management tool. The MarkDB-Connect plugin searches a user-defined folder for markdown files that include a citation key or Zotero-Item-Key, and adds a colored tag to the corresponding Zotero items.
This plugin was initially designed with the Obsidian markdown editor in mind, and was inspired by the obsidian-citation-plugin workflow. It offers preliminary support for logseq and Zettlr. It can be adapted to other databases that store markdown files outside of Zotero, and to other workflows that generate markdown reading notes linked to Zotero items (such as Zotero's Export Note feature).
Please post any bugs, questions, or feature requests in the GitHub repository's issues.
Plugin Functions
Adds a colored tag to Zotero items for which there are associated reading notes in an external folder.
Supports multiple markdown files for a single Zotero item.
Opens an existing markdown note in Obsidian, logseq, or the system's default markdown note editor (e.g. Zettlr, Typora) from the contextual menu of a Zotero item.
Installation
- Download the plugin (the
.xpifile) from the latest release - Open Zotero
- From
Tools -> Plugins - Select
Install Add-on From File...from the gear icon ⛭ - Choose the
.xpifile you downloaded (e.g.markdb-connect.xpi) - Restart Zotero
[!NOTE] The last release for Zotero 9 was
v0.2.2.The last release for Zotero 7 and 8 was
v0.1.8.The last release for Zotero 6 was
v0.0.27.
Setup
A markdown file can specify which Zotero item it's linked to using either a citation key or a Zotero-Item-Key. Citation keys can be set manually in Zotero or generated automatically by Better BibTeX.
Using citation keys to link markdown files to Zotero items.
This is recommended if you created the markdown notes with obsidian-citation-plugin, BibNotes Formatter, or Obsidian Zotero Integration.
The citation key can be taken from the filename, YAML metadata, or body of the markdown note.
FYI There's a nice configuration tutorial detailing a common use case (thanks to Prof. Elena Razlogova).
Using Zotero Item Keys to link markdown files to Zotero items.
This is recommended if you created the markdown notes with the
Export Notefeature of Zotero.The markdown note contents should include the Zotero-Item-Key in a consistent format.
NOTE: multiple markdown files can point to the same Zotero item. But a given markdown file should only be linked to a single Zotero item. A markdown reading note can reference multiple Zotero items throughout the file, but MarkDB-Connect will only link the markdown note to one citation key / Zotero-Item-Key.
Option 1: Using citation keys
MarkDB-Connect can extract the citation key that specifies which Zotero Item a markdown note corresponds to.
The citation key can be taken from a markdown file's filename, YAML metadata,
or elsewhere in the file's contents.
Citation keys are stored in Zotero's native citationKey field
and can be generated automatically by Better BibTeX or set manually.
configuration details
In Zotero's Settings, click the
MarkDB-Connectpreference pane.Specify the location of the folder that contains your markdown reading notes (e.g.
/Users/me/Documents/ObsVault/ReadingNotes/). The MarkDB-Connect plugin will recursively search this path for markdown files. Files and folders whose names begin with.(such as.obsidianand.trash) are skipped.By default, MarkDB-Connect expects that the filenames of your markdown reading note files begin with
@mycitekeybut can include extra information after it (e.g. a reading note with the citation keyshepard1987sciencecould have the filename@shepard1987science.mdor@shepard1987science Toward a universal law of generalization for psychological science.md).- If your citation keys contain certain special characters (e.g.
:,/), you will need to extract the citekeys from the markdown file's contents rather than its filename.
- If your citation keys contain certain special characters (e.g.
If the default does not match your use case, you can specify how to extract citation keys.
A. filename - Select
Custom File Filterand define a RegExp with a single capturing group.- E.g. the default is
^@(\S+).*\.md$, which looks for files beginning with@and uses the first word as the citation key.
- E.g. the default is
B. metadata - Select
Citation key - taken from YAML metadataand specify a keyword from the notes' YAML frontmatter (here's an example).- For info on metadata syntax, see Properties.
C. contents - Select
Citation key - captured with custom RegExpand define a RegExp with a single capturing group to return exactly 1 match per file.
Run the synchronization function from
Tools -> MarkDB-Connect Sync Tags.- This will add a tag (
ObsCite) to every Zotero item for which there exists a reading note in the external folder you specified.
- This will add a tag (
In the
Tagsplane of Zotero, right-click on theObsCitetag and assign it a color, which will mark the tagged items in the preview plane of Zotero. (In the screenshot above, Zotero items associated with reading notes are marked with a 🟦 blue tag.)
Option 2: Using Zotero Item Keys
MarkDB-Connect can extract the Zotero-Item-Key that specifies which Zotero Item a markdown note corresponds to. The Zotero-Item-Key is taken from the markdown file contents using a custom RegExp pattern.
Zotero automatically generates Item Keys, they take the form of ABCD1234, as in zotero://select/library/items/ABCD1234. NB this is not the same as the citation key (e.g. mycitekey in zotero://select/items/@mycitekey).
configuration details
In Zotero's Settings, click the
MarkDB-Connectpreference pane.Specify the location of the folder that contains your markdown reading notes (e.g.
/Users/me/Documents/ObsVault/ReadingNotes/). The MarkDB-Connect plugin will recursively search this path for markdown files. Files and folders whose names begin with.(such as.obsidianand.trash) are skipped.The default behavior is to search for markdown files beginning with
@.Alternatively, you can define a custom RegExp pattern to match your reading note files.
Select the
Match Markdown Files to Zotero Items Using:Zotero-Item-Key - captured with custom RegExpoption.Specify a RegExp pattern to extract the Zotero-Item-Key from the markdown contents.
E.g. if your note has the line
- local:: [local zotero](zotero://select/library/items/GZ9DQ2AM)you could extract the Zotero key (
GZ9DQ2AM) using this RegExp pattern:^- local::.+\/items\/(\w+)\)
Run the synchronization function from
Tools -> MarkDB-Connect Sync Tags.- This will add a tag (
ObsCite) to every Zotero item for which there exists a reading note in the external folder you specified.
- This will add a tag (
In the
Tagsplane of Zotero, right-click on theObsCitetag and assign it a color, which will mark the tagged items in the preview plane of Zotero. (In the screenshot above, Zotero items associated with reading notes are marked with a 🟦 blue tag.)
Example Markdown Note
In this example markdown note (@saxe2017emobtom.md), MarkDB-Connect will use the
YAML metadata keyword citekey to find the citation key (saxe2017emobtom)
that determines which Zotero item to associate with the markdown file.
Notice that the markdown file can include other citation keys and Zotero-Item-Keys, which are ignored by the plugin.
---
citekey: saxe2017emobtom
zoterouri: zotero://select/library/items/IACZMXU4
bbturi: zotero://select/items/@saxe2017emobtom
doi: 10.1016/j.copsyc.2017.04.019
---
# @saxe2017emobtom
**Formalizing emotion concepts within a Bayesian model of theory of mind**
(2017) _Current Opinion in Psychology_
[Open in Zotero](zotero://select/library/items/IACZMXU4)
The body of notes can include references to other Zotero items.
The _MarkDB-Connect_ plugin will only link this file to one Zotero item
(in this case, it will use the value of the `citekey` property).
Here are links to other papers:
- This one uses [a Zotero URI](zotero://select/library/items/4RJ97IFL)
- This one uses [a Better BibTeX URI](zotero://select/items/@anzellotti2021opaque)
- This one uses an Obsidian wiki link: [[@cusimano2018cogsci]]
Example Templates
Below are example templates for various Obsidian plugins
Template for obsidian-citation-plugin
---
citekey: "{{citekey}}"
title: "{{title}}"
year: {{year}}
authors: [{{authorString}}]
{{#if containerTitle~}} publication: "{{containerTitle}}" {{~else~}} {{~/if}}
{{#if DOI~}} doi: "{{DOI}}" {{~else~}} {{~/if}}
aliases: ["@{{citekey}}", "@{{citekey}} {{title}}"]
tags:
- readingNote
---
# @{{citekey}}
**{{title}}**
{{authorString}}
{{#if year~}} ({{year}}) {{~else~}} {{~/if}} {{~#if containerTitle}} _{{containerTitle~}}_ {{~else~}} {{~/if}}
[Open in Zotero]({{zoteroSelectURI}})
Example for ZotLit 2.2.3 or later
ZotLit's default profile writes each item's citation key to a citekey property in the literature note's frontmatter. If you removed or changed that property, restore it in the profile's Properties tab with the name citekey, the JSON-e value { "$eval": "zt.citationKey" }, and Replace the existing value on update (see ZotLit's frontmatter reference). Every profile that writes notes MarkDB-Connect scans needs it. Items without a citation key get citekey: null, which cannot match; give them a citation key, or see Matching on zotero-key below.
ZotLit's default note names have no @ prefix (e.g. saxe2017emobtom.md), so MarkDB-Connect's default file filter skips them. In MarkDB-Connect's settings:
- Set Folder Containing Markdown Reading Notes to a folder that contains all your ZotLit literature notes (ZotLit's default is
literatures). With the settings below, scanned files without a usablecitekeyvalue are reported as errors, so keep ZotLit's template folder and unrelated notes outside it, or see Scanning only @-prefixed notes below. - Select Custom File Filter and enter
^.+\.md$. The pattern has no capturing group, so the citation key comes only from the frontmatter. - Select Citation key - taken from YAML metadata and set the keyword to
citekey. - For notes on items in group libraries, select Also match items in Group Libraries. under Include Group Libraries?.
To add the property to existing notes, run ZotLit: Update notes in Obsidian and choose Update all notes. Then run MarkDB-Connect Sync Tags in Zotero.
Matching on zotero-key (for items without citation keys)
ZotLit also writes a zotero-key property: the item key (zotero-key: IACZMXU4), followed by g and the group ID in a group library. To match on it, use Option 2, which replaces citation-key matching for the whole scan. Keep the Custom File Filter ^.+\.md$, select Zotero-Item-Key - captured with custom RegExp, and enter this pattern, which reads the key from the frontmatter:
(?<![\s\S])\uFEFF?---\r?\n(?:(?!(?:---|\.\.\.)(?:\s|$)).*\r?\n)*?zotero-key:[ \t]*["']?([A-Z0-9]{8})(?:g\d+)?["']?\s*$
The pattern drops the group suffix, so if two included libraries have an item with the same key, the note is linked to both.
Scanning only @-prefixed notes
Use this option to scan only files whose names begin with @. In each ZotLit profile, set the Note name template to:
@{{ zt.citationKey | default: zt.DOI | default: zt.title | default: zt.key | replace: "/", "-" }}{% suffix %}
For a profile whose template language is Eta, write the equivalent in Eta. Add a leading @ to existing note filenames that lack it. Then change the Custom File Filter to ^@.+\.md$.
Suppressing the Zotero security notification
Recent builds of Zotero show a security notification every time an application-specific URI (such as obsidian://…) is launched, because Zotero does not remember the user's link preferences. The notification can be suppressed from Zotero's advanced configuration, but the procedure differs between Zotero 9 or later and earlier versions because the underlying Gecko preference changed.

Zotero 9 and 10
The dialog can be bypassed on a per-scheme basis by creating a network.protocol-handler.external.<scheme> preference set to true. The setting must be added manually (it does not exist by default).
- Open Zotero Settings
- Click the "Advanced" tab
- Click the "Config Editor" button
- Click the "Accept Risk and Continue" button
- In the search field, enter the config you want to create, e.g.
network.protocol-handler.external.obsidiannetwork.protocol-handler.external.logseq
- If no matching entry appears, click the "+" (New) button on the right of the novel config.
- Make sure the type is boolean and the value is true. By default, the setting should be set to "Boolean" and should be assigned
truewhen created. 
- Make sure the type is boolean and the value is true. By default, the setting should be set to "Boolean" and should be assigned
If prompts still appear for links triggered from outside Zotero, you can additionally set network.protocol-handler.prompt-from-external to false using the same procedure.
Zotero 7 and 8
- Open Zotero Settings
- Click the "Advanced" tab
- Click the "Config Editor" button
- Click the "Accept Risk and Continue" button
- Search for
security.external_protocol_requires_permission - Double click the
security.external_protocol_requires_permissionitem to toggle its value tofalse
Related Projects
obsidian-citation-plugin by hans
- Obsidian plugin that integrates your Zotero database with Obsidian.
BibNotes Formatter by stefanopagliari
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
Obsidian Zotero Integration by mgmeyers
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
Zotero 6 'Export Notes' feature by Zotero
- Zotero 6 beta feature to export notes and annotations from Zotero items as markdown files.
Zotero to Markdown by e-alizadeh
- Python library to export annotations and notes from Zotero items as markdown files.
Zotero Better Notes by windingwind
- A Zotero plugin for note management.
Logseq Citations Plugin by sawhney17
- Logseq plugin that integrates your Zotero database with Logseq.
Notes
GitHub: Source code repository
This extension uses the zotero-plugin-template.
License
Distributed under the MIT License.
Author
Jelajahi proyek terkait
Memuat…