pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
"Alist mapping biblatex item types to CSL item types.")
|
||||
|
||||
(defun citeproc-blt--to-csl-type (type entrysubtype)
|
||||
"Return the csltype corresponding to blt TYPE and ENTRYSUBTYPE."
|
||||
"Return the CSL type corresponding to blt TYPE and ENTRYSUBTYPE."
|
||||
(pcase type
|
||||
((or 'article 'periodical 'supperiodical)
|
||||
(pcase entrysubtype
|
||||
@@ -159,7 +159,7 @@
|
||||
(version . version)
|
||||
(volumes . number-of-volumes)
|
||||
(pagetotal . number-of-pages)
|
||||
(chapter-number . chapter)
|
||||
(chapter . chapter-number)
|
||||
(pages . page)
|
||||
;; publisher
|
||||
(origpublisher . original-publisher)
|
||||
@@ -195,24 +195,22 @@ Only those fields are mapped that do not require further processing.")
|
||||
Only those fields are mapped that do not require further
|
||||
processing.")
|
||||
|
||||
(defun citeproc-blt--parse-date (d)
|
||||
"Parse single biblatex date-time expression D."
|
||||
;; Remove time part, if present.
|
||||
(-when-let (time-sep-pos (cl-position ?T d))
|
||||
(setq d (substring d 0 time-sep-pos)))
|
||||
(--map (let ((converted (string-to-number it)))
|
||||
(if (not (= converted 0))
|
||||
converted
|
||||
(error "Couldn't parse '%s' as a date" d)))
|
||||
(split-string d "-")))
|
||||
|
||||
(defun citeproc-blt--to-csl-date (d)
|
||||
"Return a CSL version of the biblatex date field given by D."
|
||||
(let* ((interval-strings (split-string d "/"))
|
||||
(interval-date-parts
|
||||
(mapcar (lambda (x)
|
||||
(let* ((parsed (parse-time-string x))
|
||||
;; TODO: use more elegant accessors for the parsed
|
||||
;; time while keeping Emacs 26 compatibility.
|
||||
(year (elt parsed 5))
|
||||
(month (elt parsed 4))
|
||||
(day (elt parsed 3))
|
||||
date)
|
||||
(when year
|
||||
(when day (push day date))
|
||||
(when month (push month date))
|
||||
(push year date)
|
||||
date)))
|
||||
interval-strings)))
|
||||
(mapcar #'citeproc-blt--parse-date interval-strings)))
|
||||
(list (cons 'date-parts interval-date-parts))))
|
||||
|
||||
(defun citeproc-blt--get-standard (v b &optional with-nocase)
|
||||
@@ -237,8 +235,7 @@ V is undefined in B."
|
||||
"Return the CSL-normalized value of a title string S.
|
||||
If optional WITH-NOCASE is non-nil then convert BibTeX no-case
|
||||
brackets to the corresponding CSL XML spans, and if optional
|
||||
SENT-CASE is non-nil the convert to sentence-case. Return nil if
|
||||
V is undefined in B."
|
||||
SENT-CASE is non-nil the convert to sentence-case."
|
||||
(if sent-case
|
||||
(citeproc-s-sentence-case-title (citeproc-bt--to-csl s t) (not with-nocase))
|
||||
(citeproc-bt--to-csl s with-nocase)))
|
||||
@@ -348,7 +345,10 @@ biblatex variables in B."
|
||||
(push (cons 'genre (or (assoc-default ~reftype citeproc-blt-reftype-to-genre)
|
||||
(citeproc-bt--to-csl ~reftype)))
|
||||
result))
|
||||
;; We store the original bib(la)tex type for filtering purposes.
|
||||
(push (cons 'blt-type (symbol-name ~type)) result)
|
||||
;; names
|
||||
;; TODO: handle editorb and editorc as well...
|
||||
(when-let ((~editortype (alist-get 'editortype b))
|
||||
(~editor (alist-get 'editor b))
|
||||
(csl-var (assoc-default ~editortype
|
||||
@@ -361,7 +361,7 @@ biblatex variables in B."
|
||||
citeproc-blt-editortype-to-csl-name-alist)))
|
||||
(push (cons csl-var (citeproc-bt--to-csl-names ~editora))
|
||||
result))
|
||||
;; TODO: do this for editorb and editorc as well... dates
|
||||
;; dates
|
||||
(-when-let (issued (-if-let (~issued (alist-get 'date b))
|
||||
(citeproc-blt--to-csl-date ~issued)
|
||||
(-when-let (~year (alist-get 'year b))
|
||||
|
||||
Reference in New Issue
Block a user