GithubHelp home page GithubHelp logo

zotools's Introduction

zotools logo

build codecov

This is a simple collection of tools to operate on a Zotero library.

Commands implemented:

  • sync: creates or updates a local cache with useful info from the remote library
  • search: searches via regular expression for items in the cached library
  • act: performs an action on a selected result from a previous search

Please, feel free to copy, improve, distribute and share. Feedback and patches are always welcome!

Installation

  • With go get github.com/acidghost/zotools/cmd/...
  • By downloading the source and running make build followed by make install

Usage

You need to provide a configuration file with the Zotero API key and various paths the tool uses to operate (look at the template in the root of this repository):

  • key is the Zotero API key; you can get one from https://www.zotero.org/settings/keys
  • zotero is the path to the folder where Zotero downloads all the attachments
  • storage is the file zotools will use to store all its information (e.g. Zotero items, search results, etc.)

The configuration file can be passed via the command line (-config flag) or via an environment variable (ZOTOOLS). The former overwrites the latter.

For detailed usage information try zotools help and zotools cmd -h.

Use Cases

Search for an item and then open it. First issue zotools search <term> and then zotools act -i=<idx> zathura to open the result numbered idx with zathura.

fzf

If you desire a more interactive experience than running zotools twice to first search and then to act, you may have a look at fzf. The function below uses fzf to interactively search with zotools and act on your selection with one enter at the correct line. To use it add the following function to your .bashrc (or equivalent) and install fzf alongside zotools.

zotools_pdf() {
    local INITIAL_QUERY=$1
    local SEARCH_CMD="zotools search "
    FZF_DEFAULT_COMMAND="$SEARCH_CMD '$INITIAL_QUERY'" \
        fzf --bind "change:reload:$SEARCH_CMD {q} || true" \
            --ansi --disabled --query "$INITIAL_QUERY" \
            --height=50% --layout=reverse \
        | awk '{print $1}' | tr -d ')' \
        | xargs -I{} -o zotools act -i={} zathura
}

zotools's People

Contributors

acidghost avatar

Stargazers

 avatar ipruning avatar

Watchers

James Cloos avatar  avatar  avatar

zotools's Issues

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.