emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-publish


From: Sebastian Rose
Subject: Re: [Orgmode] org-publish
Date: Wed, 20 Aug 2008 11:18:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

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:



    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteBase   /
      RewriteRule   ^(.*)$ passthrough.php$1 [L]
    </IfModule>

  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 <address@hidden> 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.: address@hidden, address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]