From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Reyero Subject: Re: Need help exporting subtrees to html Date: Thu, 31 Dec 2009 14:50:23 +0100 Message-ID: <55bd243d0912310550u79d37a3dia3ec509f5f04aa03@mail.gmail.com> References: <55bd243d0912270834j73859a65veae0d06d39755257@mail.gmail.com> <3780C6B3-72F7-4438-8100-A307D9716857@gmail.com> <55bd243d0912271131r55927ec3w9edf16ff605f9f9c@mail.gmail.com> <773F1CE8-2EB7-4D29-BCD8-126C64EF6532@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQLQ7-0008No-QT for emacs-orgmode@gnu.org; Thu, 31 Dec 2009 08:50:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQLQ3-0008NC-5S for emacs-orgmode@gnu.org; Thu, 31 Dec 2009 08:50:31 -0500 Received: from [199.232.76.173] (port=37516 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQLQ2-0008N9-Vm for emacs-orgmode@gnu.org; Thu, 31 Dec 2009 08:50:27 -0500 Received: from mail-fx0-f228.google.com ([209.85.220.228]:64410) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQLQ2-00034Y-MK for emacs-orgmode@gnu.org; Thu, 31 Dec 2009 08:50:26 -0500 Received: by fxm28 with SMTP id 28so4083140fxm.26 for ; Thu, 31 Dec 2009 05:50:24 -0800 (PST) In-Reply-To: <773F1CE8-2EB7-4D29-BCD8-126C64EF6532@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: Carsten Dominik , org-mode Mailing List On Thu, Dec 31, 2009 at 9:15 AM, Carsten Dominik wrote: > On Dec 27, 2009, at 8:31 PM, Juan Reyero wrote: >> On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik >> wrote: >>> On Dec 27, 2009, at 5:34 PM, Juan Reyero wrote: >>>> I have written a function to export org-mode subtrees as jekyll posts, >>>> http://juanreyero.com/open/org-jekyll/ =A0The idea is that any entry i= n >>>> 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. =A0I 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? =A0I 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)) >> >> Thanks for your answer. =A0I've tried it, but now it exports the whole >> buffer, as if (outline-mark-subtree) didn't understand which subtree I >> am looking at. =A0I am doing this from within an (org-map-entries). =A0I= f >> I first narrow and then mark it doesn't work either: it complains of >> "Before first headline at position...". > > You are right, this does not work as I had hoped. =A0What needs to be > done is that the tree must be selected, and the region needs to be *activ= e* > when the export command is called. =A0I am not quite sure right now > how to do this in the middle of a Lisp program.... Looks like it is not going to be a small investment. For the time being I'll stick to writing blog posts as first-level entries, and I'll try to figure it out when I find some more time. Thank you very much for your answers. Cheers, Juan >> I have updated the tests at http://github.com/juanre/org-jekyll to >> reflect the problem. --=20 http://juanreyero.com/ http://unarueda.com