From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Dynamix HTML preamble/postamble Date: Thu, 04 Dec 2008 08:12:44 -0800 Message-ID: <87skp3dimb.fsf@gmail.com> References: <87d4g82eq9.fsf@z.nozav.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8GoM-0005d2-FL for emacs-orgmode@gnu.org; Thu, 04 Dec 2008 11:12:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8GoL-0005cb-Qo for emacs-orgmode@gnu.org; Thu, 04 Dec 2008 11:12:18 -0500 Received: from [199.232.76.173] (port=46513 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8GoL-0005cW-I9 for emacs-orgmode@gnu.org; Thu, 04 Dec 2008 11:12:17 -0500 Received: from rn-out-0910.google.com ([64.233.170.187]:50455) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L8GoL-0005bi-8o for emacs-orgmode@gnu.org; Thu, 04 Dec 2008 11:12:17 -0500 Received: by rn-out-0910.google.com with SMTP id k32so3763054rnd.7 for ; Thu, 04 Dec 2008 08:12:16 -0800 (PST) In-Reply-To: <87d4g82eq9.fsf@z.nozav.org> (Julien Barnier's message of "Thu, 04 Dec 2008 15:32:14 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Julien Barnier Cc: emacs-orgmode@gnu.org Julien Barnier writes: > Hi, > > I'm currently migrating a bunch of files from Muse to Org (not that > Muse was not a good project, but I'd like to minimize the number of > keyboard shortcuts to remember :-) ). > > One thing that I miss in Org is the ability to dynamically generate > the pramble and postamble during HTML (or LaTeX) export. In muse you > can provide a lisp function that is evaluated per file and which is > able to access file options with muse-publishing-directive. > > Is there a contrib or a method to do such a thing in Org mode ? > Hi Julien, There is `org-export-preprocess-hook' which is run over your org file before the file is exported (to latex, html, or ascii). ,----`org-export-preprocess-hook' | org-export-preprocess-hook is a variable defined in `org-exp.el'. | Its value is | (org-export-blocks-preprocess) | | | Documentation: | Hook for preprocessing an export buffer. | Pretty much the first thing when exporting is running this hook. `---- If you add a function to this hook it would have access to the parameters set in the org file through the `parameters' alist, see `org-export-preprocess-string' in org-exp.el for more information. As for changing the preamble and postamble, I don't know if these are variables which could simply be overridden (which would be nice), or if you would want to insert these in the buffer inside of #+begin/end_html blocks. If you come up with a generally useful function please be sure to share it. Good luck -- Eric