On Mon, Dec 30, 2024 at 1:12 PM Ihor Radchenko <yanta...@posteo.net> wrote:
>
> Nikolaos Chatzikonstantinou <nchatz...@gmail.com> writes:
>
> > ... I got inspired by Worg's website
> > which does not do any backend hacking as far as I can tell, but
> > instead puts some javascript to collapse the table of contents.
>
> WORG does not use JS. The TOC is implemented using pure CSS.
>
> > Do you have a particular backend for me to look at as a recommendation
> > of an easy source? I don't want it to be derived because I want to
> > understand the whole process.
>
> Try ox-org.

Hello Ihor,

I'm still struggling with the basics of derived backends. Here's what
I have so far: 
<https://github.com/createyourpersonalaccount/blorg/blob/main/blorg.el>.

I am simply trying to transcode italic elements so that they're
treated differently on headers (with <i>) and in body (with <em>). How
can I accomplish this? My function is (straight from ox-html.el):

#+begin_src elisp
(defun blorg-html-italic (_italic contents info)
  "Transcode ITALIC from Org to HTML for a blog.
Italicize if in title, otherwise emphasize."
  (format
   (or (cdr (assq 'italic (plist-get info :html-text-markup-alist))) "%s")
   contents))
#+end_src

I cannot tell what the three arguments _italic, contents, info are
for, even after reading the docs, and after inspecting them with
edebug. Do I need to understand Org ASTs? Do I need to understand
Org-publish better? I'm just at loss here.

Specifically, how do I obtain the contextual information that tells me
whether I'm a headline or in body?
More generally, how do I understand these arguments contents?

Thank you for your help.

Regards,
Nikolaos Chatzikonstantinou

Reply via email to