From: "Eric Schulte" <schulte.eric@gmail.com>
To: Richard KLINDA <rklinda@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: publish regression: body-only (with patch)
Date: Sun, 24 May 2009 16:05:37 -0700 [thread overview]
Message-ID: <m263fqumny.fsf@gmail.com> (raw)
In-Reply-To: <87r5yeywta.fsf@gmail.com> (Richard KLINDA's message of "Mon, 25 May 2009 00:12:49 +0200")
Richard KLINDA <rklinda@gmail.com> writes:
>>>>>> Regarding 'Re: [Orgmode] publish regression: body-only (with patch)'; Carsten Dominik adds:
>
>
> > Hi Richard, this feature has never existed as something usable from
> > publishing. Can you provide a realistic case when something like
> > this would be useful?
>
> Oh, then my patch did not make it into org back then.:) I am going to
> use org just to render the "content" part of my site, the menus, comment
> section, tag cloud, interlinking (by date, topic etc) will be generated
> by a CMS.
>
> As I think about it, it seems fairly trivial just to rip out the
> <body>(...)</body> part of the generated HTML, so I'm ready to accept if
> you don't want this into org.
I also find the need to extract just the body portion of exported html
pages. This is done in blorgit[1], if you don't mind using ruby for
your extraction the following may prove useful (extracts body optionally
including the title and postamble).
#+begin_src ruby
def to_html(h_path, options = {})
html = File.read(h_path)
return html if options[:full_html]
# extract the body portion
start_body = (html =~ /<body>/) + 6
end_body = (html =~ /<\/body>/) - 1
body = html[(start_body..end_body)]
body = options[:postamble] ? body : body[(0..(body.index("<div id=\"postamble\">") - 1))]
options[:title] ? body : body.sub(/<h1.*\/h1>/i,'')
end
#+end_src
Cheers -- Eric
[1] http://orgmode.org/worg/blorgit.php
next prev parent reply other threads:[~2009-05-24 23:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-24 16:50 publish regression: body-only (with patch) Richard KLINDA
2009-05-24 21:59 ` Carsten Dominik
2009-05-24 22:12 ` Richard KLINDA
2009-05-24 23:05 ` Eric Schulte [this message]
2009-05-25 14:02 ` Carsten Dominik
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m263fqumny.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=rklinda@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.