I want to defined a new export backend derived from org-html-export backend in order to remove the divs that appear in the code (something like slimhtml but a little less drastic) and maybe later I want to change the styling a bit with some other html, my first attempt is just to remove divs.
My attempt was to do this
(defun my-org-html-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) "-"))))
;; Build return value.
(format "%s"
(or contents ""))))))
;;;###autoload
(defun my-org-html-export-to-html
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer to a HTML file.
If narrowing is active in the current buffer, only export its
narrowed part.
Return output file's name."
(interactive)
(let* ((extension (concat "." (or (plist-get ext-plist :html-extension)
org-html-extension
"html")))
(file (org-export-output-file-name extension subtreep))
(org-export-coding-system org-html-coding-system))
(org-export-to-file 'html file
async subtreep visible-only body-only ext-plist)))
(org-export-define-derived-backend 'my-html 'html
:translate-alist '((section . my-org-html-section))
:menu-entry '(?s "Export to html"
((?H "As html buffer" my-org-html-export-to-html))))
which is an alteration of org-mode-export
But when I export I still get the divs. Any idea why my custom export does not use the custom section ? I am still new to elisp.
my-org-html-export-to-html
?