(require 'ox-jira))
#+END_SRC
-A little macro to speed things up:
+We are lazy and want to speed up things:
#+BEGIN_SRC emacs-lisp
- (fset 'bba-org-export-jira-clipboard
- (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([24 110 115 escape 58 40 115 101 116 113 32 111 114 103 45 101 120 112 111 114 116 45 98 97 98 101 108 45 101 118 97 108 117 97 116 101 32 110 105 108 41 return 3 5 106 106 67108896 14 14 14 23 24 104 escape 119] 0 "%d")) arg)))
+ (defun bba-org-export-jira-clipboard()
+ "narrow to org subtree and store content in jira format in clipboard."
+ (interactive)
+ (org-narrow-to-subtree)
+ (bba-export-jira-org)
+ (let ((org-export-babel-evaluate nil))
+ (ox-jira-export-as-jira))
+ (delete-region (point) (progn (forward-line 1)(point)))
+ (mark-whole-buffer)
+ (kill-ring-save 1 1 1)
+ )
+
(define-key org-mode-map "\C-c\S-j" 'bba-org-export-jira-clipboard)
#+END_SRC
+Besides the clipboard we want also an org file in =/tmp/= to attach to
+the jira ticket:
+
+
+#+BEGIN_SRC emacs-lisp
+ (defun bba-export-jira-org()
+ "export current narrowed view to file in tmp and open a finder window on OS-X."
+ (interactive)
+ (beginning-of-buffer)
+ (if (re-search-forward "jira:" nil t 1)
+ (if (org-in-regexp org-bracket-link-regexp 1)
+ (let ((remove (list (match-beginning 0) (match-end 0)))
+ (description (last (split-string (if (match-end 3)
+ (match-string-no-properties 3)
+ (match-string-no-properties 1)) ":"))))
+ (write-region nil nil (concat "/tmp/" (car description) ".org") nil nil )
+ (if (string-equal system-type "darwin")(shell-command "open /tmp/"))
+ )))
+ )
+#+END_SRC
+
** Some initial languages we want org-babel to support
#+BEGIN_SRC emacs-lisp
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '(
- (sh . t)
- (python . t)
- (R . t)
- (ruby . t)
- (ditaa . t)
- (dot . t)
- (octave . t)
- (sqlite . t)
- (perl . t)
- ))
-
- ;;(setq org-html-preamble nil
- ;; org-html-postamble nil
- ;; org-html-head "")
-
- ;; (setq org-html-preamble nil
- ;; org-html-postamble nil
- ;; org-html-include-default-style nil
- ;; org-html-head ""
- ;; org-export-html-with-timestamp nil
- ;; org-export-html-style "body-only"
- ;; )
- ;; body-only option ?
-
- ;; (setq html (org-export-as-html 3 nil nil 1))
+ (org-babel-do-load-languages
+ 'org-babel-load-languages
+ '(
+ (sh . t)
+ (shell . t)
+ (python . t)
+ (R . t)
+ (ruby . t)
+ (ditaa . t)
+ (dot . t)
+ (octave . t)
+ (sqlite . t)
+ (perl . t)
+ ))
+
+ ;;(setq org-html-preamble nil
+ ;; org-html-postamble nil
+ ;; org-html-head "")
+
+ ;; (setq org-html-preamble nil
+ ;; org-html-postamble nil
+ ;; org-html-include-default-style nil
+ ;; org-html-head ""
+ ;; org-export-html-with-timestamp nil
+ ;; org-export-html-style "body-only"
+ ;; )
+ ;; body-only option ?
+
+ ;; (setq html (org-export-as-html 3 nil nil 1))
#+END_SRC