From mboxrd@z Thu Jan 1 00:00:00 1970 From: Uriel Avalos Subject: Re: Change DOCTYPE declaration? Date: Thu, 18 Nov 2010 10:35:50 -0500 Message-ID: <7261.58415568552$1290094726@news.gmane.org> References: <20101117130409.773797d2amscopub-mail@yahoo.com@dove.localdomain> <20101117183427.GG2450@soloJazz.com> <20101117152308.63473cd6amscopub-mail@yahoo.com@dove.localdomain> <20101117214505.GH2450@soloJazz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=54751 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ6WX-0004Lv-Pr for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:35:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ6WW-00042N-EP for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:35:45 -0500 Received: from smtp101.prem.mail.sp1.yahoo.com ([98.136.44.56]:31965) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PJ6WV-00041V-W6 for emacs-orgmode@gnu.org; Thu, 18 Nov 2010 10:35:44 -0500 In-Reply-To: <20101117214505.GH2450@soloJazz.com> 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@gnu.org On Wed, 17 Nov 2010 19:45:06 -0200 Juan Pechiar wrote: > 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? Great. It's working like a charm. If uriel-change-doctype is not defined, it leaves the doctype alone. Otherwise, it changes it. (Note that there's a small typo in the code, an extra parentheses before var but it otherwise works very well.) Thanks! The only problem is that #+BIND is not working. I tried setting org-export-allow-BIND to t and it still does not work. Ideas?