Page 1 of 1

Textile - convert text to XHTML

Posted: Fri Feb 27, 2004 4:47 pm
by BenPollinger
Hello all,

I'd like to see a macro (or similar plugin) to work like Textile:
http://textism.com/tools/textile/?sample=2

Basically, Textile converts simple tags (like BBcode) and produces valid XHTML.

For example, it turns this text:

Code: Select all

* Point one
* Point two
## Step 1
## Step 2
## Step 3
* Point three
** Sub point 1
** Sub point 2
into valid XHTML:

Code: Select all

<ul>
	<li>Point one</li>
		<li>Point two
	<ol>
	<li>Step 1</li>
		<li>Step 2</li>
		<li>Step 3</li>
	</ol>
	</li>
		<li>Point three
	<ul>
	<li>Sub point 1</li>
		<li>Sub point 2</li>
	</ul></li>
	</ul>
At present, it's only available as a script (PHP? JS?) but it should be do-able in TextPad.

Any ideas on how to start?

regards,
Ben

Posted: Sat Feb 28, 2004 12:41 am
by gracefool
This doesn't need to be a built-in feature of Textpad. Just make your own scrupt (in Textpad, if you want) and launch it with a user-defined tool in textpad. Easy.

Posted: Sat Feb 28, 2004 2:01 pm
by BenPollinger
Hello, thanks for the reply.

I wasn't suggesting it be built in to TextPad - perhaps I put this in the wrong bit of the forum.

Can you point me to any resources for writing scripts to do this sort of thing in TextPad? I know the basis will be several search/replace and regex functions, but not sure how to build it all into one reliable script.

Thanks again,
Ben