From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: org-publish Date: Wed, 20 Aug 2008 11:18:21 +0200 Message-ID: <877iacrqn6.fsf@kassiopeya.MSHEIMNETZ> References: <1219205093.20415.7.camel@pod.lab> 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 1KVjnw-0006iq-GW for emacs-orgmode@gnu.org; Wed, 20 Aug 2008 05:16:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVjnv-0006iM-8T for emacs-orgmode@gnu.org; Wed, 20 Aug 2008 05:16:35 -0400 Received: from [199.232.76.173] (port=53411 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVjnv-0006iF-4B for emacs-orgmode@gnu.org; Wed, 20 Aug 2008 05:16:35 -0400 Received: from mail.gmx.net ([213.165.64.20]:33549) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KVjnu-0003ld-JY for emacs-orgmode@gnu.org; Wed, 20 Aug 2008 05:16:34 -0400 In-Reply-To: <1219205093.20415.7.camel@pod.lab> (David O'Toole's message of "Wed, 20 Aug 2008 00:04:53 -0400") 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: emacs-orgmode Mailinglist Hi David, here are some solutions I could come up with. Maybe one of them is helpful. * Customize org M-x customize-variable org-export-html-extension and set it to 'php'? * Apache: use mod_mime or add-handler You could also use the add-handler directive in your apache config file or (maybe) .htaccess files to execute your *.html files as PHP. See: http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler or: http://httpd.apache.org/docs/2.2/mod/mod_mime.html * Apache and mod_rewrite You might also set up a .htaccess file like this: RewriteEngine on RewriteBase / RewriteRule ^(.*)$ passthrough.php$1 [L] if you put all your *.html files exported by org into a subdirectory called org, passthrough.php will be called with the path to that file relative to /org/. $PATH_INFO = "org".getenv('PATH_INFO'); // not tested get's you that relative path (you'll have to strip '#target' and '?querystring' though). Now you can open the file, read it line by line and replace what ever you like (add custom headers and footers...). Keep in mind, that the exported files are valid XHTML so might want to use some XML related technique to parse and change the files on the fly. Regards, Sebastian David O'Toole writes: > I have some ideas for changes to org-publish. I am helping someone set > up a content-heavy site using Emacs and Org-Mode, and we ran into > several problems that I would like to fix. We have workarounds in place > but these immediately suggested interesting fixes. For example it > doesn't seem possible to publish to .PHP files but maybe I missed > something. I need to reread the code because there seem to have been > many changes since I last looked at it. Furthermore it did not seem > possible to control :auto-preamble and :auto-postamble on a per-file > basis (without setting up a special project just for that one file and > using include/exclude.) Anyone mind if I make some changes and send a > patch? Is there a more recent version than the one in CVS that i should > begin with? -- Sebastian Rose, Hannover, Germany Phone: +49 173 83 93 417 Mail.: sebatian_rose@gmx.de, s.rose@emma-stil.de