aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Brautaset <stig@brautaset.org>2016-02-28 09:43:47 +0000
committerStig Brautaset <stig@brautaset.org>2016-02-28 09:43:47 +0000
commit4871b4d3058cfb78786d5e12b4253a367a4b5992 (patch)
tree27dfe7bcf7d84cfdfc388a80a7957e2fca9f9450
parentd28f752cfacf7bc22c34e17229f974537a67ec28 (diff)
Fake definition lists
-rw-r--r--ox-jira.el7
-rw-r--r--ox-jira.org10
-rw-r--r--test/ox-jira-test.el6
-rw-r--r--test/ox-jira-test.org11
4 files changed, 32 insertions, 2 deletions
diff --git a/ox-jira.el b/ox-jira.el
index 3e77038..a28e260 100644
--- a/ox-jira.el
+++ b/ox-jira.el
@@ -155,6 +155,9 @@ CONTENTS is the text with item markup. INFO is a plist holding
contextual information."
(let* ((list-type-path (org-jira--list-type-path item))
(bullet-string (org-jira--bullet-string (reverse list-type-path)))
+ (tag (let ((tag (org-element-property :tag item)))
+ (when tag
+ (org-export-data tag info))))
(checkbox (case (org-element-property :checkbox item)
(on "(/)")
(off "(x)")
@@ -164,6 +167,8 @@ contextual information."
" "
(when checkbox
(concat checkbox " "))
+ (when tag
+ (format "*%s*: " tag))
contents)))
(defun org-jira-link (link desc info)
@@ -221,7 +226,7 @@ the plist used as a communication channel."
(defun org-jira-src-block (src-block contents info)
"Transcode a SRC-BLOCK element from Org to Jira.
-CONTENTS holds the contents of the item. INFO is a plist holding
+CONTENTS holds the contents of the src-block. INFO is a plist holding
contextual information."
(when (org-string-nw-p (org-element-property :value src-block))
(let* ((lang (org-element-property :language src-block))
diff --git a/ox-jira.org b/ox-jira.org
index e55e8f8..a4a2353 100644
--- a/ox-jira.org
+++ b/ox-jira.org
@@ -293,6 +293,9 @@
alternating plain-list and item nodes until there are no more, and extract
their type. The type list is used to create a bullet string.
+ JIRA doesn't really have support for definition lists, so we fake it with
+ a bullet list and some bold text for the term.
+
#+BEGIN_SRC emacs-lisp
(defun org-jira--list-type-path (item)
(when (and item (eq 'item (org-element-type item)))
@@ -312,6 +315,9 @@
contextual information."
(let* ((list-type-path (org-jira--list-type-path item))
(bullet-string (org-jira--bullet-string (reverse list-type-path)))
+ (tag (let ((tag (org-element-property :tag item)))
+ (when tag
+ (org-export-data tag info))))
(checkbox (case (org-element-property :checkbox item)
(on "(/)")
(off "(x)")
@@ -321,6 +327,8 @@
" "
(when checkbox
(concat checkbox " "))
+ (when tag
+ (format "*%s*: " tag))
contents)))
#+END_SRC
@@ -429,7 +437,7 @@
#+BEGIN_SRC emacs-lisp
(defun org-jira-src-block (src-block contents info)
"Transcode a SRC-BLOCK element from Org to Jira.
- CONTENTS holds the contents of the item. INFO is a plist holding
+ CONTENTS holds the contents of the src-block. INFO is a plist holding
contextual information."
(when (org-string-nw-p (org-element-property :value src-block))
(let* ((lang (org-element-property :language src-block))
diff --git a/test/ox-jira-test.el b/test/ox-jira-test.el
index 4b7757e..c0e6d53 100644
--- a/test/ox-jira-test.el
+++ b/test/ox-jira-test.el
@@ -137,6 +137,12 @@ fum" 'jira))))
- [ ] fi
- [X] fo" 'jira))))
+(ert-deftest ox-jira-test/definition-lists()
+ (should (equal "* *fi*: fo
+* *fa*: fum
+" (org-export-string-as "- fi :: fo
+- fa :: fum" 'jira))))
+
(ert-deftest ox-jira-test/src-blocks ()
(should (equal "{code:none}
echo hello
diff --git a/test/ox-jira-test.org b/test/ox-jira-test.org
index 9cb8a6b..ecd7228 100644
--- a/test/ox-jira-test.org
+++ b/test/ox-jira-test.org
@@ -243,6 +243,17 @@
- [X] fo" 'jira))))
#+END_SRC
+ Definition lists are not directly supported by JIRA markup, but let's fake
+ it with a bullet list & some bold text.
+
+ #+BEGIN_SRC emacs-lisp
+ (ert-deftest ox-jira-test/definition-lists()
+ (should (equal "* *fi*: fo
+ ,* *fa*: fum
+ " (org-export-string-as "- fi :: fo
+ - fa :: fum" 'jira))))
+ #+END_SRC
+
** Source code
I use Org mode for literate programming, and executable lab notes, so we