Git Product home page Git Product logo

zotero.koplugin's Introduction

Zotero for KOReader

This addon for KOReader allows you to view your Zotero collections.

Note

Beta version! Please report bugs, pull requests are welcome.

Screenshot of this plugin displaying a list of papers alongside a search button

Features

  • Synchronize via Web API
  • Display collections, navigate to sub-collections
  • Download & open attached PDF files
  • Supports WebDAV storage backend
  • Search entries by the title of the publication, name of the first author or DOI.

Installation Guide

  1. Copy the files in this repository to <KOReader>/plugins/zotero.koplugin
  2. Obtain an API token for your account by generating a new key in your Zotero Settings. Note the userID and the private key.
  3. Set your credentials for Zotero either directly in KOReader or edit the configuration file as described below.

Differences to previous versions

In previous versions, you had to copy your entire Zotero directory to your device. The new version however works with the Zotero Web API and downloads attachments ad-hoc. If you are not interested in syncing your collection and would rather access your entire collection offline, you can take a look at version 0.1.

Configuration

WebDAV support

If you do not want to pay Zotero for more storage, you can also store the attachments in a WebDAV folder like Nextcloud. You can read more about how to set up WebDAV in the Zotero manual.

The WebDAV URL should point to a directory named zotero. If you use Nextcloud, it will look similar to this: http://your-instance.tld/remote.php/dav/files/your-username/zotero. It is probably a good idea to use an app password instead of your user password, so that you can easily revoke it in the security settings should you ever lose your device.

Manual configuration

If you do not want to type in the account credentials on your E-Reader, you can also edit the settings file directly. Edit the zotero/meta.lua file inside the koreader directory and supply needed values:

-- we can read Lua syntax here!
return {
    ["api_key"] = "", -- API secret key
    ["user_id"] = "", -- API user ID, should be an integer number
    ["webdav_enabled"] = false,
    ["webdav_url"] = "", -- URL to WebDAV zotero directory
    ["webdav_user"] = "",
    ["webdav_password"] = "",
}

zotero.koplugin's People

Contributors

hrdl-github avatar stelzch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zotero.koplugin's Issues

Browse database crash

Tried installing be93233 on my Kobo Libra 2 with KoReader 2023.01. After copying over my full Zotero directory and setting the Zotero path in KoReader (worked fine) the plugin crashes at

main.lua:366 attempt to call method 'init' (a nil value)

FR Idea: Sync Zotero Annotations

Zotero's Web API v3 allows syncing annotations, which in Zotero will include annotations for PDF, EPUB, and HTML (which is a pretty large subset of what KOReader allows for annotation too). Zotero's annotation offerings uses the open Web Annotation Data Model schema are actually quite similar to KOReader's - there is a start and stop position for a highlight, a copy of the highlighted text 'style' (colors for Zotero, vs. highlighted/underlined/strikethrough/invert for KOReader), and a few more fields. Both of them also support basic text notes which are both anchored to highlights.

I think there is sufficient feature overlap that there could be a translation layer that displays Zotero annotations as KOReader annotations when the Zotero attachment is opened in KOReader (after browsing and selecting). Eventually even modifying/adding/deleting annotations in KOReader and syncing the changes back to the Web API would be ideal, but read-only would be a first step. This would make annotations much more valuable as they are no longer isolated to one system. (Ideally, a universal file format based on WADM might be better, but two largely supported programs is better than one).

There are some issues to overcome with annotation translation:

  1. KOReader highlights are positioned differently from Zotero's (e.g. different coordinate 0,0 orientation, different scale, more). I tried to figure this out a few months ago but didn't get there
  2. KOReader highlight styles are primarily intended for black-and-white screens while Zotero highlights are only stylized by color (and RGB color is allowed, but the UI picker only shows ~9 options). My initial idea has been to map the first four preset Zotero colors to the four KOReader black-white-friendly options, but KOReader color highlighting may be added soon and partially solve this.
  3. KOReader's bookmark and highlight structure in Lua docsettings are a bit confusing.
  4. Zotero area selections and hovering notes (not anchored to text) don't have a corollary in KOReader (maybe add them as a KOReader FR in the future?). Technically neither do Zotero item notes (not attachment notes), but the latter one can probably be ignored. Zotero will probably add more features, and only some will be KOReader-recognizable.
  5. Would need to decide how to deal with offline Zotero annotation storage in KOReader, though I think the plugin itself needs to be further developed first.

Here's an example set of highlights in Zotero on top, the same in KOReader on bottom, followed by the data structure used for the two Zotero highlights which I think is accessible via Web API:

image

I might be able to help build this at some point, but I don't currently have the time. I have the beginnings of a translation layer in Python but it's early on and needs to be in Lua anyway.

Future request: Select and Download all articles

Hi! Thank you very much for the Zotero plugin on KOReader!
It is great! Works reliably.

Can you please make an option to enter selection mode (and also a button to select all), select multiple articles, and them put them in the queue for download?

Ideal case is when I create a new collection, say This evening, put 10-12 articles and then go into KOReader and download them all to read.

Thank you!

Feature Request: Make number of items adjustable

Device: Kindle Scribe (5.16.2)
KOReader: v2023.10-55
Zotero: v0.2

Hi! Thank you very much for the Zotero plugin!

Can you please make the number of items per page configurable?
Or at least the same as in FM - Info items per page (top menu setting).

The problem is that now I have 14 items on Kindle Scribe's 10 inch screen. When I have 40-50 articles, it takes me long time to skim through multiple pages.
I used to have 20-30 items per page in FM and info lists.

Thanks!

Sync is successful but browse shows empy screen

I followed the install instructions, added the user id and api key, Synchronize shows the 'success' message, but browse doesn't show any item, only "No items" at the bottom.

Any ideas?

I have several entries (links and pdfs) in the zotero library. If relevant, I only use the web interface (never installed the app).

FIX: Books downloaded and opened with Zotero are not marked as Reading until book is closed

Hi @stelzch

Recently, we fixed an issue in the plugin that was not marking newly downloaded articles as Reading.
This resulted into newly downloaded and opened not being shown in the History - Reading section.
It required to exit the book - by going to FM, switching to another book, or closing the KOReader - to be able to mark it.
This prevented me from quickly skimming through multiple articles back-and-forth.

The problem is solved in this line:

ReaderUI:showReader(full_path)

By replacing it to:

                ReaderUI:showReader(BaseUtil.realpath(full_path))

See linked comment with the fix and associated ticket in KOReader's GitHub.
koreader/koreader#11444 (comment)

Thank you!

Feature request: Epub files

Hi,

Thanks for this great app!

I prefer to manage all my documents - even ebooks - in Zotero. Therefore, I wish we could handle and read even epubs and not only pdfs via this plugin.

All the best!

Bug: Dispatcher action doese not work

Device: Kindle Scribe (5.16.2)
KOReader: v2023.10-55
Zotero: v0.2

Hi! Thank you very much for the Zotero plugin.

Dispatcher action for Zotero doesn't work - I assigned it to a gesture, but it does nothing when I trigger it. The same story when I put it in Quick Menu.

Thanks!

Zotero settings

Hi!
I can see Zotero tries to open settings upon init:

zotero.koplugin/main.lua

Lines 138 to 146 in 43f7e1e

function Plugin:init()
self.initialized = false
self:onDispatcherRegisterActions()
self.ui.menu:registerToMainMenu(self)
self.settings = LuaSettings:open(("%s/%s"):format(DataStorage:getSettingsDir(), "zotero_settings.lua"))
xpcall(self.initAPIAndBrowser, self.initError, self)
self.initialized = true
print("Z: successfully initialized!")
end

But it doesn't save that file yet? I don't see it in the koreader/settings.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.