From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Need help exporting subtrees to html Date: Sun, 27 Dec 2009 19:35:15 +0100 Message-ID: <3780C6B3-72F7-4438-8100-A307D9716857@gmail.com> References: <55bd243d0912270834j73859a65veae0d06d39755257@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NOxxf-0000a8-2k for emacs-orgmode@gnu.org; Sun, 27 Dec 2009 13:35:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NOxxa-0000ZX-IY for emacs-orgmode@gnu.org; Sun, 27 Dec 2009 13:35:26 -0500 Received: from [199.232.76.173] (port=60055 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NOxxa-0000ZT-D2 for emacs-orgmode@gnu.org; Sun, 27 Dec 2009 13:35:22 -0500 Received: from mail-fx0-f228.google.com ([209.85.220.228]:48676) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NOxxZ-0000z7-Nh for emacs-orgmode@gnu.org; Sun, 27 Dec 2009 13:35:22 -0500 Received: by fxm28 with SMTP id 28so1231635fxm.26 for ; Sun, 27 Dec 2009 10:35:20 -0800 (PST) In-Reply-To: <55bd243d0912270834j73859a65veae0d06d39755257@mail.gmail.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: Juan Reyero Cc: org-mode Mailing List On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote: > Greetings, > > I have written a function to export org-mode subtrees as jekyll posts, > http://juanreyero.com/open/org-jekyll/ The idea is that any entry in > an org-publish project that has a :blog: keyword and an :on: property > with a timestamp should be exported to a _posts directory with the > year-month-day-title.html that jekyll expects, with the properties as > front-matter. > > I was very happy with it, until I realized that the levels of the > headers in the exported file (h2, h3, etc) depend on the indentation > of the subtree in the outline. I wanted to be able to add a :blog: > subtree anywhere in my project's files, and get it always exported the > same, regardless of where in the outline it is. > > Is there any reasonably simple way to overcome this problem? I am > using: > > (org-narrow-to-subtree) > (setq html (org-export-as-html nil nil nil 'string t nil)) Hi Juan, Try this: (outline-mark-subtree) (setq html (org-export-as-html nil nil nil 'string t nil)) HTH - Carsten