diff options
Diffstat (limited to 'ox-tufte.el')
-rw-r--r-- | ox-tufte.el | 23 |
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 |