Initial commit
This commit is contained in:
147
elpa/biblio-20161014.1604/biblio-arxiv.el
Normal file
147
elpa/biblio-20161014.1604/biblio-arxiv.el
Normal file
@@ -0,0 +1,147 @@
|
||||
;;; biblio-arxiv.el --- Lookup and import bibliographic entries from arXiv -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Lookup and download bibliographic records from arXiv using `arxiv-lookup'.
|
||||
;; When a DOI is available, the metadata is fetched from the DOI's issuer;
|
||||
;; otherwise, this package uses arXiv's metadata to generate an entry.
|
||||
;;
|
||||
;; This package uses `biblio-selection-mode', and plugs into the more general
|
||||
;; `biblio' package (which see for more documentation).
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
(require 'biblio-doi)
|
||||
(require 'timezone)
|
||||
|
||||
(defgroup biblio-arxiv nil
|
||||
"arXiv support in biblio.el"
|
||||
:group 'biblio)
|
||||
|
||||
(defcustom biblio-arxiv-bibtex-header "online"
|
||||
"Which header to use for BibTeX entries generated from arXiv metadata."
|
||||
:group 'biblio
|
||||
:type 'string)
|
||||
|
||||
(defun biblio-arxiv--build-bibtex-1 (metadata)
|
||||
"Create an unformated BibTeX record for METADATA."
|
||||
(let-alist metadata
|
||||
(format "@%s{NO_KEY,
|
||||
author = {%s},
|
||||
title = {{%s}},
|
||||
year = {%s},
|
||||
archivePrefix = {arXiv},
|
||||
eprint = {%s},
|
||||
primaryClass = {%s}}"
|
||||
biblio-arxiv-bibtex-header
|
||||
(biblio-join-1 " AND " .authors)
|
||||
.title .year .identifier .category)))
|
||||
|
||||
(defun biblio-arxiv--build-bibtex (metadata)
|
||||
"Create a BibTeX record for METADATA."
|
||||
(let-alist metadata
|
||||
(message "Auto-generating a BibTeX entry for %S." .id)
|
||||
(biblio-format-bibtex (biblio-arxiv--build-bibtex-1 metadata) t)))
|
||||
|
||||
(defun biblio-arxiv--forward-bibtex (metadata forward-to)
|
||||
"Forward BibTeX for arXiv entry METADATA to FORWARD-TO."
|
||||
(let-alist metadata
|
||||
(if (seq-empty-p .doi)
|
||||
(funcall forward-to (biblio-arxiv--build-bibtex metadata))
|
||||
(biblio-doi-forward-bibtex .doi forward-to))))
|
||||
|
||||
(defun biblio-arxiv--format-author (author)
|
||||
"Format AUTHOR for arXiv search results."
|
||||
(when (eq (car-safe author) 'author)
|
||||
(let-alist (cdr author)
|
||||
(biblio-join " "
|
||||
(cadr .name)
|
||||
(biblio-parenthesize (cadr .arxiv:affiliation))))))
|
||||
|
||||
(defun biblio-arxiv--extract-id (id)
|
||||
"Extract identifier from ID, the URL of an arXiv abstract."
|
||||
(replace-regexp-in-string "https?://arxiv.org/abs/" "" id))
|
||||
|
||||
(defun biblio-arxiv--pdf-url (id)
|
||||
"Extract PDF url from ID of an arXiv entry."
|
||||
(when id
|
||||
(concat "http://arxiv.org/pdf/" id)))
|
||||
|
||||
(defun biblio-arxiv--extract-interesting-fields (entry)
|
||||
"Prepare an arXiv search result ENTRY for display."
|
||||
(let-alist entry
|
||||
(let ((id (biblio-arxiv--extract-id (cadr .id))))
|
||||
(list (cons 'doi (cadr .arxiv:doi))
|
||||
(cons 'identifier id)
|
||||
(cons 'year (aref (timezone-parse-date (cadr .published)) 0))
|
||||
(cons 'title (cadr .title))
|
||||
(cons 'authors (seq-map #'biblio-arxiv--format-author entry))
|
||||
(cons 'container (cadr .arxiv:journal_ref))
|
||||
(cons 'category
|
||||
(biblio-alist-get 'term (car .arxiv:primary_category)))
|
||||
(cons 'references (list (cadr .arxiv:doi) id))
|
||||
(cons 'type "eprint")
|
||||
(cons 'url (biblio-alist-get 'href (car .link)))
|
||||
(cons 'direct-url (biblio-arxiv--pdf-url id))))))
|
||||
|
||||
(defun biblio-arxiv--entryp (entry)
|
||||
"Check if ENTRY is an arXiv entry."
|
||||
(eq (car-safe entry) 'entry))
|
||||
|
||||
(defun biblio-arxiv--parse-search-results ()
|
||||
"Extract search results from arXiv response."
|
||||
(biblio-decode-url-buffer 'utf-8)
|
||||
(let-alist (xml-parse-region (point-min) (point-max))
|
||||
(seq-map #'biblio-arxiv--extract-interesting-fields
|
||||
(seq-filter #'biblio-arxiv--entryp .feed))))
|
||||
|
||||
(defun biblio-arxiv--url (query)
|
||||
"Create an arXiv url to look up QUERY."
|
||||
(format "http://export.arxiv.org/api/query?search_query=%s"
|
||||
(url-encode-url query)))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-arxiv-backend (command &optional arg &rest more)
|
||||
"A arXiv backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'."
|
||||
(pcase command
|
||||
(`name "arXiv")
|
||||
(`prompt "arXiv query: ")
|
||||
(`url (biblio-arxiv--url arg))
|
||||
(`parse-buffer (biblio-arxiv--parse-search-results))
|
||||
(`forward-bibtex (biblio-arxiv--forward-bibtex arg (car more)))
|
||||
(`register (add-to-list 'biblio-backends #'biblio-arxiv-backend))))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'biblio-init-hook #'biblio-arxiv-backend)
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-arxiv-lookup (&optional query)
|
||||
"Start an arXiv search for QUERY, prompting if needed."
|
||||
(interactive)
|
||||
(biblio-lookup #'biblio-arxiv-backend query))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'arxiv-lookup 'biblio-arxiv-lookup)
|
||||
|
||||
(provide 'biblio-arxiv)
|
||||
;;; biblio-arxiv.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-arxiv.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-arxiv.elc
Normal file
Binary file not shown.
146
elpa/biblio-20161014.1604/biblio-autoloads.el
Normal file
146
elpa/biblio-20161014.1604/biblio-autoloads.el
Normal file
@@ -0,0 +1,146 @@
|
||||
;;; biblio-autoloads.el --- automatically extracted autoloads
|
||||
;;
|
||||
;;; Code:
|
||||
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
|
||||
|
||||
;;;### (autoloads nil "biblio-arxiv" "biblio-arxiv.el" (23017 2297
|
||||
;;;;;; 812757 96000))
|
||||
;;; Generated autoloads from biblio-arxiv.el
|
||||
|
||||
(autoload 'biblio-arxiv-backend "biblio-arxiv" "\
|
||||
A arXiv backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'.
|
||||
|
||||
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
|
||||
|
||||
(add-hook 'biblio-init-hook #'biblio-arxiv-backend)
|
||||
|
||||
(autoload 'biblio-arxiv-lookup "biblio-arxiv" "\
|
||||
Start an arXiv search for QUERY, prompting if needed.
|
||||
|
||||
\(fn &optional QUERY)" t nil)
|
||||
|
||||
(defalias 'arxiv-lookup 'biblio-arxiv-lookup)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-crossref" "biblio-crossref.el" (23017
|
||||
;;;;;; 2297 832757 134000))
|
||||
;;; Generated autoloads from biblio-crossref.el
|
||||
|
||||
(autoload 'biblio-crossref-backend "biblio-crossref" "\
|
||||
A CrossRef backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'.
|
||||
|
||||
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
|
||||
|
||||
(add-hook 'biblio-init-hook #'biblio-crossref-backend)
|
||||
|
||||
(autoload 'biblio-crossref-lookup "biblio-crossref" "\
|
||||
Start a CrossRef search for QUERY, prompting if needed.
|
||||
|
||||
\(fn &optional QUERY)" t nil)
|
||||
|
||||
(defalias 'crossref-lookup 'biblio-crossref-lookup)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-dblp" "biblio-dblp.el" (23017 2297
|
||||
;;;;;; 842757 144000))
|
||||
;;; Generated autoloads from biblio-dblp.el
|
||||
|
||||
(autoload 'biblio-dblp-backend "biblio-dblp" "\
|
||||
A DBLP backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'.
|
||||
|
||||
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
|
||||
|
||||
(add-hook 'biblio-init-hook #'biblio-dblp-backend)
|
||||
|
||||
(autoload 'biblio-dblp-lookup "biblio-dblp" "\
|
||||
Start a DBLP search for QUERY, prompting if needed.
|
||||
|
||||
\(fn &optional QUERY)" t nil)
|
||||
|
||||
(defalias 'dblp-lookup 'biblio-dblp-lookup)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-dissemin" "biblio-dissemin.el" (23017
|
||||
;;;;;; 2297 872757 184000))
|
||||
;;; Generated autoloads from biblio-dissemin.el
|
||||
|
||||
(autoload 'biblio-dissemin-lookup "biblio-dissemin" "\
|
||||
Retrieve a record by DOI from Dissemin, and display it.
|
||||
Interactively, or if CLEANUP is non-nil, pass DOI through
|
||||
`biblio-cleanup-doi'.
|
||||
|
||||
\(fn DOI &optional CLEANUP)" t nil)
|
||||
|
||||
(defalias 'dissemin-lookup 'biblio-dissemin-lookup)
|
||||
|
||||
(autoload 'biblio-dissemin--register-action "biblio-dissemin" "\
|
||||
Add Dissemin to list of `biblio-selection-mode' actions.
|
||||
|
||||
\(fn)" nil nil)
|
||||
|
||||
(add-hook 'biblio-selection-mode-hook #'biblio-dissemin--register-action)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-doi" "biblio-doi.el" (23017 2297 822757
|
||||
;;;;;; 113000))
|
||||
;;; Generated autoloads from biblio-doi.el
|
||||
|
||||
(autoload 'doi-insert-bibtex "biblio-doi" "\
|
||||
Insert BibTeX entry matching DOI.
|
||||
|
||||
\(fn DOI)" t nil)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-download" "biblio-download.el" (23017
|
||||
;;;;;; 2297 852757 159000))
|
||||
;;; Generated autoloads from biblio-download.el
|
||||
|
||||
(autoload 'biblio-download--register-action "biblio-download" "\
|
||||
Add download to list of `biblio-selection-mode' actions.
|
||||
|
||||
\(fn)" nil nil)
|
||||
|
||||
(add-hook 'biblio-selection-mode-hook #'biblio-download--register-action)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil "biblio-hal" "biblio-hal.el" (23017 2297 822757
|
||||
;;;;;; 113000))
|
||||
;;; Generated autoloads from biblio-hal.el
|
||||
|
||||
(autoload 'biblio-hal-backend "biblio-hal" "\
|
||||
A HAL backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'.
|
||||
|
||||
\(fn COMMAND &optional ARG &rest MORE)" nil nil)
|
||||
|
||||
(add-hook 'biblio-init-hook #'biblio-hal-backend)
|
||||
|
||||
(autoload 'biblio-hal-lookup "biblio-hal" "\
|
||||
Start a HAL search for QUERY, prompting if needed.
|
||||
|
||||
\(fn &optional QUERY)" t nil)
|
||||
|
||||
(defalias 'hal-lookup 'biblio-hal-lookup)
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil nil ("biblio-pkg.el" "biblio.el") (23017 2297
|
||||
;;;;;; 862757 177000))
|
||||
|
||||
;;;***
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; End:
|
||||
;;; biblio-autoloads.el ends here
|
||||
99
elpa/biblio-20161014.1604/biblio-crossref.el
Normal file
99
elpa/biblio-20161014.1604/biblio-crossref.el
Normal file
@@ -0,0 +1,99 @@
|
||||
;;; biblio-crossref.el --- Lookup and import bibliographic entries from CrossRef -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Lookup and download bibliographic records from CrossRef (a very nicely
|
||||
;; curated metadata engine) using `crossref-lookup'.
|
||||
;;
|
||||
;; This package uses `biblio-selection-mode', and plugs into the more general
|
||||
;; `biblio' package (which see for more documentation).
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
(require 'biblio-doi)
|
||||
|
||||
(defun biblio-crossref--forward-bibtex (metadata forward-to)
|
||||
"Forward BibTeX for CrossRef entry METADATA to FORWARD-TO."
|
||||
(biblio-doi-forward-bibtex (biblio-alist-get 'doi metadata) forward-to))
|
||||
|
||||
(defun biblio-crossref--format-affiliation (affiliation)
|
||||
"Format AFFILIATION for CrossRef search results."
|
||||
(mapconcat (apply-partially #'biblio-alist-get 'name) affiliation ", "))
|
||||
|
||||
(defun biblio-crossref--format-author (author)
|
||||
"Format AUTHOR for CrossRef search results."
|
||||
(let-alist author
|
||||
(biblio-join " "
|
||||
.given .family (biblio-parenthesize (biblio-crossref--format-affiliation .affiliation)))))
|
||||
|
||||
(defun biblio-crossref--extract-interesting-fields (item)
|
||||
"Prepare a CrossRef search result ITEM for display."
|
||||
(let-alist item
|
||||
(list (cons 'doi .DOI)
|
||||
(cons 'title (biblio-join " "
|
||||
(biblio-join-1 ", " .title)
|
||||
(biblio-parenthesize (biblio-join-1 ", " .subtitle))))
|
||||
(cons 'authors (seq-map #'biblio-crossref--format-author .author))
|
||||
(cons 'publisher .publisher)
|
||||
(cons 'container .container-title)
|
||||
(cons 'references (seq-concatenate 'list (list .DOI) .isbn))
|
||||
(cons 'type .type)
|
||||
(cons 'url .URL))))
|
||||
|
||||
(defun biblio-crossref--parse-search-results ()
|
||||
"Extract search results from CrossRef response."
|
||||
(biblio-decode-url-buffer 'utf-8)
|
||||
(let-alist (json-read)
|
||||
(unless (string= .status "ok")
|
||||
(display-warning 'biblio-crossref "CrossRef query failed"))
|
||||
(seq-map #'biblio-crossref--extract-interesting-fields .message.items)))
|
||||
|
||||
(defun biblio-crossref--url (query)
|
||||
"Create a CrossRef url to look up QUERY."
|
||||
(format "http://api.crossref.org/works?query=%s" (url-encode-url query)))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-crossref-backend (command &optional arg &rest more)
|
||||
"A CrossRef backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'."
|
||||
(pcase command
|
||||
(`name "CrossRef")
|
||||
(`prompt "CrossRef query: ")
|
||||
(`url (biblio-crossref--url arg))
|
||||
(`parse-buffer (biblio-crossref--parse-search-results))
|
||||
(`forward-bibtex (biblio-crossref--forward-bibtex arg (car more)))
|
||||
(`register (add-to-list 'biblio-backends #'biblio-crossref-backend))))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'biblio-init-hook #'biblio-crossref-backend)
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-crossref-lookup (&optional query)
|
||||
"Start a CrossRef search for QUERY, prompting if needed."
|
||||
(interactive)
|
||||
(biblio-lookup #'biblio-crossref-backend query))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'crossref-lookup 'biblio-crossref-lookup)
|
||||
|
||||
(provide 'biblio-crossref)
|
||||
;;; biblio-crossref.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-crossref.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-crossref.elc
Normal file
Binary file not shown.
95
elpa/biblio-20161014.1604/biblio-dblp.el
Normal file
95
elpa/biblio-20161014.1604/biblio-dblp.el
Normal file
@@ -0,0 +1,95 @@
|
||||
;;; biblio-dblp.el --- Lookup and import bibliographic entries from DBLP -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Lookup and download bibliographic records from DBLP (a great source of
|
||||
;; references for Computer Science papers) using `dblp-lookup'.
|
||||
;;
|
||||
;; This package uses `biblio-selection-mode', and plugs into the more general
|
||||
;; `biblio' package (which see for more documentation).
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
|
||||
(defun biblio-dblp--forward-bibtex (metadata forward-to)
|
||||
"Forward BibTeX for DBLP entry METADATA to FORWARD-TO."
|
||||
(let* ((source-url (biblio-alist-get 'url metadata))
|
||||
(url (replace-regexp-in-string "/rec/" "/rec/bib2/" source-url t t)))
|
||||
(biblio-url-retrieve url (biblio-generic-url-callback
|
||||
(lambda () ;; No allowed errors, so no arguments
|
||||
"Parse DBLP BibTeX results."
|
||||
(funcall forward-to
|
||||
(biblio-format-bibtex
|
||||
(biblio-response-as-utf-8))))))))
|
||||
|
||||
(defun biblio-dblp--extract-interesting-fields (item)
|
||||
"Prepare a DBLP search result ITEM for display."
|
||||
(let-alist (biblio-alist-get 'info item)
|
||||
(list (cons 'title (cadr .title))
|
||||
(cons 'authors (seq-map #'cl-caddr (cdr .authors)))
|
||||
(cons 'container (cadr .venue))
|
||||
(cons 'references nil)
|
||||
(cons 'type (cadr .type))
|
||||
(cons 'url (cadr .url)))))
|
||||
|
||||
(defun biblio-dblp--hitp (item)
|
||||
"Check if ITEM is a DBLP hit."
|
||||
(eq (car-safe item) 'hit))
|
||||
|
||||
(defun biblio-dblp--parse-search-results ()
|
||||
"Extract search results from DBLP response."
|
||||
(biblio-decode-url-buffer 'utf-8)
|
||||
(let-alist (car (xml-parse-region (point-min) (point-max)))
|
||||
(unless (string= (cadr .status) "OK")
|
||||
(display-warning 'biblio-dblp "DBLP query failed"))
|
||||
(seq-map #'biblio-dblp--extract-interesting-fields (seq-filter #'biblio-dblp--hitp .hits))))
|
||||
|
||||
(defun biblio-dblp--url (query)
|
||||
"Create a DBLP url to look up QUERY."
|
||||
(format "http://dblp.uni-trier.de/search/publ/api?q=%s&format=xml" (url-encode-url query)))
|
||||
|
||||
;;;###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)
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-dblp-lookup (&optional query)
|
||||
"Start a DBLP search for QUERY, prompting if needed."
|
||||
(interactive)
|
||||
(biblio-lookup #'biblio-dblp-backend query))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'dblp-lookup 'biblio-dblp-lookup)
|
||||
|
||||
(provide 'biblio-dblp)
|
||||
;;; biblio-dblp.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-dblp.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-dblp.elc
Normal file
Binary file not shown.
157
elpa/biblio-20161014.1604/biblio-dissemin.el
Normal file
157
elpa/biblio-20161014.1604/biblio-dissemin.el
Normal file
@@ -0,0 +1,157 @@
|
||||
;;; biblio-dissemin.el --- Lookup bibliographic information and open access records from Dissemin -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Lookup publication records on Dissemin by DOI using `dissemin-lookup'.
|
||||
;;
|
||||
;; This package also plugs into `biblio-selection-mode' by adding an entry to
|
||||
;; the extended actions menu (`x') to quickly locate the Dissemin record of
|
||||
;; e.g. a CrossRef entry.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
|
||||
(defun biblio-dissemin--format-author (author)
|
||||
"Format a Dissemin AUTHOR entry."
|
||||
(let-alist author
|
||||
(format "%s %s" .name.first .name.last)))
|
||||
|
||||
(defun biblio-dissemin--insert-button (url prefix)
|
||||
"Insert a button pointing to URL, prefixed by PREFIX."
|
||||
(unless (seq-empty-p url)
|
||||
(insert "\n" prefix)
|
||||
(insert (biblio-make-url-button url))))
|
||||
|
||||
(defun biblio-dissemin--insert-record (record)
|
||||
"Insert a Dissemin RECORD entry into the current buffer."
|
||||
(let-alist record
|
||||
(insert "\n\n")
|
||||
(biblio-with-fontification 'font-lock-preprocessor-face
|
||||
(biblio-insert-with-prefix ">> " .identifier))
|
||||
(biblio-dissemin--insert-button .pdf_url " ")
|
||||
(unless (string= .pdf_url .splash_url)
|
||||
(biblio-dissemin--insert-button .splash_url " "))
|
||||
(unless (seq-empty-p .abstract)
|
||||
(insert "\n")
|
||||
;; (biblio-with-fontification 'font-lock-doc-face
|
||||
(biblio-insert-with-prefix " " .abstract))))
|
||||
|
||||
(defun biblio-dissemin--translate-classification (classification)
|
||||
"Translate Dissemin's CLASSIFICATION for display."
|
||||
(pcase classification
|
||||
(`"OA" "Available from the publisher")
|
||||
(`"OK" "Some versions may be shared by the author")
|
||||
(`"UNK" "Sharing policy is unclear")
|
||||
(`"CLOSED" "Subject to a restrictive sharing policy")
|
||||
(_ classification)))
|
||||
|
||||
(defun biblio-dissemin--suggest-upload (doi)
|
||||
"Insert a link to Dissemin's upload page for DOI."
|
||||
(insert "\n\nDid you write this paper? ")
|
||||
(biblio-with-fontification '(:weight bold)
|
||||
(insert
|
||||
(biblio-make-url-button (format "http://dissem.in/%s" doi) "upload it")))
|
||||
(insert "!\n"))
|
||||
|
||||
(defun biblio-dissemin--pretty-print (paper doi)
|
||||
"Pretty-print a Dissemin PAPER entry (with DOI) to current buffer."
|
||||
(let-alist paper
|
||||
(biblio-insert-result
|
||||
(list (cons 'title .title)
|
||||
(cons 'authors (seq-map #'biblio-dissemin--format-author .authors))
|
||||
(cons 'open-access-status
|
||||
(biblio-dissemin--translate-classification .classification)))
|
||||
t)
|
||||
(biblio-dissemin--insert-button .pdf_url " ")
|
||||
(if (seq-empty-p .records)
|
||||
(progn (insert "\n\n(no records)")
|
||||
(when (member .classification '("OA" "OK"))
|
||||
(biblio-dissemin--suggest-upload doi)))
|
||||
(seq-do #'biblio-dissemin--insert-record .records))
|
||||
(goto-char (point-min))))
|
||||
|
||||
(defun biblio-dissemin--print-results (paper doi)
|
||||
"Create a buffer for Dissemin, and print PAPER (with DOI) into it."
|
||||
(with-current-buffer (biblio-dissemin--make-buffer)
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(help-mode)
|
||||
(visual-line-mode)
|
||||
(biblio-dissemin--pretty-print paper doi))
|
||||
(setq buffer-read-only t)
|
||||
(pop-to-buffer (current-buffer))))
|
||||
|
||||
(defun biblio-dissemin--make-buffer ()
|
||||
"Create a buffer to display Dissemin results in."
|
||||
(get-buffer-create "*Dissemin search results*"))
|
||||
|
||||
(defun biblio-dissemin--parse-buffer ()
|
||||
"Extract search results from DBLP response."
|
||||
(biblio-decode-url-buffer 'utf-8)
|
||||
(let-alist (json-read)
|
||||
(unless (string= .status "ok")
|
||||
(display-warning 'biblio-dissemin "Dissemin query failed"))
|
||||
.paper))
|
||||
|
||||
(defun biblio-dissemin--url (doi)
|
||||
"Create a DBLP url to look up DOI."
|
||||
(format "http://dissem.in/api/%s" (url-encode-url doi)))
|
||||
|
||||
(defun biblio-dissemin--callback (doi)
|
||||
"Generate a callback to parse Dissemin results for DOI."
|
||||
(lambda () ;; no allowed errors, so no arguments
|
||||
(biblio-dissemin--print-results (biblio-dissemin--parse-buffer) doi)))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-dissemin-lookup (doi &optional cleanup)
|
||||
"Retrieve a record by DOI from Dissemin, and display it.
|
||||
Interactively, or if CLEANUP is non-nil, pass DOI through
|
||||
`biblio-cleanup-doi'."
|
||||
(interactive "MDOI: \nd")
|
||||
(when cleanup
|
||||
(setq doi (biblio-cleanup-doi doi)))
|
||||
(let ((buf (biblio-dissemin--make-buffer)))
|
||||
(biblio-url-retrieve (biblio-dissemin--url doi)
|
||||
(biblio-generic-url-callback (biblio-dissemin--callback doi)))
|
||||
buf))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'dissemin-lookup 'biblio-dissemin-lookup)
|
||||
|
||||
(defun biblio-dissemin--lookup-record (record)
|
||||
"Retrieve a RECORD from Dissemin, and display it.
|
||||
RECORD is a formatted record as expected by `biblio-insert-result'."
|
||||
(let-alist record
|
||||
(if .doi (dissemin-lookup .doi)
|
||||
(user-error "Dissemin needs a DOI, but this record does not contain one"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-dissemin--register-action ()
|
||||
"Add Dissemin to list of `biblio-selection-mode' actions."
|
||||
(add-to-list 'biblio-selection-mode-actions-alist
|
||||
'("Dissemin (find open access copies of this article)" . biblio-dissemin--lookup-record)))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'biblio-selection-mode-hook #'biblio-dissemin--register-action)
|
||||
|
||||
(provide 'biblio-dissemin)
|
||||
;;; biblio-dissemin.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-dissemin.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-dissemin.elc
Normal file
Binary file not shown.
123
elpa/biblio-20161014.1604/biblio-doi.el
Normal file
123
elpa/biblio-20161014.1604/biblio-doi.el
Normal file
@@ -0,0 +1,123 @@
|
||||
;;; biblio-doi.el --- Retrieve BibTeX entries by DOI -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Retrieve and insert BibTeX records by DOI using `doi-insert-bibtex'.
|
||||
;; Information is retrieved from DOI issuing sites of each DOI using the
|
||||
;; “application/x-bibtex” and “text/bibliography” request types, falling back to
|
||||
;; CrossCite if unavailable.
|
||||
;;
|
||||
;; This package integrates with `biblio-selection-mode', and is part of the more
|
||||
;; general `biblio' package (which see for more documentation).
|
||||
|
||||
(require 'biblio-core)
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defun biblio-doi--dx-url (doi)
|
||||
"Create a doi.org url for DOI."
|
||||
(format "http://doi.org/%s" doi))
|
||||
|
||||
(defun biblio-doi--crosscite-url (doi)
|
||||
"Create a crosscite URL to use as a fallback for DOI.
|
||||
Not all content providers provide BibTeX formatted entries, so
|
||||
instead of failing reroute the request through crosscite, which
|
||||
requests a generic format and crates the BibTeX on its own."
|
||||
(format "http://crosscite.org/citeproc/format?doi=%s&style=bibtex&lang=en-US" doi))
|
||||
|
||||
(defconst biblio-doi--dx-mime-accept
|
||||
;; “Accept:” header; Zenodo recognize x-bibtex but not text/bibliography
|
||||
"text/bibliography;style=bibtex, application/x-bibtex")
|
||||
|
||||
(defun biblio-doi--set-mime-accept ()
|
||||
"Set `url-mime-accept-string' before contacting the DOI server."
|
||||
;; Ugly: let-binding or buffer-locally setting `url-mime-accept-string' does
|
||||
;; not work, because `url-http-create-request' can be called from a
|
||||
;; sentinel, or from an entirely new buffer (after a redirection).
|
||||
(setq url-mime-accept-string biblio-doi--dx-mime-accept))
|
||||
|
||||
(defun biblio-doi--restore-mime-accept ()
|
||||
"Restore `url-mime-accept-string'."
|
||||
(kill-local-variable 'url-mime-accept-string)
|
||||
(setq-default url-mime-accept-string nil))
|
||||
|
||||
(defun biblio-doi--insert (bibtex buffer)
|
||||
"Insert formatted BIBTEX into BUFFER."
|
||||
(with-current-buffer buffer
|
||||
(insert bibtex "\n\n")))
|
||||
|
||||
(defun biblio-doi--generic-url-callback-1 (errors forward-to)
|
||||
"Helper function for `biblio-doi--generic-url-callback'.
|
||||
ERRORS, FORWARD-TO: see there."
|
||||
(funcall forward-to
|
||||
(unless errors
|
||||
(biblio-format-bibtex (biblio-response-as-utf-8)))))
|
||||
|
||||
(defun biblio-doi--generic-url-callback (cleanup-fn forward-to)
|
||||
"Make an URL-ready callback.
|
||||
Call CLEANUP-FN in any case, and FORWARD-TO with BibTeX source
|
||||
or nil depending on whether an error occured. If error 406
|
||||
occurs, forward nil; otherwise, signal the error. This is
|
||||
essentially a thin wrapper around `biblio-generic-url-callback'."
|
||||
(biblio-generic-url-callback
|
||||
(lambda (&optional errors)
|
||||
"Handle response from BibTeX server."
|
||||
(biblio-doi--generic-url-callback-1 errors forward-to))
|
||||
cleanup-fn '(http . 406)))
|
||||
|
||||
(defun biblio-doi--crosscite-callback (forward-to)
|
||||
"Generate a handler for response of CrossCite server.
|
||||
FORWARD-TO is the callback to call with the results of the search."
|
||||
(biblio-doi--generic-url-callback #'ignore forward-to))
|
||||
|
||||
(defun biblio-doi--forward-bibtex-crosscite (doi forward-to)
|
||||
"Forward BibTeX entry for DOI from CrossCite to FORWARD-TO."
|
||||
(biblio-url-retrieve (biblio-doi--crosscite-url doi) (biblio-doi--crosscite-callback forward-to)))
|
||||
|
||||
(defun biblio-doi--dx-callback (forward-to)
|
||||
"Generate a handler for response of DX server.
|
||||
FORWARD-TO is the callback to call with the results of the search."
|
||||
(biblio-doi--generic-url-callback #'biblio-doi--restore-mime-accept forward-to))
|
||||
|
||||
(defun biblio-doi--forward-bibtex-dx (doi forward-to)
|
||||
"Forward BibTeX entry for DOI from doi.org to FORWARD-TO."
|
||||
(biblio-doi--set-mime-accept)
|
||||
(biblio-url-retrieve (biblio-doi--dx-url doi) (biblio-doi--dx-callback forward-to)))
|
||||
|
||||
(defun biblio-doi-forward-bibtex (doi forward-to)
|
||||
"Pass BibTeX entry for DOI to FORWARD-TO."
|
||||
(biblio-doi--forward-bibtex-dx
|
||||
doi (lambda (result)
|
||||
(if result (funcall forward-to result)
|
||||
(biblio-doi--forward-bibtex-crosscite doi forward-to)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doi-insert-bibtex (doi)
|
||||
"Insert BibTeX entry matching DOI."
|
||||
(interactive "MDOI: ")
|
||||
(let ((target-buffer (current-buffer)))
|
||||
(biblio-doi-forward-bibtex
|
||||
(biblio-cleanup-doi doi)
|
||||
(lambda (result) (biblio-doi--insert result target-buffer)))))
|
||||
|
||||
(provide 'biblio-doi)
|
||||
;;; biblio-doi.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-doi.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-doi.elc
Normal file
Binary file not shown.
58
elpa/biblio-20161014.1604/biblio-download.el
Normal file
58
elpa/biblio-20161014.1604/biblio-download.el
Normal file
@@ -0,0 +1,58 @@
|
||||
;;; biblio-download.el --- Lookup bibliographic information and open access records from Dissemin -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Download scientific papers directly from Emacs.
|
||||
;;
|
||||
;; This package plugs into `biblio-selection-mode' by adding an entry to the
|
||||
;; extended actions menu (`x').
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
|
||||
(defcustom biblio-download-directory nil
|
||||
"Where to put downloaded papers."
|
||||
:group 'biblio
|
||||
:type 'directory)
|
||||
|
||||
(defun biblio-download--action (record)
|
||||
"Retrieve a RECORD from Dissemin, and display it.
|
||||
RECORD is a formatted record as expected by `biblio-insert-result'."
|
||||
(let-alist record
|
||||
(if .direct-url
|
||||
(let* ((fname (concat .identifier ".pdf"))
|
||||
(target (read-file-name "Save as (see also biblio-download-directory): "
|
||||
biblio-download-directory fname nil fname)))
|
||||
(url-copy-file .direct-url (expand-file-name target biblio-download-directory)))
|
||||
(user-error "This record does not contain a direct URL (try arXiv or HAL)"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-download--register-action ()
|
||||
"Add download to list of `biblio-selection-mode' actions."
|
||||
(add-to-list 'biblio-selection-mode-actions-alist
|
||||
'("Download this article" . biblio-download--action)))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'biblio-selection-mode-hook #'biblio-download--register-action)
|
||||
|
||||
(provide 'biblio-download)
|
||||
;;; biblio-download.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-download.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-download.elc
Normal file
Binary file not shown.
105
elpa/biblio-20161014.1604/biblio-hal.el
Normal file
105
elpa/biblio-20161014.1604/biblio-hal.el
Normal file
@@ -0,0 +1,105 @@
|
||||
;;; biblio-hal.el --- Lookup and import bibliographic entries from HAL (archives ouvertes) -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Lookup and download bibliographic records from HAL using `hal-lookup'.
|
||||
;;
|
||||
;; This package uses `biblio-selection-mode', and plugs into the more general
|
||||
;; `biblio' package (which see for more documentation).
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
|
||||
(defun biblio-hal--forward-bibtex (metadata forward-to)
|
||||
"Forward BibTeX for HAL entry METADATA to FORWARD-TO."
|
||||
(funcall forward-to (biblio-alist-get 'bibtex metadata)))
|
||||
|
||||
;; (defun biblio-hal--format-author (author)
|
||||
;; "Format AUTHOR for HAL search results."
|
||||
;; (pcase author
|
||||
;; (`(,author . ,affiliation)
|
||||
;; (biblio-join " " author (biblio-parenthesize affiliation)))))
|
||||
|
||||
(defun biblio-hal--extract-interesting-fields (item)
|
||||
"Prepare a HAL search result ITEM for display."
|
||||
(let-alist item
|
||||
(list (cons 'doi .doiId_s)
|
||||
(cons 'bibtex .label_bibtex)
|
||||
(cons 'title (biblio-join " "
|
||||
(biblio-join-1 ", " .title_s)
|
||||
(biblio-parenthesize
|
||||
(biblio-join-1 ", " .subtitle_s))))
|
||||
(cons 'authors .authFullName_s)
|
||||
;; Too many institutions? (biblio-parenthesize (biblio-join-1 ", " .structName_s))
|
||||
(cons 'publisher .journalPublisher_s)
|
||||
(cons 'container .journalTitle_s)
|
||||
(cons 'references (biblio-remove-empty
|
||||
(list .doiId_s .halId_s .arxivId_s)))
|
||||
(cons 'type .submitType_s)
|
||||
(cons 'url .uri_s)
|
||||
(cons 'direct-url (car (append .files_s nil))))))
|
||||
|
||||
(defun biblio-hal--parse-search-results ()
|
||||
"Extract search results from HAL response."
|
||||
(biblio-decode-url-buffer 'utf-8)
|
||||
(let-alist (json-read)
|
||||
(unless .response
|
||||
(display-warning 'biblio-hal "HAL query failed"))
|
||||
(seq-map #'biblio-hal--extract-interesting-fields .response.docs)))
|
||||
|
||||
(defun biblio-hal--url (query)
|
||||
"Create a HAL url to look up QUERY."
|
||||
(format "https://api.archives-ouvertes.fr/search/?q=%s&wt=%s&fl=%s"
|
||||
(url-encode-url query) "json"
|
||||
(biblio-join "," ;; Use ‘*’ to show all fields
|
||||
"arxivId_s" "halId_s" "doiId_s" ;; "journalIssn_s"
|
||||
"title_s" "subtitle_s" "authFullName_s" "structName_s"
|
||||
"journalPublisher_s" "submitType_s" ;; "abstract_s"
|
||||
;; "journalTitle_s" "volume_s" "issue_s" "page_s" "writingDate_s"
|
||||
"label_bibtex" "files_s" "uri_s")))
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-hal-backend (command &optional arg &rest more)
|
||||
"A HAL backend for biblio.el.
|
||||
COMMAND, ARG, MORE: See `biblio-backends'."
|
||||
(pcase command
|
||||
(`name "HAL")
|
||||
(`prompt "HAL (archives ouvertes) query: ")
|
||||
(`url (biblio-hal--url arg))
|
||||
(`parse-buffer (biblio-hal--parse-search-results))
|
||||
(`forward-bibtex (biblio-hal--forward-bibtex arg (car more)))
|
||||
(`register (add-to-list 'biblio-backends #'biblio-hal-backend))))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'biblio-init-hook #'biblio-hal-backend)
|
||||
|
||||
;;;###autoload
|
||||
(defun biblio-hal-lookup (&optional query)
|
||||
"Start a HAL search for QUERY, prompting if needed."
|
||||
(interactive)
|
||||
(biblio-lookup #'biblio-hal-backend query))
|
||||
|
||||
;;;###autoload
|
||||
(defalias 'hal-lookup 'biblio-hal-lookup)
|
||||
|
||||
(provide 'biblio-hal)
|
||||
;;; biblio-hal.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio-hal.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio-hal.elc
Normal file
Binary file not shown.
6
elpa/biblio-20161014.1604/biblio-pkg.el
Normal file
6
elpa/biblio-20161014.1604/biblio-pkg.el
Normal file
@@ -0,0 +1,6 @@
|
||||
(define-package "biblio" "20161014.1604" "Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org"
|
||||
'((emacs "24.3")
|
||||
(biblio-core "0.2")))
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
96
elpa/biblio-20161014.1604/biblio.el
Normal file
96
elpa/biblio-20161014.1604/biblio.el
Normal file
@@ -0,0 +1,96 @@
|
||||
;;; biblio.el --- Browse and import bibliographic references from CrossRef, arXiv, DBLP, HAL, Dissemin, and doi.org -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2016 Clément Pit-Claudel
|
||||
|
||||
;; Author: Clément Pit-Claudel <clement.pitclaudel@live.com>
|
||||
;; Version: 0.2
|
||||
;; Package-Requires: ((emacs "24.3") (biblio-core "0.2"))
|
||||
;; Keywords: bib, tex, convenience, hypermedia
|
||||
;; URL: http://github.com/cpitclaudel/biblio.el
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;; # biblio.el: An extensible Emacs package for browsing and fetching references
|
||||
;;
|
||||
;; 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.
|
||||
;;
|
||||
;; ## Supported sources:
|
||||
;;
|
||||
;; * ‘CrossRef’, an exhaustive academic search engine (recommended)
|
||||
;; * ‘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
|
||||
;; * ‘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 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
|
||||
;;
|
||||
;; Most of 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 http://doi.org/10.1145/2676726.2677006
|
||||
;; 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
|
||||
;; <http://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: http://hdl.handle.net/1721.1/5736).
|
||||
;;
|
||||
;; See http://github.com/cpitclaudel/biblio.el for more information, including
|
||||
;; documentation on extending this framework.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'biblio-core)
|
||||
(require 'biblio-doi)
|
||||
(require 'biblio-arxiv)
|
||||
(require 'biblio-crossref)
|
||||
(require 'biblio-dblp)
|
||||
(require 'biblio-hal)
|
||||
(require 'biblio-dissemin)
|
||||
(require 'biblio-download)
|
||||
|
||||
(provide 'biblio)
|
||||
;;; biblio.el ends here
|
||||
BIN
elpa/biblio-20161014.1604/biblio.elc
Normal file
BIN
elpa/biblio-20161014.1604/biblio.elc
Normal file
Binary file not shown.
Reference in New Issue
Block a user