emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Nikolaos Chatzikonstantinou <nchatz314@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Some hacks on top of org-publish
Date: Wed, 25 Dec 2024 13:48:56 +0000	[thread overview]
Message-ID: <87ikr7zxdj.fsf@localhost> (raw)
In-Reply-To: <CAAQmekfjUahNJB4XRm9pyji0eu66UCVV=8C8G1yX0mdRRDw00A@mail.gmail.com>

Nikolaos Chatzikonstantinou <nchatz314@gmail.com> writes:

> 3) Source code blocks + colors (server-side; not a .js coloring client-side)

Note that ox-html can fontify src blocks by itself. Via htmlize + CSS styles.

> 1) I got colors in source blocks by post-processing with node.js +
> highlight.js the raw HTML. Is it possible to write my own backend that
> feeds the source block into my node app?

Yes, of course. See my next answers. The whole export proces is hackable
on multiple levels.

> 2) I got several issues with how the org files are exported as HTML,
> for example I may want to insert an <article> tag, I may want a div
> around content and a div around nav bar, etc. Not everything can be
> solved with #+HTML: tags because I don't have precise control of where
> those go. Can the HTML backend be edited or do I have to write my own
> backend?

Check out https://orgmode.org/manual/Advanced-Export-Configuration.html

> 3) I am very inexperienced with org backends. What good resources are
> out there for this subject?

See https://orgmode.org/manual/Adding-Export-Backends.html
Org export backends can use inheritance. So, if you need to re-define a
part of backend (if filters are not enough), you can always create a
"subclass" by creating a "derived" backend.

> 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.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2024-12-25 13:48 UTC|newest]

Thread overview: 2+ 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 [this message]

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=87ikr7zxdj.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=nchatz314@gmail.com \
    /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).