Coder Social home page Coder Social logo

serycjon / biblio.el Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpitclaudel/biblio.el

0.0 1.0 0.0 785 KB

Browse and import bibliographic references from CrossRef, DBLP, HAL, arXiv, Dissemin, and doi.org from Emacs

License: GNU General Public License v3.0

Emacs Lisp 99.57% Makefile 0.43%

biblio.el's Introduction

biblio.el: An extensible Emacs package for browsing and fetching references

GPL 3 MELPA Build Status Coverage Status

biblio.el makes it easy to browse and gather bibliographic references and publications from various sources, by keywords or by DOI. References are automatically fetched from well-curated sources, and formatted as BibTeX.

Screenshot

Supported sources:

  • CrossRef, an exhaustive academic search engine
  • arXiv, an archive of pre-prints in various scientific fields
  • DBLP, a database of Computer Science publications
  • HAL, a French repository of Open Access publications
  • IEEE Xplore, a database of Computer Science and Electrical Engineering materials
  • doi.org, a DOI resolver (to retrieve BibTeX records from DOIs)
  • CrossCite, an alternative DOI resolver and BibTeX formatting service
  • Dissemin, a database tracking the open access status of scholarly articles

Usage

Quick start: M-x biblio-lookup. Each source can also be accessed independently:

  • M-x crossref-lookup to query CrossRef
  • M-x arxiv-lookup to query arXiv
  • M-x dblp-lookup to query DBLP
  • M-x hal-lookup to query HAL
  • M-x ieee-lookup to query IEEE Xplore
  • M-x doi-insert to insert a BibTeX record by DOI
  • M-x dissemin-lookup to show information about the open access status of a particular DOI

These commands work together: for example, crossref-lookup displays a list of results in biblio-selection-mode. In that mode, use:

  • RET to visit the corresponding web page
  • c or M-w to copy the BibTeX record of the current entry
  • i or C-y to insert the BibTeX record of the current entry
  • x to run an extended action, such as fetching a Dissemin record

C and I do the same as c and i, but additionally close the search window.

Examples

  • To insert a clean BibTeX entry for this paper in the current buffer, use

      M-x crossref-lookup RET fiat deductive delaware RET i
    

    (the last i inserts the BibTeX record of the currently selected entry in your buffer).

  • To find publications by computer scientist Leslie Lamport, use M-x dblp-lookup RET author:Lamport RET (see more info about DBLP's syntax at https://dblp.uni-trier.de/search/)

  • To check whether an article is freely available online, use x in the list of results. For example M-x crossref-lookup RET emacs stallman RET followed by x Dissemin RET will help you find open access copies of Stallman's paper on EMACS (spoiler: it's here).

Setup

Add MELPA to your package sources, then use M-x package-install RET biblio RET. To get better response times from CrossRef, you may consider customizing biblio-crossref-user-email-address.

Extending biblio.el

Adding new backends

The extensibility mechanism is inspired by the one of company-mode. See the docstring of biblio-backends. Here is the definition of biblio-dblp-backend, for example:

;;;###autoload
(defun biblio-dblp-backend (command &optional arg &rest more)
  "A DBLP backend for biblio.el.
COMMAND, ARG, MORE: See `biblio-backends'."
  (pcase command
    (`name "DBLP")
    (`prompt "DBLP query: ")
    (`url (biblio-dblp--url arg))
    (`parse-buffer (biblio-dblp--parse-search-results))
    (`forward-bibtex (biblio-dblp--forward-bibtex arg (car more)))
    (`register (add-to-list 'biblio-backends #'biblio-dblp-backend))))

;;;###autoload
(add-hook 'biblio-init-hook #'biblio-dblp-backend)

Note how the autoload registers the backend without loading the entire file. When biblio-lookup is called by the user, it will run all functions in biblio-init-hook with 'register as their first argument, and the dblp backend will be added to the list of backends add that point.

Adding new actions

The selection mode menu has an extended action key, x. The only extension at the moment is Dissemin. Extensions are conses (label . function) added to biblio-selection-mode-actions-alist; function is called with the metadata of the current entry when the user selects label (a string) from the list of extensions after pressing x. For example:

(add-to-list 'biblio-selection-mode-actions-alist
             '("Dissemin (find open access copies of this article)" .
               biblio-dissemin--lookup-record))

Alternatively, end-users can add new actions directly to the selection menu by adding custom bindings to the biblio-selection-mode-map keymap. For example, the following snippet defines a custom action that appends a bibtex entry for the current selection to the end of the file defined by my/reference-bibfile:

(defun my/biblio--selection-insert-at-end-of-bibfile-callback (bibtex entry)
  "Add BIBTEX (from ENTRY) to end of a user-specified bibtex file."
  (with-current-buffer (find-file-noselect my/reference-bibfile)
    (goto-char (point-max))
    (insert bibtex))
  (message "Inserted bibtex entry for %S."
	   (biblio--prepare-title (biblio-alist-get 'title entry))))

(defun ans/biblio-selection-insert-end-of-bibfile ()
  "Insert BibTeX of current entry at the end of user-specified bibtex file."
  (interactive)
  (biblio--selection-forward-bibtex #'my/biblio--selection-insert-at-end-of-bibfile-callback))

biblio.el's People

Contributors

ashiklom avatar cpitclaudel avatar qazmonk avatar serycjon avatar ttuegel avatar

Watchers

 avatar

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.