This is a plugin for diagrams.net(drawio) which retrieves the library from your Zotero personal account and organizes your references according to the collection in it. With this plugin, you can add tags for blocks with standard citation format.
Please use our customized drawio. A third-party plugin is not allowed in the official drawio web app directly.
- Add the plugin.
- Visit our customized drawio and go to
Extra > Plugins...
- Click
Add
andCustom...
- Enter
and click
plugins/zotero.js
Add
. Finally, apply the change and refresh the site.
- Visit our customized drawio and go to
- Click
Extras > Zotero Tag Selector...
to open the tag selector. - (Optional) If you are working on writing a thesis using Latex, you can upload the bibliography meta-file (
.bbl
) of your project. It will try to match the citation number in your thesis by matching the DOI of an item. - Enter the personal account information to diagrams.net.
- Select a block in your diagram, and add a tag by clicking
Add
button or remove a tag by clickingRemove
. - And you should see the attached block with standard citation format. The red indicates a journal paper; the blue indicates a conference paper.
You need to install wkhtmltopdf
, see the instruction here.
sudo apt-get install wkhtmltopdf
pip install pdfkit
To export pdfs according to the bibliography in your Latex project, you can use the following steps.
- Click
Extras > Zotero Tag Selector...
to open the tag selector. - Click
Export CSV
button to download the csv file, which contains the item key, proper citation format, and item title. - Excute the script to copy PDF files.
Replace
python3 export_pdf.py <csv_path> <lib_json_path> <zotero_storage_path> [--output_folder=<output_folder>]
<csv_path>
with the path of the csv file just downloaded<lib_json_path>
is the better biblatex library json file exported from Zotero, which can be obtained by clickingExport Library
in the Zotero. Remember to select theBetterBibTex JSON
format.<zotero_storage_path>
is the path of the storage folder of your Zotero. You can find it by right clicking any item in the Zotero and clickShow File
. The folder should be the parent folder of the file.
For developing usage, you can install this chrome extension to disable Content-Security-Policy for a web application. And you can use our plugin on the official web app. Additional approval is required after the reloading of the page. Please re-authorize it by clicking the Disable Content-Security
button.
After 20.3.0 release, the original author prohibited the load of third party plugin. And therefore, we need extra steps to bypass this checking. If you have a better method to deal with this, please let me know, thanks.
- Press
F12
to open the dev tools, go to theSource
tab, and open the filetop/app.diagrams.net/js/app.min.js
. Click the space left to the line number to add a breakpoint at the beginning. - Turn on the
disable-content-security
extension to disable CSR protection. - Refresh the page. You should notice that the page halts during loading.
- Go to the
Console
tab in dev tools. Enterand execute it.window.ALLOW_CUSTOM_PLUGINS = true
- Resume the breakpoint.
We are currently working on the following subjects. Feel free to join us.
- Developing the plugin for diagrams.net, please checkout to
feature/drawio_plugin
for more details - Unclassified documents will not shown in the tags. As mentioned in #2.
- The call number may be occupied by some useful information (usually in the literature of the book type) if it is used as a reference number field. As mentioned in #2.
- Enhance user interface.
- This vscode extension allows you to host the files with a local server.
- Since 20.3.0 release, one needs to force the external plugin from different domain available by the following steps. This chrome extension allows you to add plugins from arbitrary sources. So, you can just debug locally without pushing it, which has been tested in Windows 10 WSL 1.0.
- Our our customized drawio does not have the restriction of loading external plugins. It is recommended to use this version for debugging.
- Use vscode to open this project. Open
/publics/index.html
, right clickOpen in Default Browser
at any line. Then, you obtain a local file server, e.g.http://localhost:52330/plugins/zotero.js
. - Use this link as an experimental plugin. In drawio, click
Extra
>Plugins
>Add
>Custom
, and paste the url. - Turn on the disable-content-security extension to disable CSR protection, and refresh the page. Now, the plugin should be loaded successfully.