[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some hacks on top of org-publish
From: |
Nikolaos Chatzikonstantinou |
Subject: |
Re: Some hacks on top of org-publish |
Date: |
Sat, 28 Dec 2024 23:17:53 -0500 |
On Fri, Dec 27, 2024 at 12:31 PM Ihor Radchenko <yantar92@posteo.net> wrote:
>
> Nikolaos Chatzikonstantinou <nchatz314@gmail.com> writes:
>
> >> > Finally a highlight of the hacks I had to pull off: apparently
> >> > #+INCLUDE: will strip away inline backend information such as
> >> > @@html:<b>@@. I figured out that if I write something like
> >> > @@html@@a:@@:<b>@@, only the inner @@a:@@ is recognized and stripped,
> >> > which leaves me with what I originally wanted! (see
> >> > <https://github.com/createyourpersonalaccount/blog-v2/blob/main/content/publish.el#L14-L20>)
> >>
> >> May you show more concrete example?
> >> #+INCLUDE by itself does not remove export snippets.
> >
> > It must not be #+INCLUDE then, but sitemap.org generation itself, I
> > misremembered when I wrote the e-mail. Here's a reproducer, see
> > attachment. Have this index.org file in its own directory and publish
> > it. Then view public/sitemap.html. You will see that the @@BACKEND:@@
> > stuff has been stripped away in the first sitemap entry instance,
> > while in the second it is there. When inspecting the generated
> > sitemap.org you will see the following line:
>
> I see.
> What happens here is double export:
> 1. The default `org-publish-sitemap-default' first exports the sitemap
> items to Org file
> 2. The resulting Org file is exported to html
>
> During the first step, @@html:...@@ is stripped because we export to
> org.
>
> You may want to use a custom :sitemap-function.
That makes sense. The org backend strips the HTML backend. You're
right, I should be using a custom :sitemap-function (didn't realize
there was one). Well, my hack for now remains. I might fix it later
down the road.
Regards,
Nikolaos Chatzikonstantinou