* parsing formatted text
@ 2010-10-29 7:50 Aidan Gauland
2010-10-29 8:19 ` Eric Schulte
0 siblings, 1 reply; 4+ messages in thread
From: Aidan Gauland @ 2010-10-29 7:50 UTC (permalink / raw)
To: emacs-orgmode
Hello,
I have written an elisp program to generate an ATOM feed from an
org-mode file. I want to generate appropiate HTML from fromatted text
(such as *bold* and /italic/). Since it does not use org's export
module (for which this isn't really appropriate anyway), I have no
idea if there is any way I can use existing org functions to parse a
paragraph to recognise formatted text so I can process it
appropriately, or if I must write my own parsing code. Can any of the
more experienced org-mode hackers offer any advice?
Thanks,
Aidan Gauland
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: parsing formatted text
2010-10-29 7:50 parsing formatted text Aidan Gauland
@ 2010-10-29 8:19 ` Eric Schulte
2010-10-29 8:58 ` Aidan Gauland
2010-10-29 19:59 ` Aidan Gauland
0 siblings, 2 replies; 4+ messages in thread
From: Eric Schulte @ 2010-10-29 8:19 UTC (permalink / raw)
To: Aidan Gauland; +Cc: emacs-orgmode
Hi Aidan,
You could pass the text through the `org-export-string' function to
generate a string of HTML from a string of Org markup.
e.g.
(org-export-string "plain plain *bold* plain" "html")
returns the following string
"<p>plain plain <b>bold</b> plain</p>"
-- Eric
Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> Hello,
>
> I have written an elisp program to generate an ATOM feed from an
> org-mode file. I want to generate appropiate HTML from fromatted text
> (such as *bold* and /italic/). Since it does not use org's export
> module (for which this isn't really appropriate anyway), I have no
> idea if there is any way I can use existing org functions to parse a
> paragraph to recognise formatted text so I can process it
> appropriately, or if I must write my own parsing code. Can any of the
> more experienced org-mode hackers offer any advice?
>
> Thanks,
> Aidan Gauland
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: parsing formatted text
2010-10-29 8:19 ` Eric Schulte
@ 2010-10-29 8:58 ` Aidan Gauland
2010-10-29 19:59 ` Aidan Gauland
1 sibling, 0 replies; 4+ messages in thread
From: Aidan Gauland @ 2010-10-29 8:58 UTC (permalink / raw)
To: emacs-orgmode
Eric Schulte <schulte.eric <at> gmail.com> writes:
> You could pass the text through the `org-export-string' function to
> generate a string of HTML from a string of Org markup.
>
> e.g.
>
> (org-export-string "plain plain *bold* plain" "html")
>
> returns the following string
>
> "<p>plain plain <b>bold</b> plain</p>"
Thanks! That's just what I was looking for!
--Aidan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: parsing formatted text
2010-10-29 8:19 ` Eric Schulte
2010-10-29 8:58 ` Aidan Gauland
@ 2010-10-29 19:59 ` Aidan Gauland
1 sibling, 0 replies; 4+ messages in thread
From: Aidan Gauland @ 2010-10-29 19:59 UTC (permalink / raw)
To: emacs-orgmode
Eric Schulte <schulte.eric <at> gmail.com> writes:
> You could pass the text through the `org-export-string' function to
> generate a string of HTML from a string of Org markup.
>
> e.g.
>
> (org-export-string "plain plain *bold* plain" "html")
>
> returns the following string
>
> "<p>plain plain <b>bold</b> plain</p>"
Actually, now that I've tried that, I'm getting prompted for a
filename when I evaluate that.
Evaluating (org-export-string "plain plain *bold* plain" "html")
prompts me (in the minibuffer) with...
File to save in: /tmp/
I can't see any obvious s-exp in the definition of org-export-string
that would be bringing up the prompt. Aside from the prompt, this
function is exactly what I want. Any idea how I could get rid of the
prompt so I can run the function non-interactively?
--Aidan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-29 19:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-29 7:50 parsing formatted text Aidan Gauland
2010-10-29 8:19 ` Eric Schulte
2010-10-29 8:58 ` Aidan Gauland
2010-10-29 19:59 ` Aidan Gauland
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).