-
Notifications
You must be signed in to change notification settings - Fork 0
/
bibliography-db.lisp
66 lines (52 loc) · 2.65 KB
/
bibliography-db.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
; Simple bibliography and projects database
; mjn, 2017-2022
(ql:quickload :str)
(defvar *publications* '()
"Publications in the database. Each is a possibly multivalued plist
containing BibTeX-style fields plus the pseudo-fields :citation-key,
:publication-type, :category, and optionally one or more :link.")
(defvar *venues* '()
"Recurring Publication venues (journals, workshops, and conferences) that we
know about. Alist of (symbolic-name . string-name).")
(defvar *categories* '()
"Paper categories. Alist of (symbolic-name . string-name).")
(defvar *projects* '()
"Projects. Plist with keys: name, blurb, years, people, funding, papers.")
(defun defpub (citation-key publication-type &rest bibliographic-data &key &allow-other-keys)
"Define a new publication. publication-type is one of: conference, workshop,
demo, collection, journal, preprint, book. citation-key is a BibTeX-style
citation key. The rest of the arguments are keyword parameters specifying the
bibliographic data, such as :author, :title, etc., named as in BibTeX. In
addition, there should be a :category and optionally one or more
:link (text . url)."
(push (list* :citation-key citation-key :publication-type publication-type bibliographic-data) *publications*))
(defun defvenue (symbolic-name string-name)
"Define a new publication venue. The symbolic name can subsequently be used
as the argument to :booktitle or :journal in place of the full name.
For conferences, string-name should be the base name of the conference, such
as 'IEEE Conference on Computational Intelligence and Games', and will be
appropriately expanded."
(push (cons symbolic-name string-name) *venues*))
(defun defcat (symbolic-name string-name)
(push (cons symbolic-name string-name) *categories*))
(defun defproject (name &rest project-data &key &allow-other-keys)
(push (list* :name name project-data) *projects*))
; utility functions
(defun publication-venue (publication)
(let* ((venue (case (getf publication :publication-type)
((conference workshop demo collection) (getf publication :booktitle))
((journal preprint) (getf publication :journal)))))
(if (symbolp venue)
(cdr (assoc venue *venues*))
venue)))
(defun publication-full-venue (publication)
(let ((venue (publication-venue publication)))
(case (getf publication :publication-type)
((conference workshop demo) (str:concat "Proceedings of the " venue))
(t venue))))
(defun publication-authors (publication)
(str:join ", " (getf publication :author)))
(defun getf-all (plist key)
(loop for (k v) on plist by #'cddr
if (string= k key)
collect v))