From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: html preamble Date: Mon, 23 Mar 2015 21:28:07 +0100 Message-ID: <87r3sf5ui0.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8xT-0001JN-Cq for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 16:28:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya8xP-0000TH-AV for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 16:28:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:49050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya8xP-0000Sq-3V for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 16:28:19 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ya8xL-000696-Tb for emacs-orgmode@gnu.org; Mon, 23 Mar 2015 21:28:16 +0100 Received: from 46.166.188.227 ([46.166.188.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Mar 2015 21:28:15 +0100 Received: from rasmus by 46.166.188.227 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Mar 2015 21:28:15 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org hymie! 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