[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] convert region to html?

From: Carsten Dominik
Subject: Re: [Orgmode] convert region to html?
Date: Sun, 20 May 2007 17:17:52 +0200

On May 19, 2007, at 3:17, David O'Toole wrote:

I am working on my blog extension for org-publish. I would like to
convert a region of text (say, between two markers) from org-mode
markup into html and then paste the resulting html into another buffer
where I am building a full page. I need to do this from a lisp
program. It says that org-export-as-html will export an active region
but I tried it and it doesn't work in a temp-buffer where
(buffer-file-name) is nil. Anyway, would it be hard to expose a
function like the following?

(defun org-export-region-to-html (beg end)
  "Convert region between BEG and END into HTML, placing the result
  into a new buffer. The new buffer is returned."

Thanks for this idea, will be useful for many things.

- Carsten

4.75 will contain the following function:

(defun org-export-region-as-html (beg end &optional body-only buffer)
  "Convert region fron BEG to END in org-mode buffer to HTML.
If prefix arg BODY-ONLY is set, omit file header, footer, and table of
contents, and only produce the region of converted text, useful for
cut-and-paste operations.
If BUFFER is a buffer or a string, use/create that buffer as a target
of the converted HTML.  If BUFFER is the symbol `string', return the
produced HTML as a string and leave no buffer behind.  For example,
a Lisp program could call this function in the following way:

  (setq html (org-export-region-as-html beg end t 'string))

When called interactively, the output buffer is selected, and shown
in a window.  A non-interactive call will only retunr the buffer."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]