[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
org-publish producing <nil> element tags instead of honoring what is spe
From: |
Cooper Oscarfono |
Subject: |
org-publish producing <nil> element tags instead of honoring what is specified in :html-divs |
Date: |
Thu, 30 Mar 2023 18:27:46 +1300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
Greetings,
New to the list, and this is my first post. I hope it's ok.
I'm experiencing an issue when trying to use org-publish.
In attempting to convert the divs generated for preamble, content, and
postamble, by specifying, what I believe to be the appropriate setting
within org-publish-project-alist :
:html-divs '((preamble "header" :id "preamble")
(content "main" :id "content")
(postamble "footer" :id "postamble"))
Instead of generating <header id="preamble"...</header>, <main
id="content">...</main>, and <footer id="postamble">...</footer>, as
expected, I am generating: <nil id="nil" class="status">...</nil>, <nil
id="nil" class="content">...</nil>, and <nil id="nil"
class="status">...</nil>, respectively.
This also happens when I use this approach instead:
:html-divs '((preamble . "<header id=\"preamble\">")
(content "<main id=\"content\">")
(postamble "<footer id=\"postamble\">"))
I am doing a slightly weird thing in that I am using the following code
to pull in a header.org and footer.org file, and extract the html code
contained within using org-export and add these values to the
appropriate :html-{preamble,postamble} variables as shown below:
This is the function:
(defun get-org-component-contents (component)
"Retrieve the HTML contents of the specified org component."
(with-temp-buffer
(insert-file-contents (concat "./components/" component ".org"))
(org-export-to-buffer 'html "*Org HTML Export*" nil nil nil t)
;; (insert-file-contents (concat "./components/" component
".html"))
(buffer-string)))
and I set the variables:
(setq header-contents (get-org-component-contents "header"))
(setq footer-contents (get-org-component-contents "footer"))
then define them into the org-publish-project-alist like so:
:html-preamble ,header-contents
:html-postamble ,footer-contents
This works seemlessly when I don't try to change the :html-div elements.
Is this me doing something wrong here or could this be a potential issue
with org-publish?
I'm trying to achieve some modularity to the way i do things and must
confess, i've only recently begun to start wrapping my head around
emacs-lisp, so it's more likely to be a me problem.
Any pointers you can offer are appreciated.
Regards,
Cooper.
OpenPGP_0xFE14D7FDC31BFF50.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
- org-publish producing <nil> element tags instead of honoring what is specified in :html-divs,
Cooper Oscarfono <=