summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Ihm <marc@ihm.name>2017-05-01 17:29:47 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-05-02 08:48:16 +0200
commitcbe544edf33a97ffffd3a03f550ffa85e45c18e4 (patch)
tree96ff7a4935b29a2ba8f855d0085b31d0b9be31da
parentcecdb2bd671f45ff3c11c73fefedb0ba67145c62 (diff)
downloadorg-mode-cbe544edf33a97ffffd3a03f550ffa85e45c18e4.tar.gz
ox-confluence: Export checkboxes; fix timestamps in headlines
* contrib/lisp/ox-confluence.el (org-confluence-item): Export checkboxes. (org-confluence-timestamp): Fix timestamps in headlines. Silence byte-compiler.
-rw-r--r--contrib/lisp/ox-confluence.el29
1 files changed, 16 insertions, 13 deletions
diff --git a/contrib/lisp/ox-confluence.el b/contrib/lisp/ox-confluence.el
index c70fe85..b521b24 100644
--- a/contrib/lisp/ox-confluence.el
+++ b/contrib/lisp/ox-confluence.el
@@ -83,16 +83,20 @@
(format "_%s_" contents))
(defun org-confluence-item (item contents info)
- (let* ((plain-list (org-export-get-parent item))
- (type (org-element-property :type plain-list))
- (bullet (if (eq type 'ordered) ?\# ?\-)))
- (concat (make-string (1+ (org-confluence--li-depth item)) bullet)
- " "
- (if (eq type 'descriptive)
- (concat "*"
- (org-export-data (org-element-property :tag item) info)
- "* - "))
- (org-trim contents))))
+ (let ((list-type (org-element-property :type (org-export-get-parent item))))
+ (concat
+ (make-string (1+ (org-confluence--li-depth item))
+ (if (eq list-type 'ordered) ?\# ?\-))
+ " "
+ (pcase (org-element-property :checkbox item)
+ (`on "*{{(X)}}* ")
+ (`off "*{{( )}}* ")
+ (`trans "*{{(\\-)}}* "))
+ (when (eq list-type 'descriptive)
+ (concat "*"
+ (org-export-data (org-element-property :tag item) info)
+ "* - "))
+ (org-trim contents))))
(defun org-confluence-fixed-width (fixed-width contents info)
(org-confluence--block
@@ -117,7 +121,6 @@
(string= todo ""))
""
(format "*{{%s}}* " todo))))
- ;; Else: Standard headline.
(format "h%s. %s%s\n%s" level todo-text text
(if (org-string-nw-p contents) contents ""))))
@@ -181,7 +184,7 @@ a communication channel."
(defun org-confluence-timestamp (timestamp _contents _info)
"Transcode a TIMESTAMP object from Org to Confluence.
CONTENTS and INFO are ignored."
- (let ((translated (org-timestamp-translate timestamp)))
+ (let ((translated (org-trim (org-timestamp-translate timestamp))))
(if (string-prefix-p "[" translated)
(concat "(" (substring translated 1 -1) ")")
translated)))
@@ -208,7 +211,7 @@ CONTENTS and INFO are ignored."
(or (eq tag 'item) ; list items interleave with plain-list
(eq tag 'plain-list)))
(when (eq tag 'item)
- (incf depth))
+ (cl-incf depth))
(setq item (org-export-get-parent item)))
depth))