emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: html preamble
Date: Mon, 23 Mar 2015 21:28:07 +0100	[thread overview]
Message-ID: <87r3sf5ui0.fsf@gmx.us> (raw)
In-Reply-To: loom.20150323T204804-379@post.gmane.org

hymie! <hymie@lactose.homelinux.net> writes:

> So my next task is to learn about the HTML preamble.
>
> From reading the docs, it looks like all of my org files have to share a
> single HTML preamble, which is set in my .emacs file through either the
> org-html-preamble variable, the org-html-preamble-format variable, or the
> org-publish-project-alist variable.  There is no way to tell a specific Org
> file "This is your HTML preamble."  Is that correct?

That is incorrect (IMO).  On a file basis you can turn off most preamble
things via the relevant OPTIONS keyword.

On a project basis you could set the relevant variable.  See
org-publish-project-alist.

I guess you could make a clever function that sets the org-html-preamble
based on some heuristics and add it to one of hooks that are run before
parsing.  See e.g. org-export-before-parsing-hook.

> Why are there two different variables org-html-preamble-format and
> org-html-preamble if the org-html-preamble variable can perform all of the
> tasks of org-html-preamble-format and more?

org-html-preamble-format is a template, it seems, that is used by
org-html-preamble, which can also take a string or a function.  In
practice I always use org-html-preamble in ox-html projects.

> Finally, how do I get the current date into the preamble?  I see that I can
> specifically set a date, and I see the current date in a comment at the top
> of my exported HTML, but I can't figure out how to get the current date out
> of the comment and into my preamble.

Hmm.  Does %d or %C work? See org-html-postamble-format.

Hope it helps,
Rasmus

-- 
I almost cut my hair, it happened just the other day

  reply	other threads:[~2015-03-23 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 20:12 html preamble hymie!
2015-03-23 20:28 ` Rasmus [this message]
2015-03-24 15:19 ` Scott Randby

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=87r3sf5ui0.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /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).