aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-03-31 18:43:33 +0100
committerYann Herklotz <git@yannherklotz.com>2022-03-31 18:43:33 +0100
commit07555a3a3167d15b31c832db84cad09481d6ca5b (patch)
tree7d981b1e363b4726c48d5146da6e1bc083a23729
parent49d7ea78fde063b407ce6fa57739f90c83500682 (diff)
downloadox-tufte-07555a3a3167d15b31c832db84cad09481d6ca5b.tar.gz
ox-tufte-07555a3a3167d15b31c832db84cad09481d6ca5b.zip
Remove div from section generation
-rw-r--r--ox-tufte.el23
1 files changed, 22 insertions, 1 deletions
diff --git a/ox-tufte.el b/ox-tufte.el
index bcd197a..7033046 100644
--- a/ox-tufte.el
+++ b/ox-tufte.el
@@ -70,7 +70,28 @@
(src-block . org-tufte-src-block)
(link . org-tufte-maybe-margin-note-link)
(quote-block . org-tufte-quote-block)
- (verse-block . org-tufte-verse-block)))
+ (verse-block . org-tufte-verse-block)
+ (section . org-tufte-section)))
+
+
+;;; Transcode sections without the div
+
+(defun org-tufte-section (section contents info)
+ "Transcode a SECTION element from Org to HTML.
+CONTENTS holds the contents of the section. INFO is a plist
+holding contextual information."
+ (let ((parent (org-export-get-parent-headline section)))
+ ;; Before first headline: no container, just return CONTENTS.
+ (if (not parent) contents
+ ;; Get div's class and id references.
+ (let* ((class-num (+ (org-export-get-relative-level parent info)
+ (1- (plist-get info :html-toplevel-hlevel))))
+ (section-number
+ (and (org-export-numbered-headline-p parent info)
+ (mapconcat
+ #'number-to-string
+ (org-export-get-headline-number parent info) "-"))))
+ (or contents "")))))
;;; Transcode Functions