From 3f1aabc1408f48ca320408d2d7c779798b1f7b06 Mon Sep 17 00:00:00 2001 From: cnngimenez Date: Mon, 10 Jan 2022 11:58:14 -0300 Subject: [PATCH] Use #+name: to add names to exported code blocks. --- ox-gemini.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ox-gemini.el b/ox-gemini.el index 79525df..2840082 100644 --- a/ox-gemini.el +++ b/ox-gemini.el @@ -68,11 +68,13 @@ ;; there's a bug here where there's a trailing space in the `` (format "`%s`" (org-export-format-code-default input info))) -(defun org-gemini-code-block (example-block _contents info) - "EXAMPLE-BLOCK is a codeblock. INFO is a plist." - (org-remove-indentation - (format "```\n%s```" - (org-export-format-code-default example-block info)))) +(defun org-gemini-code-block (src-block _contents info) + "SRC-BLOCK is a codeblock. INFO is a plist." + (let ((name (org-element-property :name src-block))) + (org-remove-indentation + (format "```%s\n%s```" + (or name "") + (org-export-format-code-default src-block info))))) (defun org-gemini--describe-links (links _width info) "Describe links is the footer-portion of the link data.