From f1ca83da0c5ff8b1585706987b13c99fb7832e80 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Mon, 29 Dec 2025 22:06:32 +0100 Subject: [PATCH] org special block with arbitrary attributes to create rst directives with arbitrary options --- ox-rst.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ox-rst.el b/ox-rst.el index 3d6b33c..0098c91 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -1432,13 +1432,23 @@ holding contextual information." (title (plist-get attributes :title)) (class (plist-get attributes :class)) (label (org-element-property :name special-block)) - (type (org-element-property :type special-block))) + (type (org-element-property :type special-block)) + (attr-str-ignore '(:title)) + (attr-str "")) + ;; combine with `org-rst--make-attribute-string'? + (cl-loop for (key value) on attributes by 'cddr + do (unless (member key attr-str-ignore) + (setq attr-str + (concat attr-str + (format " %s:" key) + (when value (format " %s" value)) + "\n")))) (concat (format ".. %s::" type) (when title (format " %s" title)) "\n" - (when class (format " :class: %s\n" class)) (when label (format " :name: %s\n" label)) + (when attr-str attr-str) "\n" (when contents (org-rst--indent-string contents org-rst-quote-margin)))))