Skip to content

Commit

Permalink
revert include.js removal in options.xul
Browse files Browse the repository at this point in the history
  • Loading branch information
daeh committed Nov 27, 2022
1 parent cf34137 commit ce46c9b
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 59 deletions.
103 changes: 52 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# MarkDB-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](https://obsidian.md), [logseq](https://logseq.com), and [Zettlr](https://www.zettlr.com)_**
- **_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](https://obsidian.md), [logseq](https://logseq.com), and [Zettlr](https://www.zettlr.com)_**

![MarkDBConnectScreenshot](MarkDBConnectScreenshot.png)

Expand All @@ -26,28 +26,28 @@ Opens an existing markdown note in [Obsidian](https://obsidian.md), [logseq](htt

## Instalation

- Download the plugin (the .xpi file) from the latest release: https://github.com/daeh/zotero-markdb-connect/releases
- To download the .xpi file, right click it and select 'Save link as'
- Run Zotero (version 5.x or 6.x)
- Go to `Tools -> Add-ons`
- `Install Add-on From File`
- Choose the file `MarkDBConnect-0.0.19.xpi`
- Restart Zotero
- Download the plugin (the .xpi file) from the latest release: https://github.com/daeh/zotero-markdb-connect/releases
- To download the .xpi file, right click it and select 'Save link as'
- Run Zotero (version 5.x or 6.x)
- Go to `Tools -> Add-ons`
- `Install Add-on From File`
- Choose the file `MarkDBConnect-0.0.20.xpi`
- Restart Zotero

## Setup

A markdown file can specify which Zotero item it's linked to using either a [Better BibTeX](https://retorque.re/zotero-better-bibtex/) citekey or a Zotero-Item-Key. I recommend using Better BibTeX citekeys when possible.

1. Using **Better BibTeX citekeys** to link markdown files to Zotero items.

- This is recommended if you created the markdown notes with [obsidian-citation-plugin](https://github.com/hans/obsidian-citation-plugin), [BibNotes Formatter](https://github.com/stefanopagliari/bibnotes), or [Obsidian Zotero Integration](https://github.com/mgmeyers/obsidian-zotero-integration).
- This is recommended if you created the markdown notes with [obsidian-citation-plugin](https://github.com/hans/obsidian-citation-plugin), [BibNotes Formatter](https://github.com/stefanopagliari/bibnotes), or [Obsidian Zotero Integration](https://github.com/mgmeyers/obsidian-zotero-integration).

- The BetterBibTeX citekey needs to appear in the filename or the metadata of the markdown note.
- The BetterBibTeX citekey needs to appear in the filename or the metadata of the markdown note.

2. Using **Zotero Item Keys** to link markdown files to Zotero items.

- This is recommended if you created the markdown notes with the `Export Note` feature of Zotero.
- The markdown note contents should include the Zotero-Item-Key in a consistent format.
- This is recommended if you created the markdown notes with the `Export Note` feature 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 BetterBibTeX-citekey / Zotero-Item-Key.

Expand All @@ -57,24 +57,24 @@ NOTE: multiple markdown files can point to the same Zotero item. But a given mar

_MarkDB-Connect_ can extract the BetterBibTeX citekey that specifies which Zotero Item a markdown note corresponds to. The BetterBibTeX citekey can be taken from the markdown filename or yaml metadata.

- In `MarkDBConnect Preferences...` (under the `Tools` menu),
- In `MarkDBConnect Preferences...` (under the `Tools` menu),

- 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.
- 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.

- The default behavior is to search for markdown files beginning with `@`.
- Alternatively, you can specify a RegEx pattern to match your reading note files.
- The default behavior is to search for markdown files beginning with `@`.
- Alternatively, you can specify a RegEx pattern to match your reading note files.

- Select the `Match notes based on BetterBibTeX citekey` option.
- Select the `Match notes based on BetterBibTeX citekey` option.

- By default, _MarkDB-Connect_ expects that the filenames of your markdown reading note files begin with `@mycitekey` but can include extra information after it (e.g. a reading note with the BetterBibTeX citekey `shepard1987science` could have the file name `@shepard1987science.md` or `@shepard1987science Toward a universal law of generalization for psychological science.md`).
- By default, _MarkDB-Connect_ expects that the filenames of your markdown reading note files begin with `@mycitekey` but can include extra information after it (e.g. a reading note with the BetterBibTeX citekey `shepard1987science` could have the file name `@shepard1987science.md` or `@shepard1987science Toward a universal law of generalization for psychological science.md`).

- Optionally, you can have _MarkDB-Connect_ read the metadata of your markdown notes and extract the citekey from one of the fields. To enable this, specify the metadata ID (`citekey` is a common value).
- Optionally, you can have _MarkDB-Connect_ read the metadata of your markdown notes and extract the citekey from one of the fields. To enable this, specify the metadata ID (`citekey` is a common value).

- This is necessary if the file names do not begin with the correct citekey, which may happen if the citekeys include special characters (e.g. if a citekey contains `:`, it will probably need to be taken from the yaml metadata rather than the filename).
- This is necessary if the file names do not begin with the correct citekey, which may happen if the citekeys include special characters (e.g. if a citekey contains `:`, it will probably need to be taken from the yaml metadata rather than the filename).

- Run the synchronization function from `Tools -> MarkDBConnect 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.
- In the `Tags` plane of Zotero, right-click on the `ObsCite` tag and assign it a color, which will mark the tagged items in the preview plane of Zotero.
- Run the synchronization function from `Tools -> MarkDBConnect 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.
- In the `Tags` plane of Zotero, right-click on the `ObsCite` tag and assign it a color, which will mark the tagged items in the preview plane of Zotero.

---

Expand All @@ -84,28 +84,28 @@ _MarkDB-Connect_ can extract the Zotero-Item-Key that specifies which Zotero Ite

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 BetterBibTeX citekey you assigned an item (e.g. `mycitekey` in `zotero://select/items/@mycitekey`).

- In `MarkDBConnect Preferences...` (under the `Tools` menu),
- In `MarkDBConnect Preferences...` (under the `Tools` menu),

- 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.
- 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.

- The default behavior is to search for markdown files beginning with `@`.
- Alternatively, you can specify a RegEx pattern to match your reading note files.
- The default behavior is to search for markdown files beginning with `@`.
- Alternatively, you can specify a RegEx pattern to match your reading note files.

- Select the `Match notes based on Zotero-Item-Key` option.
- Select the `Match notes based on Zotero-Item-Key` option.

- Specify a RegEx pattern to extract the Zotero-Item-Key from the markdown contents.
- Specify a RegEx pattern to extract the Zotero-Item-Key from the markdown contents.

E.g. if your note has the line
E.g. if your note has the line

`- local:: [local zotero](zotero://select/library/items/GZ9DQ2AM)`
`- local:: [local zotero](zotero://select/library/items/GZ9DQ2AM)`

you could extract the Zotero key (`GZ9DQ2AM`) using this RegEx pattern:
you could extract the Zotero key (`GZ9DQ2AM`) using this RegEx pattern:

`^- local::.+\/items\/(\w+)\)`
`^- local::.+\/items\/(\w+)\)`

- Run the synchronization function from `Tools -> MarkDBConnect 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.
- In the `Tags` plane of Zotero, right-click on the `ObsCite` tag and assign it a color, which will mark the tagged items in the preview plane of Zotero.
- Run the synchronization function from `Tools -> MarkDBConnect 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.
- In the `Tags` plane of Zotero, right-click on the `ObsCite` tag and assign it a color, which will mark the tagged items in the preview plane of Zotero.

---

Expand All @@ -123,7 +123,8 @@ doi: 10.1016/j.copsyc.2017.04.019

# Formalizing emotion concepts within a Bayesian model of theory of mind

The body of notes can include references to other Zotero items. The _MarkDB-Connect_ plugin will only link this file to one Zotero item.
The body of notes can include references to other Zotero items. The _MarkDB-Connect_
plugin will only link this file to one Zotero item.

Here are links to other papers.

Expand All @@ -136,18 +137,18 @@ This one uses an Obsidian wiki link: [[@cusimano2018cogsci]]

## Related Projects

- [obsidian-citation-plugin](https://github.com/hans/obsidian-citation-plugin) by hans
- Obsidian plugin that integrates your Zotero database with Obsidian.
- [BibNotes Formatter](https://github.com/stefanopagliari/bibnotes) by stefanopagliari
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
- [Obsidian Zotero Integration](https://github.com/mgmeyers/obsidian-zotero-integration) by mgmeyers
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
- [Zotero 6 'Export Notes' feature](https://forums.zotero.org/discussion/93521/available-for-beta-testing-markdown-export-of-notes/p1) by Zotero
- Zotero 6 beta feature to export notes and annotations from Zotero items as markdown files.
- [Zotero-mdnotes](https://argentinaos.com/zotero-mdnotes/) by argenos
- Zotero plugin to export metadata and notes from Zotero items as markdown files.
- [Zotero to Markdown](https://github.com/e-alizadeh/Zotero2md) by e-alizadeh
- Python library to export annotations and notes from Zotero items as markdown files.
- [obsidian-citation-plugin](https://github.com/hans/obsidian-citation-plugin) by hans
- Obsidian plugin that integrates your Zotero database with Obsidian.
- [BibNotes Formatter](https://github.com/stefanopagliari/bibnotes) by stefanopagliari
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
- [Obsidian Zotero Integration](https://github.com/mgmeyers/obsidian-zotero-integration) by mgmeyers
- Obsidian plugin to facilitate exporting annotations from Zotero into Obsidian.
- [Zotero 6 'Export Notes' feature](https://forums.zotero.org/discussion/93521/available-for-beta-testing-markdown-export-of-notes/p1) by Zotero
- Zotero 6 beta feature to export notes and annotations from Zotero items as markdown files.
- [Zotero-mdnotes](https://argentinaos.com/zotero-mdnotes/) by argenos
- Zotero plugin to export metadata and notes from Zotero items as markdown files.
- [Zotero to Markdown](https://github.com/e-alizadeh/Zotero2md) by e-alizadeh
- Python library to export annotations and notes from Zotero items as markdown files.

## Notes

Expand Down
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

version='0.0.19'
version='0.0.20'

rm -f MarkDBConnect-${version}.xpi
zip -r MarkDBConnect-${version}.xpi chrome/* defaults/* chrome.manifest install.rdf -x "*.DS_Store"
Expand Down
2 changes: 1 addition & 1 deletion chrome/content/options.xul
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,6 @@
</prefpane>

<script src="options.js"/>
<!-- <script src="chrome://zotero/content/include.js"/> -->
<script src="chrome://zotero/content/include.js"/>

</prefwindow>
6 changes: 3 additions & 3 deletions chrome/content/scripts/mdbconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (typeof Zotero === 'undefined') {


Zotero.MarkDBconnect = {
version: '0.0.19',
version: '0.0.20',
folderSep: null,
cleanrun: true,
suppressNotifications: false,
Expand Down Expand Up @@ -1122,7 +1122,7 @@ Zotero.MarkDBconnect = {

const configuration = this.getPref('configuration');
if (configuration === 'false') {

Zotero.debug("MarkDBconnect: configuration not found");

/// check if there are preexisting preferences
Expand All @@ -1146,7 +1146,7 @@ Zotero.MarkDBconnect = {
this.showNotification(...["MarkDBConnect", "ZotObsCite has been renamed. Please remove 'ZoteroObsidianCitations' from your Extensions", false]);
return;
}
} catch (error) {}
} catch (error) { }
} else {
/// don't run sync if plugin has yet to be configured
this.showNotification(...["MarkDBConnect", "Please configure MarkDBConnect preferences", true]);
Expand Down
1 change: 1 addition & 0 deletions chrome/locale/en-US/options.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<!ENTITY mdbconnect.preferences.filepattern-label "regex (case insensitive): /">
<!ENTITY mdbconnect.preferences.filepattern-label-end "/i">
<!ENTITY mdbconnect.preferences.filefilterstrategy-customfileregex-desc "Default pattern is: ^@.+\.md$">
<!ENTITY mdbconnect.preferences.filefilterstrategy-customfileregex-desc "NB this option requires that you specify a yaml keyword or regex filter below.">

<!ENTITY mdbconnect.preferences.matchstrategy-bbtcitekey-title "Use BetterBibTeX citekeys to link markdown files to Zotero items (Option 1)">
<!ENTITY mdbconnect.preferences.matchstrategy-bbtcitekey-label "Match notes based on BetterBibTeX citekey">
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>MarkDBConnect</em:name>
<em:version>0.0.19</em:version>
<em:version>0.0.20</em:version>
<em:type>2</em:type>
<em:creator>Dae Houlihan</em:creator>
<em:description>Add a tag to Zotero items that have a external note.</em:description>
Expand Down
4 changes: 2 additions & 2 deletions update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.0.19</em:version>
<em:version>0.0.20</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>[email protected]</em:id>
<em:minVersion>5.0.0</em:minVersion>
<em:maxVersion>6.0.*</em:maxVersion>
<em:updateLink>https://github.com/daeh/zotero-markdb-connect/releases/download/v0.0.19/MarkDBConnect-0.0.19.xpi</em:updateLink>
<em:updateLink>https://github.com/daeh/zotero-markdb-connect/releases/download/v0.0.20/MarkDBConnect-0.0.20.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>

Expand Down

0 comments on commit ce46c9b

Please sign in to comment.