don't leave # when there isn't a title

and while there ensure that there's an empty line following the
document title.

Signed-off-by: Justin Abrahms <justin@abrah.ms>
This commit is contained in:
Omar Polo 2021-08-11 07:57:46 +00:00 committed by Justin Abrahms
parent 8bbc1c9f6d
commit 1e4cabf98a

View File

@ -29,7 +29,6 @@
;; TODO: ;; TODO:
;; Sublists aren't supported in gemini ;; Sublists aren't supported in gemini
;; There's a trailing space after inline code samples ;; There's a trailing space after inline code samples
;; If you don't have a title, it leaves a blank # in the gmi
;; If you link a file to an absolute path, the links break ;; If you link a file to an absolute path, the links break
;; bare links don't work (e.g. directly linking https://google.com ;; bare links don't work (e.g. directly linking https://google.com
;; ;;
@ -207,14 +206,13 @@ holding contextual information."
"Return complete document string after GEMINI conversion. "Return complete document string after GEMINI conversion.
CONTENTS is the transcoded contents string. INFO is a plist CONTENTS is the transcoded contents string. INFO is a plist
holding export options." holding export options."
(let ((title (org-export-data (when (plist-get info :with-title)
(plist-get info :title))
info)))
(concat (concat
;; Build title block. (unless (string= title "")
(format "# %s\n" (org-export-data (format "# %s\n\n" title))
(when (plist-get info :with-title) (plist-get info :title)) info)) contents)))
;; Document's body.
contents))
(defun org-gemini-export-to-buffer (&optional async subtreep visible-only body-only ext-plist) (defun org-gemini-export-to-buffer (&optional async subtreep visible-only body-only ext-plist)
"Export an org file to a new buffer. "Export an org file to a new buffer.