mirror of
https://github.com/correl/ox-confluence-en.git
synced 2024-11-23 11:09:54 +00:00
Export CUSTOM_ID property as anchor macro
This commit is contained in:
parent
093cdc2e07
commit
9bdf5aba9e
1 changed files with 10 additions and 9 deletions
|
@ -81,21 +81,22 @@ https://marketplace.atlassian.com/plugins/de.griffel.confluence.plugins.plant-um
|
||||||
|
|
||||||
CONTENTS holds the contents of the element. INFO is a plist
|
CONTENTS holds the contents of the element. INFO is a plist
|
||||||
holding contextual information."
|
holding contextual information."
|
||||||
(let* ((text (org-export-data (org-element-property :title headline)
|
(let* ((text (org-export-data (org-element-property :title headline) info))
|
||||||
info))
|
(todo (org-export-data (org-element-property :todo-keyword headline) info))
|
||||||
(todo (org-export-data (org-element-property :todo-keyword headline)
|
(custom-id (org-export-data (org-element-property :CUSTOM_ID headline) info))
|
||||||
info))
|
(level (org-export-get-relative-level headline info))
|
||||||
(level (org-export-get-relative-level headline info))
|
(anchor (if (string= custom-id "") ""
|
||||||
(todo-text (if (or (not (plist-get info :with-todo-keywords))
|
(format "{anchor:%s}\n" custom-id)))
|
||||||
(string= todo ""))
|
(todo-text (if (or (not (plist-get info :with-todo-keywords))
|
||||||
""
|
(string= todo ""))
|
||||||
|
""
|
||||||
(let* ((todo-type (org-element-property :todo-type headline))
|
(let* ((todo-type (org-element-property :todo-type headline))
|
||||||
(status-color (cond
|
(status-color (cond
|
||||||
((equal todo-type 'todo) "red")
|
((equal todo-type 'todo) "red")
|
||||||
(t "green"))))
|
(t "green"))))
|
||||||
(format "%s " (ox-confluence-en--macro "status" nil `((color . ,status-color) (title . ,todo))))))))
|
(format "%s " (ox-confluence-en--macro "status" nil `((color . ,status-color) (title . ,todo))))))))
|
||||||
;; Else: Standard headline.
|
;; Else: Standard headline.
|
||||||
(format "h%s. %s%s\n%s" level todo-text text
|
(format "%sh%s. %s%s\n%s" anchor level todo-text text
|
||||||
(if (org-string-nw-p contents) contents ""))))
|
(if (org-string-nw-p contents) contents ""))))
|
||||||
|
|
||||||
(defun ox-confluence-en-paragraph (paragraph contents info)
|
(defun ox-confluence-en-paragraph (paragraph contents info)
|
||||||
|
|
Loading…
Reference in a new issue