Browse Source

export back-ends: Use new tools for timestamps

* contrib/lisp/org-e-ascii.el (org-e-ascii-timestamp): Use new tool.
* contrib/lisp/org-e-groff.el (org-e-groff-timestamp): Use new tool.
* contrib/lisp/org-e-html.el (org-e-html-timestamp): Use new tool.
* contrib/lisp/org-e-latex.el (org-e-latex-timestamp): Use new tool.
* contrib/lisp/org-e-texinfo.el (org-e-texinfo-timestamp): Use new
  tool.
Nicolas Goaziou 5 years ago
parent
commit
f71df7dc50

+ 5 - 34
contrib/lisp/org-e-ascii.el

@@ -952,11 +952,6 @@ INFO is a plist used as a communication channel."
 
 ;;; Transcode Functions
 
-;;;; Babel Call
-
-;; Babel Calls are ignored.
-
-
 ;;;; Bold
 
 (defun org-e-ascii-bold (bold contents info)
@@ -1003,16 +998,6 @@ information."
   (format org-e-ascii-verbatim-format (org-element-property :value code)))
 
 
-;;;; Comment
-
-;; Comments are ignored.
-
-
-;;;; Comment Block
-
-;; Comment Blocks are ignored.
-
-
 ;;;; Drawer
 
 (defun org-e-ascii-drawer (drawer contents info)
@@ -1164,11 +1149,6 @@ information."
      text-width 'center)))
 
 
-;;;; Inline Babel Call
-
-;; Inline Babel Calls are ignored.
-
-
 ;;;; Inline Src Block
 
 (defun org-e-ascii-inline-src-block (inline-src-block contents info)
@@ -1231,6 +1211,7 @@ holding contextual information."
 	      org-e-ascii-inner-margin)
 	    (org-e-ascii--current-text-width inlinetask info)))))))
 
+
 ;;;; Italic
 
 (defun org-e-ascii-italic (italic contents info)
@@ -1451,11 +1432,6 @@ channel."
    " "))
 
 
-;;;; Property Drawer
-;;
-;; Property drawers are ignored.
-
-
 ;;;; Quote Block
 
 (defun org-e-ascii-quote-block (quote-block contents info)
@@ -1496,6 +1472,7 @@ CONTENTS is the contents of the target.  INFO is a plist holding
 contextual information."
   contents)
 
+
 ;;;; Section
 
 (defun org-e-ascii-section (section contents info)
@@ -1541,6 +1518,7 @@ contextual information."
      (when (and caption (not org-e-ascii-caption-above))
        (concat "\n" caption)))))
 
+
 ;;;; Statistics Cookie
 
 (defun org-e-ascii-statistics-cookie (statistics-cookie contents info)
@@ -1723,20 +1701,12 @@ a communication channel."
 		  (funcall build-hline "+" "-" "+" "+")))))))
 
 
-;;;; Target
-
-;; Targets are invisible.
-
-
 ;;;; Timestamp
 
 (defun org-e-ascii-timestamp (timestamp contents info)
   "Transcode a TIMESTAMP object from Org to ASCII.
 CONTENTS is nil.  INFO is a plist holding contextual information."
-  (let ((value (org-translate-time
-		(org-element-property :raw-value timestamp))))
-    (if (not (eq (plist-get info :ascii-charset) 'utf-8)) value
-      (replace-regexp-in-string "--" "–" value))))
+  (org-e-ascii-plain-text (org-export-translate-timestamp timestamp) info))
 
 
 ;;;; Underline
@@ -1768,6 +1738,7 @@ contextual information."
      (org-e-ascii--justify-string contents verse-width 'left)
      org-e-ascii-quote-margin)))
 
+
 
 ;;; Filters
 

+ 2 - 2
contrib/lisp/org-e-groff.el

@@ -1849,8 +1849,8 @@ information."
   "Transcode a TIMESTAMP object from Org to Groff.
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
-  (let ((value (org-translate-time
-		(org-element-property :raw-value timestamp))))
+  (let ((value (org-e-groff-plain-text
+		(org-export-translate-timestamp timestamp) info)))
     (case (org-element-property :type timestamp)
       ((active active-range)
        (format org-e-groff-active-timestamp-format value))

+ 2 - 2
contrib/lisp/org-e-html.el

@@ -2701,8 +2701,8 @@ information."
   "Transcode a TIMESTAMP object from Org to HTML.
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
-  (let ((value (org-translate-time
-		(org-element-property :raw-value timestamp))))
+  (let ((value (org-e-html-plain-text
+		(org-export-translate-timestamp timestamp) info)))
     (format "<span class=\"timestamp-wrapper\"><span class=\"timestamp\">%s</span></span>"
 	    (replace-regexp-in-string "--" "&ndash;" value))))
 

+ 5 - 16
contrib/lisp/org-e-latex.el

@@ -2539,23 +2539,12 @@ information."
   "Transcode a TIMESTAMP object from Org to LaTeX.
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
-  (let ((value (org-translate-time
-		(org-element-property :raw-value timestamp))))
+  (let ((value (org-e-latex-plain-text
+		(org-export-translate-timestamp timestamp) info)))
     (case (org-element-property :type timestamp)
-      (active (format org-e-latex-active-timestamp-format value))
-      (active-range
-       (let ((timestamps (org-split-string value "--")))
-	 (concat
-	  (format org-e-latex-active-timestamp-format (car timestamps))
-	  "--"
-	  (format org-e-latex-active-timestamp-format (cdr timestamps)))))
-      (inactive (format org-e-latex-inactive-timestamp-format value))
-      (inactive-range
-       (let ((timestamps (org-split-string value "--")))
-	 (concat
-	  (format org-e-latex-inactive-timestamp-format (car timestamps))
-	  "--"
-	  (format org-e-latex-inactive-timestamp-format (cdr timestamps)))))
+      ((active active-range) (format org-e-latex-active-timestamp-format value))
+      ((inactive inactive-range)
+       (format org-e-latex-inactive-timestamp-format value))
       (otherwise (format org-e-latex-diary-timestamp-format value)))))
 
 

+ 2 - 2
contrib/lisp/org-e-texinfo.el

@@ -1601,8 +1601,8 @@ information."
   "Transcode a TIMESTAMP object from Org to Texinfo.
 CONTENTS is nil.  INFO is a plist holding contextual
 information."
-  (let ((value (org-translate-time
-		(org-element-property :raw-value timestamp))))
+  (let ((value (org-e-texinfo-plain-text
+		(org-export-translate-timestamp timestamp) info)))
     (case (org-element-property :type timestamp)
       ((active active-range)
        (format org-e-texinfo-active-timestamp-format value))