From ae90eab92ce9b862b3b4332d40ebf73e419ead42 Mon Sep 17 00:00:00 2001 From: Sergio Conde Gomez Date: Wed, 14 Mar 2018 20:20:35 +0100 Subject: [PATCH] Make headline underline characters customizable --- ox-rst.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ox-rst.el b/ox-rst.el index 8ea0562..dac0627 100644 --- a/ox-rst.el +++ b/ox-rst.el @@ -99,6 +99,7 @@ (:rst-link-use-ref-role nil nil org-rst-link-use-ref-role) (:rst-text-markup-alist nil nil org-rst-text-markup-alist) (:rst-quote-margin nil nil org-rst-quote-margin) + (:rst-headline-underline-characters nil nil org-rst-headline-underline-characters) (:rst-headline-spacing nil nil org-rst-headline-spacing) (:rst-paragraph-spacing nil nil org-rst-paragraph-spacing) (:rst-format-drawer-function nil nil org-rst-format-drawer-function) @@ -231,6 +232,11 @@ the same number of blank lines as in the original document." (const :tag "Preserve original spacing" auto))) +(defcustom org-rst-headline-underline-characters '(?- ?~ ?^ ?: ?' ?\ ?_) + "List of underline characters for each headline level." + :group 'org-export-rst + :type 'list) + ;;;; Drawers (defcustom org-rst-format-drawer-function nil @@ -388,7 +394,7 @@ possible. It doesn't apply to `inlinetask' elements." (when (and underline headlinep) (let ((under-char (nth (1- (org-export-get-relative-level element info)) - '(?- ?~ ?^ ?: ?' ?\ ?_)))) + org-rst-headline-underline-characters))) (and under-char (concat "\n" (make-string (string-width first-part) under-char))))))))