emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Juan Reyero <joanmg@gmail.com>
To: Carsten Dominik <carsten.dominik@gmail.com>,
	org-mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: Need help exporting subtrees to html
Date: Sun, 27 Dec 2009 20:31:36 +0100	[thread overview]
Message-ID: <55bd243d0912271131r55927ec3w9edf16ff605f9f9c@mail.gmail.com> (raw)
In-Reply-To: <3780C6B3-72F7-4438-8100-A307D9716857@gmail.com>

Hi Carsten,

On Sun, Dec 27, 2009 at 7:35 PM, Carsten Dominik
<carsten.dominik@gmail.com> 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/  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))

Thanks for your answer.  I've tried it, but now it exports the whole
buffer, as if (outline-mark-subtree) didn't understand which subtree I
am looking at.  I am doing this from within an (org-map-entries).  If
I first narrow and then mark it doesn't work either: it complains of
"Before first headline at position...".

I have updated the tests at http://github.com/juanre/org-jekyll to
reflect the problem.

Best,

Juan
-- 
http://juanreyero.com/
http://unarueda.com

  reply	other threads:[~2009-12-27 19:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-27 16:34 Need help exporting subtrees to html Juan Reyero
2009-12-27 18:35 ` Carsten Dominik
2009-12-27 19:31   ` Juan Reyero [this message]
2009-12-31  8:15     ` Carsten Dominik
2009-12-31 13:50       ` Juan Reyero
2009-12-31 17:15         ` Eric Schulte
2009-12-31 17:17           ` Eric Schulte
2009-12-31 18:02           ` Juan Reyero
2009-12-31 19:51             ` Eric Schulte
2010-01-01 13:33               ` Juan Reyero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55bd243d0912271131r55927ec3w9edf16ff605f9f9c@mail.gmail.com \
    --to=joanmg@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).