[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 2c2b720 07/14: ox: Plug citations into export proce
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 2c2b720 07/14: ox: Plug citations into export process |
Date: |
Fri, 9 Jul 2021 02:57:17 -0400 (EDT) |
branch: externals/org
commit 2c2b7203947a7ab18e3d74bf9238b06c89bf9aaa
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>
ox: Plug citations into export process
* lisp/ox.el (org-export-as): Add citation pre-processing.
---
lisp/ox.el | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/lisp/ox.el b/lisp/ox.el
index af7626b..16b87a7 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -74,6 +74,8 @@
(require 'cl-lib)
(require 'ob-exp)
+(require 'oc)
+(require 'oc-basic) ;default value for `org-cite-export-processors'
(require 'ol)
(require 'org-element)
(require 'org-macro)
@@ -140,7 +142,9 @@
(:with-tasks nil "tasks" org-export-with-tasks)
(:with-timestamps nil "<" org-export-with-timestamps)
(:with-title nil "title" org-export-with-title)
- (:with-todo-keywords nil "todo" org-export-with-todo-keywords))
+ (:with-todo-keywords nil "todo" org-export-with-todo-keywords)
+ ;; Citations processing.
+ (:cite-export "CITE_EXPORT" nil org-cite-export-processors))
"Alist between export properties and ways to set them.
The key of the alist is the property name, and the value is a list
@@ -2988,6 +2992,10 @@ Return code as a string."
(setq info
(org-combine-plists
info (org-export-get-environment backend subtreep ext-plist)))
+ ;; Pre-process citations environment, i.e. install
+ ;; bibliography list, and citation processor in INFO.
+ (org-cite-store-bibliography info)
+ (org-cite-store-export-processor info)
;; De-activate uninterpreted data from parsed keywords.
(dolist (entry (append (org-export-get-all-options backend)
org-export-options-alist))
@@ -3021,6 +3029,11 @@ Return code as a string."
;; Now tree is complete, compute its properties and add them
;; to communication channel.
(setq info (org-export--collect-tree-properties tree info))
+ ;; Process citations and bibliography. Replace each citation
+ ;; and "print_bibliography" keyword in the parse tree with
+ ;; the output of the selected citation export processor.
+ (org-cite-process-citations info)
+ (org-cite-process-bibliography info)
;; Eventually transcode TREE. Wrap the resulting string into
;; a template.
(let* ((body (org-element-normalize-string
@@ -3033,16 +3046,19 @@ Return code as a string."
(funcall inner-template body info))
info))
(template (cdr (assq 'template
- (plist-get info :translate-alist)))))
+ (plist-get info :translate-alist))))
+ (output
+ (if (or (not (functionp template)) body-only) full-body
+ (funcall template full-body info))))
+ ;; Call citation export finalizer.
+ (setq output (org-cite-finalize-export output info))
;; Remove all text properties since they cannot be
;; retrieved from an external process. Finally call
;; final-output filter and return result.
(org-no-properties
(org-export-filter-apply-functions
(plist-get info :filter-final-output)
- (if (or (not (functionp template)) body-only) full-body
- (funcall template full-body info))
- info))))))))
+ output info))))))))
;;;###autoload
(defun org-export-string-as (string backend &optional body-only ext-plist)
- [elpa] externals/org updated (fdb98a4 -> 971c135), ELPA Syncer, 2021/07/09
- [elpa] externals/org 622f9fa 01/14: org: Use crm for completing tags, ELPA Syncer, 2021/07/09
- [elpa] externals/org 4c646a6 03/14: ox: Introduce "raw" pseudo objects, ELPA Syncer, 2021/07/09
- [elpa] externals/org e844a6f 05/14: oc: Add Org Cite library, ELPA Syncer, 2021/07/09
- [elpa] externals/org fed07be 02/14: element: Add citation support, ELPA Syncer, 2021/07/09
- [elpa] externals/org a922b17 04/14: faces: Add `org-cite' and `org-cite-key' faces, ELPA Syncer, 2021/07/09
- [elpa] externals/org 4415635 06/14: oc-basic: Implement `basic' citation processor, ELPA Syncer, 2021/07/09
- [elpa] externals/org a20a3ad 08/14: Plug citations into `org-open-at-point', ELPA Syncer, 2021/07/09
- [elpa] externals/org d6cb37f 12/14: oc-natbib: Implement `natbib' citation processor, ELPA Syncer, 2021/07/09
- [elpa] externals/org 2c2b720 07/14: ox: Plug citations into export process,
ELPA Syncer <=
- [elpa] externals/org 524d8fe 09/14: Plug citations into fontification process, ELPA Syncer, 2021/07/09
- [elpa] externals/org ef79a8d 10/14: org-keys: Plug citation insertion, ELPA Syncer, 2021/07/09
- [elpa] externals/org c089c23 11/14: Allow `org-edit-special' to open "bibliography" files, ELPA Syncer, 2021/07/09
- [elpa] externals/org ae5f515 13/14: oc-biblatex: Implement `biblatex' citation processor, ELPA Syncer, 2021/07/09
- [elpa] externals/org 971c135 14/14: oc-csl: Implement `csl' citation processor, ELPA Syncer, 2021/07/09