all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Ability to add logo to HTML export
@ 2023-03-23 16:14 Vladimir Alexiev
  2023-03-24 11:54 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Alexiev @ 2023-03-23 16:14 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1385 bytes --]

Some projects have a logo, which one may want to add to the beginning of a
HTML document.
Eg like this (before authors and Title):
[image: image.png]

Right now I have to resort to a bad kludge to do that: a local variable in
the org file:

#+comment: -*- org-html-preamble: "<p class='author'>Author:
%a<br/>(%e)</p><p class='date'>Date: %d</p><p><img
src='./img/SemBSDD-Logo-400px.png'/></p>" -*-

And also this in my org setup:

(put 'org-html-preamble 'safe-local-variable 'stringp)

I looked at

(org-export-define-backend 'html
  :options-alist
    (:html-preamble nil "html-preamble" org-html-preamble)

and the help for org-export-options-alist:
this word "html-preamble" corresponds to:

OPTION is a string that could be found in an #+OPTIONS: line.

So I tried this, but it had no effect"

#+OPTION: html-preamble: "<p class='author'>Author: %a<br/>(%e)</p><p
class='date'>Date: %d</p><p><img src='./img/SemBSDD-Logo-400px.png'/></p>"

Minor note: normally, I distribute the standard variables between preamble
and postamble as follows:

(setq
 org-html-preamble-format '(("en" "<p class=\"author\">Author: %a (%e)</p>
<p class=\"date\">Date: %d</p>"))
 org-html-postamble t                   ; was 'auto which inserts author,
date: but I want those in preamble
 org-html-postamble-format  '(("en" "<p class=\"creator\">Exported by %c</p>
<p class=\"validation\">%v</p>"))
)

[-- Attachment #1.2: Type: text/html, Size: 2236 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 55404 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ability to add logo to HTML export
  2023-03-23 16:14 Ability to add logo to HTML export Vladimir Alexiev
@ 2023-03-24 11:54 ` Ihor Radchenko
  2023-03-24 13:43   ` Vladimir Alexiev
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-03-24 11:54 UTC (permalink / raw)
  To: Vladimir Alexiev; +Cc: emacs-orgmode

Vladimir Alexiev <vladimir.alexiev@ontotext.com> writes:

> Right now I have to resort to a bad kludge to do that: a local variable in
> the org file:
>
> #+comment: -*- org-html-preamble: "<p class='author'>Author:
> %a<br/>(%e)</p><p class='date'>Date: %d</p><p><img
> src='./img/SemBSDD-Logo-400px.png'/></p>" -*-

If you have good ideas how to improve `org-html--build-pre/postamble',
patches welcome.

> So I tried this, but it had no effect"
>
> #+OPTION: html-preamble: "<p class='author'>Author: %a<br/>(%e)</p><p
> class='date'>Date: %d</p><p><img src='./img/SemBSDD-Logo-400px.png'/></p>"

OPTION_S_ and you cannot have space after html-preamble: _

Try

#+OPTIONS: html-preamble:"<p class='author'>Author: %a<br/>(%e)</p><p class='date'>Date: %d</p><p><img src='./img/SemBSDD-Logo-400px.png'/></p>"

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ability to add logo to HTML export
  2023-03-24 11:54 ` Ihor Radchenko
@ 2023-03-24 13:43   ` Vladimir Alexiev
  2023-03-24 14:06     ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Alexiev @ 2023-03-24 13:43 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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

#+OPTIONS: html-preamble:"<p class='author'>Author: %a<br/>(%e)</p><p
class='date'>Date: %d</p><p><img src='./img/SemBSDD-Logo-400px.png'/></p>"

C-c happily says "Local setup has been refreshed"

But then C-c C-e h h complains: "org-export--parse-option-keyword: End of
file during parsing".
I don't see any problem in the string; evaluating it in *scratch* returns
it just fine.
But I think  org-export--parse-option-keyword uses some limited reader...

[-- Attachment #2: Type: text/html, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ability to add logo to HTML export
  2023-03-24 13:43   ` Vladimir Alexiev
@ 2023-03-24 14:06     ` Ihor Radchenko
  2023-03-26 20:05       ` Vladimir Alexiev
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-03-24 14:06 UTC (permalink / raw)
  To: Vladimir Alexiev; +Cc: emacs-orgmode

Vladimir Alexiev <vladimir.alexiev@ontotext.com> writes:

> But then C-c C-e h h complains: "org-export--parse-option-keyword: End of
> file during parsing".

Please update Org mode.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Ability to add logo to HTML export
  2023-03-24 14:06     ` Ihor Radchenko
@ 2023-03-26 20:05       ` Vladimir Alexiev
  0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Alexiev @ 2023-03-26 20:05 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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

Thanks, that works!

On Fri, Mar 24, 2023 at 4:04 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Vladimir Alexiev <vladimir.alexiev@ontotext.com> writes:
>
> > But then C-c C-e h h complains: "org-export--parse-option-keyword: End of
> > file during parsing".
>
> Please update Org mode.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> 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>
>

[-- Attachment #2: Type: text/html, Size: 1182 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-26 20:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 16:14 Ability to add logo to HTML export Vladimir Alexiev
2023-03-24 11:54 ` Ihor Radchenko
2023-03-24 13:43   ` Vladimir Alexiev
2023-03-24 14:06     ` Ihor Radchenko
2023-03-26 20:05       ` Vladimir Alexiev

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.