On Wed, Dec 25, 2024 at 8:47 AM Ihor Radchenko <yanta...@posteo.net> wrote: > > Nikolaos Chatzikonstantinou <nchatz...@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.
I should probably try to do this, but 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. If you check my blog now, it looks almost OK in mobile phones. I do want to write the backend stuff, but it feels like such a chore. The ox-latex.el (which the manual gives as an example of a not-derived backend) is a bit overengineered for my taste, in the sense that I need to pay a lot of attention to figure it out. 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. Regards, Nikolaos Chatzikonstantinou