diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2013-04-02 23:59:00 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2013-04-02 23:59:00 +0200 |
commit | e7bf989b289e11c7cc732240ef6517260a4b3767 (patch) | |
tree | 11badd5d07ea7ea0a6de12c8ac6bca43ced18876 | |
parent | 0bd6ccd6f9f5f5493d4158128c79d6f3b86889ca (diff) | |
download | org-mode-e7bf989b289e11c7cc732240ef6517260a4b3767.tar.gz |
export back-ends: Handle DATE keyword in a uniform way
* lisp/ox-ascii.el (org-ascii-template--document-title): Use new function.
* lisp/ox-beamer.el (org-beamer-template): Use new function.
* lisp/ox-html.el (org-html-format-spec): Use new function.
* lisp/ox-latex.el (org-latex-template): Use new function.
(org-latex-date-timestamp-format): Remove variable.
The uniform way is to format DATE according to
`org-export-date-timestamp-format' when keyword value consists in
a single timestamp.
-rw-r--r-- | lisp/ox-ascii.el | 2 | ||||
-rw-r--r-- | lisp/ox-beamer.el | 13 | ||||
-rw-r--r-- | lisp/ox-html.el | 2 | ||||
-rw-r--r-- | lisp/ox-latex.el | 29 |
4 files changed, 7 insertions, 39 deletions
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index 37e1b03..f715732 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -880,7 +880,7 @@ INFO is a plist used as a communication channel." (email (and (plist-get info :with-email) (org-export-data (plist-get info :email) info))) (date (and (plist-get info :with-date) - (org-export-data (plist-get info :date) info)))) + (org-export-data (org-export-get-date info) info)))) ;; There are two types of title blocks depending on the presence ;; of a title to display. (if (string= title "") diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index dc427de..63dad5c 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -899,17 +899,8 @@ holding export options." (author (format "\\author{%s}\n" author)) (t "\\author{}\n"))) ;; 6. Date. - (let ((date (and (plist-get info :with-date) (plist-get info :date)))) - (format "\\date{%s}\n" - (cond ((not date) "") - ;; If `:date' consists in a single timestamp and - ;; `:date-format' is provided, apply it. - ((and (plist-get info :date-format) - (not (cdr date)) - (eq (org-element-type (car date)) 'timestamp)) - (org-timestamp-format - (car date) (plist-get info :date-format))) - (t (org-export-data date info))))) + (let ((date (and (plist-get info :with-date) (org-export-get-date info)))) + (format "\\date{%s}\n" (org-export-data date info))) ;; 7. Title (format "\\title{%s}\n" title) ;; 8. Hyperref options. diff --git a/lisp/ox-html.el b/lisp/ox-html.el index a615f41..13293f6 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1496,7 +1496,7 @@ INFO is a plist used as a communication channel." "Return format specification for elements that can be used in the preamble or postamble." `((?t . ,(org-export-data (plist-get info :title) info)) - (?d . ,(org-export-data (plist-get info :date) info)) + (?d . ,(org-export-data (org-export-get-date info) info)) (?T . ,(format-time-string org-html--timestamp-format)) (?a . ,(org-export-data (plist-get info :author) info)) (?e . ,(mapconcat diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index f6897f9..cc75c5b 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -185,8 +185,7 @@ (lambda (a s v b) (if a (org-latex-export-to-pdf t s v b) (org-open-file (org-latex-export-to-pdf nil s v b))))))) - :options-alist '((:date-format nil nil org-latex-date-timestamp-format) - (:latex-class "LATEX_CLASS" nil org-latex-default-class t) + :options-alist '((:latex-class "LATEX_CLASS" nil org-latex-default-class t) (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t) (:latex-header "LATEX_HEADER" nil nil newline) (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline) @@ -406,19 +405,6 @@ are written as utf8 files." (string :tag "Derived from buffer") (string :tag "Use this instead")))) -(defcustom org-latex-date-timestamp-format nil - "Time-stamp format string to use for DATE keyword. - -The format string, when specified, only applies if date consists -in a single time-stamp. Otherwise its value will be ignored. - -See `format-time-string' for details on how to build this -string." - :group 'org-export-latex - :type '(choice - (string :tag "Time-stamp format string") - (const :tag "No format string" nil))) - (defcustom org-latex-title-command "\\maketitle" "The command used to insert the title just after \\begin{document}. If this string contains the formatting specification \"%s\" then @@ -1199,17 +1185,8 @@ holding export options." (format "\\author{%s\\thanks{%s}}\n" author email)) ((or author email) (format "\\author{%s}\n" (or author email))))) ;; Date. - (let ((date (and (plist-get info :with-date) (plist-get info :date)))) - (format "\\date{%s}\n" - (cond ((not date) "") - ;; If `:date' consists in a single timestamp and - ;; `:date-format' is provided, apply it. - ((and (plist-get info :date-format) - (not (cdr date)) - (eq (org-element-type (car date)) 'timestamp)) - (org-timestamp-format - (car date) (plist-get info :date-format))) - (t (org-export-data date info))))) + (let ((date (and (plist-get info :with-date) (org-export-get-date info)))) + (format "\\date{%s}\n" (org-export-data date info))) ;; Title (format "\\title{%s}\n" title) ;; Hyperref options. |