emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nikolaos Chatzikonstantinou <nchatz314@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Some hacks on top of org-publish
Date: Thu, 26 Dec 2024 10:48:07 -0500	[thread overview]
Message-ID: <CAAQmekdGjp2KOFJcGzpRHEGOM4CQacRh3DS-39UK=jKr5OvusA@mail.gmail.com> (raw)
In-Reply-To: <87ikr7zxdj.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]

On Wed, Dec 25, 2024 at 8:47 AM 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:

  - Without italics: [[file:./index.org][index]], 2024-12-26 -- With
italics: [[file:./index.org][index]],
@@html:<i>@@2024-12-26@@html:</i>@@

Regards,
Nikolaos Chatzikonstantinou

[-- Attachment #2: index.org --]
[-- Type: text/org, Size: 874 bytes --]

* Hello world

This is a test.

#+begin_comment
Local Variables:
org-publish-project-alist:
  (("test-project"
    :components ("test-component"))
   ("test-component"
    :auto-sitemap t
    :base-directory "."
    :base-extension "org"
    :publishing-function org-html-publish-to-html
    :publishing-directory "public"
    :sitemap-format-entry
    (lambda (entry sitemap-style project)
      (let* ((title (org-publish-find-title entry project))
             (date (org-publish-find-date entry project))
             (date-s (format-time-string "%Y-%m-%d" date)))
        (format (concat "Without italics: [[./%s][%s]], @@html:<i>@@%s@@html:</i>@@"
                        " -- "
                        "With italics: [[./%s][%s]], @@html@@a:@@:<i>@@%s@@html@@a:@@:</i>@@")
                entry title date-s
                entry title date-s)))))
End:
#+end_comment

  reply	other threads:[~2024-12-26 15:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 17:45 Some hacks on top of org-publish Nikolaos Chatzikonstantinou
2024-12-25 13:48 ` Ihor Radchenko
2024-12-26 15:48   ` Nikolaos Chatzikonstantinou [this message]
2024-12-27 17:32     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAQmekdGjp2KOFJcGzpRHEGOM4CQacRh3DS-39UK=jKr5OvusA@mail.gmail.com' \
    --to=nchatz314@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).