From 07882c19875d1881487e88a6a67160435f1ee78e Mon Sep 17 00:00:00 2001 From: cnngimenez Date: Sun, 16 Jan 2022 00:40:58 -0300 Subject: [PATCH] Support for `#+BEGIN_EXPORT gemini`. Byte-compile is happy. --- ox-gemini.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ox-gemini.el b/ox-gemini.el index 3b2f8db..68328cc 100644 --- a/ox-gemini.el +++ b/ox-gemini.el @@ -40,6 +40,7 @@ (lambda (a s v b) (org-gemini-export-to-file a s v b nil))))) :translate-alist '((code . org-gemini-code-inline) + (export-block . org-gemini-export-block) (paragraph . org-gemini-paragraph) (headline . org-gemini-headline) (link . org-gemini-link) @@ -81,7 +82,8 @@ (defun org-gemini--describe-links (links _width info) "Describe links is the footer-portion of the link data. -It's output just before each section. LINKS is a list of each link. INFO is a plist." +It's output just before each section. LINKS is a list of each link. +INFO is a plist." (concat (mapconcat (lambda (link) @@ -139,7 +141,8 @@ contextual information." (element info _text-width &optional _underline _notags toc) "Build a title heading. -ELEMENT is an org-element. TOC is whether to show the table of contents. INFO is unimportant." +ELEMENT is an org-element. TOC is whether to show the table of contents. +INFO is unimportant." (let ((number (org-element-property :level element)) (text (org-trim @@ -277,6 +280,14 @@ Return output file name." (org-publish-org-to 'gemini filename ".gmi" plist pub-dir)) +(defun org-gemini-export-block (export-block _contents _info) + "Transcode a EXPORT-BLOCK element from Org to Markdown. +CONTENTS is nil. INFO is a plist holding contextual information." + (when (member (org-element-property :type export-block) '("GEMINI" "GMI" + "GEMTEXT")) + (org-remove-indentation (org-element-property :value export-block)))) + + (provide 'ox-gemini) ;;; ox-gemini.el ends here