From 07555a3a3167d15b31c832db84cad09481d6ca5b Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 31 Mar 2022 18:43:33 +0100 Subject: Remove div from section generation --- ox-tufte.el | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 -- cgit