I know this is kind of an org-mode 101 question, sorry, but after searching docs for a couple of days, I could use a pointer. I want to write a function in a code block in python or perl that steps through lines of text and does some complicated reformatting, adding in html bits and such, for a specialized application. Then I want to be able paste a block of text into an org-mode file and call this function to walk through it and do it's stuff, sending the result to an export buffer.

What's the best way to do that, specifically, what should I do with the text to be processed? Put it all under a single headline and call the function against that headline? Put it within some sort of begin/end markers? I need the python or whatever script to be able to step through one line at a time maybe using it's usual text input functions.

Thanks,
maab

--
====================================
Michael Baum <maabaum@gmail.com>

You should never have your best trousers on when you go out
 to fight for freedom and truth. - Ibsen