diff options
author | Ihor Radchenko <yantar92@posteo.net> | 2024-01-29 12:24:20 +0100 |
---|---|---|
committer | Ihor Radchenko <yantar92@posteo.net> | 2024-01-29 12:24:20 +0100 |
commit | 0d5abf4a2e214a03606ca4b43adec5be3066f363 (patch) | |
tree | 47c355d2b2863861057b3b769ed5e9b60a5f2649 | |
parent | e114f7dfc7732a61105d071068b6126844918f60 (diff) |
Comment out `obe-meta-to-json'. It is not usable
* lisp/org-bibtex-extras.el (obe-meta-to-json): Comment out the
function and add FIXME. It cannot run.
-rw-r--r-- | lisp/org-bibtex-extras.el | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/lisp/org-bibtex-extras.el b/lisp/org-bibtex-extras.el index 6e98c7f..8e027fa 100644 --- a/lisp/org-bibtex-extras.el +++ b/lisp/org-bibtex-extras.el @@ -104,42 +104,43 @@ For example, to point to your `obe-bibtex-file' use the following. (mapcar #'org-trim (split-string (match-string 1) ",")) ", ")))))) -(defun obe-meta-to-json (meta &optional fields) - "Turn a list of META data from citations into a string of json." - (let ((counter 1) nodes links) - (cl-flet ((id (it) (cl-position it nodes :test #'string= :key #'car)) - (col (k) (mapcar (lambda (r) (cdr (assoc k r))) meta)) - (add (lst) - (dolist (el lst) (push (cons el counter) nodes)) - (cl-incf counter))) - ;; build the nodes of the graph - (add (col :title)) - (add (cl-remove-if (lambda (author) (string-match "others" author)) - (cl-remove-duplicates (apply #'append (col :authors)) - :test #'string=))) - (dolist (field fields) - (add (cl-remove-duplicates (col field) :test #'string=))) - ;; build the links in the graph - (dolist (citation meta) - (let ((dest (id (cdr (assq :title citation))))) - (dolist (author (mapcar #'id (cdr (assq :authors citation)))) - (when author (push (cons author dest) links))) - (let ((jid (id (cdr (assq :journal citation))))) - (when jid (push (cons jid dest) links))) - (let ((cid (id (cdr (assq :category citation))))) - (when cid (push (cons cid dest) links))))) - ;; build the json string - (format "{\"nodes\":[%s],\"links\":[%s]}" - (mapconcat - (lambda (pair) - (format "{\"name\":%S,\"group\":%d}" - (car pair) (cdr pair))) - nodes ",") - (mapconcat - (lambda (link) - (format "{\"source\":%d,\"target\":%d,\"value\":1}" - (car link) (cdr link))) - (meta-to-links meta nodes) ","))))) +;; FIXME: `meta-to-links' is not a known function. +;; (defun obe-meta-to-json (meta &optional fields) +;; "Turn a list of META data from citations into a string of json." +;; (let ((counter 1) nodes links) +;; (cl-flet ((id (it) (cl-position it nodes :test #'string= :key #'car)) +;; (col (k) (mapcar (lambda (r) (cdr (assoc k r))) meta)) +;; (add (lst) +;; (dolist (el lst) (push (cons el counter) nodes)) +;; (cl-incf counter))) +;; ;; build the nodes of the graph +;; (add (col :title)) +;; (add (cl-remove-if (lambda (author) (string-match "others" author)) +;; (cl-remove-duplicates (apply #'append (col :authors)) +;; :test #'string=))) +;; (dolist (field fields) +;; (add (cl-remove-duplicates (col field) :test #'string=))) +;; ;; build the links in the graph +;; (dolist (citation meta) +;; (let ((dest (id (cdr (assq :title citation))))) +;; (dolist (author (mapcar #'id (cdr (assq :authors citation)))) +;; (when author (push (cons author dest) links))) +;; (let ((jid (id (cdr (assq :journal citation))))) +;; (when jid (push (cons jid dest) links))) +;; (let ((cid (id (cdr (assq :category citation))))) +;; (when cid (push (cons cid dest) links))))) +;; ;; build the json string +;; (format "{\"nodes\":[%s],\"links\":[%s]}" +;; (mapconcat +;; (lambda (pair) +;; (format "{\"name\":%S,\"group\":%d}" +;; (car pair) (cdr pair))) +;; nodes ",") +;; (mapconcat +;; (lambda (link) +;; (format "{\"source\":%d,\"target\":%d,\"value\":1}" +;; (car link) (cdr link))) +;; (meta-to-links meta nodes) ","))))) (provide 'org-bibtex-extras) ;;; org-bibtex-extras ends here |