From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Pechiar Subject: Re: Change DOCTYPE declaration? Date: Wed, 17 Nov 2010 19:45:06 -0200 Message-ID: <20101117214505.GH2450@soloJazz.com> References: <20101117130409.773797d2amscopub-mail@yahoo.com@dove.localdomain> <20101117183427.GG2450@soloJazz.com> <20101117152308.63473cd6amscopub-mail@yahoo.com@dove.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=58295 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIpou-00032P-3h for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 16:45:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIpoV-0002vg-Ep for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 16:45:12 -0500 Received: from cpoproxy1-pub.bluehost.com ([69.89.21.11]:43030) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PIpoV-0002vS-7t for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 16:45:11 -0500 Content-Disposition: inline In-Reply-To: <20101117152308.63473cd6amscopub-mail@yahoo.com@dove.localdomain> 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: Uriel Avalos Cc: emacs-orgmode@gnu.org Yo can set variables on a per-file basis. Check EXPORT OPTIONS on the manual. You can set variables there (but not add hooks), so maybe something like this works: #+begin_src emacs-lisp ;; in your .emacs file: (add-hook 'org-export-html-final-hook (lambda () (if ( (boundp 'uriel-change-doctype) ) (let ((kill-whole-line t)) (goto-char (point-min)) (next-line) (kill-line 2) (insert "\n") ) ) ) ) #+end_src So the hook body will only execute if uriel-change-doctype is bound to some value. Then, on your document, include #+BIND uriel-change-doctype t Not tested, good luck! .j. On Wed, Nov 17, 2010 at 03:23:08PM -0500, Uriel Avalos wrote: > Thanks for the reply. After some monkeying around, I found I could do this: > > (add-hook 'org-export-html-final-hook > (lambda () > (let ((kill-whole-line t)) > (goto-char (point-min)) > (next-line) > (kill-line 2) > (insert "\n") > ) > ) > ) > > To undo it, I can call this: > > (setq org-export-html-final-hook nil) > > However, one question, the above sets the doctype GLOBALLY. Is there > a way to do set this automagically per file? (I.e., some kind of > file-specific export option) > > Juan Pechiar wrote: > > > The DOCTYPE declaration is hardcoded inside org-html.el > > > > You may change it by defining a hook and modifying the generated HTML. > > Have a look at the following message, where they get rid of the > > declaration: > > > > http://lists.gnu.org/archive/html/emacs-orgmode/2010-06/msg00063.html > > > > you may add some 'insert' there with your own declaration. > > > > On Wed, Nov 17, 2010 at 01:04:09PM -0500, Uriel Avalos wrote: > > > How do I change the doctype declaration?