Suppress blank lines if a title is empty
This commit is contained in:
47
ox-rst.el
47
ox-rst.el
@@ -461,41 +461,30 @@ INFO is a plist used as a communication channel."
|
|||||||
(org-export-data (plist-get info :email) info)))
|
(org-export-data (plist-get info :email) info)))
|
||||||
(date (and (plist-get info :with-date)
|
(date (and (plist-get info :with-date)
|
||||||
(org-export-data (org-export-get-date info) info)))
|
(org-export-data (org-export-get-date info) info)))
|
||||||
(title
|
|
||||||
(if (string= title "")
|
|
||||||
(cond
|
|
||||||
((and (org-string-nw-p date) (org-string-nw-p author))
|
|
||||||
(concat
|
|
||||||
author
|
|
||||||
" "
|
|
||||||
date
|
|
||||||
(when (org-string-nw-p email) (concat " " email))))
|
|
||||||
((and (org-string-nw-p date) (org-string-nw-p email))
|
|
||||||
(concat
|
|
||||||
email
|
|
||||||
" "
|
|
||||||
date))
|
|
||||||
((org-string-nw-p date)
|
|
||||||
date)
|
|
||||||
((and (org-string-nw-p author) (org-string-nw-p email))
|
|
||||||
(concat author " " email))
|
|
||||||
((org-string-nw-p author) author)
|
|
||||||
((org-string-nw-p email) email)) title))
|
|
||||||
(titleline (make-string (string-width title) ?=))
|
(titleline (make-string (string-width title) ?=))
|
||||||
(subtitleline (make-string (string-width subtitle) ?-))
|
(subtitleline (make-string (string-width subtitle) ?-))
|
||||||
|
(title (if (not (string= title ""))
|
||||||
|
(concat titleline "\n"
|
||||||
|
title "\n"
|
||||||
|
titleline "\n") ""))
|
||||||
(subtitle (if (not (string= subtitle ""))
|
(subtitle (if (not (string= subtitle ""))
|
||||||
(concat subtitleline "\n"
|
(concat subtitleline "\n"
|
||||||
subtitle "\n"
|
subtitle "\n"
|
||||||
subtitleline "\n") "")))
|
subtitleline "\n") "")))
|
||||||
(concat
|
(cond
|
||||||
titleline "\n"
|
((string= title "")
|
||||||
title "\n"
|
(concat
|
||||||
titleline "\n"
|
(when (org-string-nw-p author) (concat " :Author: " author "\n"))
|
||||||
subtitle
|
(when (org-string-nw-p email) (concat " :Contact: " email "\n"))
|
||||||
(when (org-string-nw-p author) (concat "\n :Author: " author))
|
(when (org-string-nw-p date) (concat " :Date: " date "\n"))))
|
||||||
(when (org-string-nw-p email) (concat "\n :Contact: " email))
|
(t
|
||||||
(when (org-string-nw-p date) (concat "\n :Date: " date))
|
(concat
|
||||||
"\n")))
|
title
|
||||||
|
subtitle
|
||||||
|
(when (org-string-nw-p author) (concat "\n :Author: " author))
|
||||||
|
(when (org-string-nw-p email) (concat "\n :Contact: " email))
|
||||||
|
(when (org-string-nw-p date) (concat "\n :Date: " date))
|
||||||
|
"\n")))))
|
||||||
|
|
||||||
|
|
||||||
(defun org-rst-template (contents info)
|
(defun org-rst-template (contents info)
|
||||||
|
|||||||
Reference in New Issue
Block a user