Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-09 12:03:39

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Textile Generator

Hi, I’m wanting to recreate this: http://www.textism.com/tools/textile/ on my site, as I want to allow people to get Textile help on my own site, but I have no idea how to create it. Could someone provide the source for it? Thanks. x


~ Cameron

Offline

#2 2008-09-09 14:33:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: Textile Generator

Your write pane in the txp back-end already has this built in: the yellow tabs down the side of the body pane.

BTW: that’s an older implementation of textile. A more recent one is on http://textile.thresholdstate.com/ (though may no also no longer be the most recent version.

If you still want to do your own mash-up of it, upm_textile will parse a text string using the textile interpreter and output it als HTML. You just need to output it into a textarea or as code.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-09-09 14:39:45

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Textile Generator

Thanks for the reply, but I’m still super confused :P
I don’t want to use any Plugins for the page, rather just an index.php file and thats it (mebbe a few extra ones backend) but primarily one file that users can use to convert their text to textile.

Does anyone have time to throw one together? It doesnt need to be styled or anything, I just the need to basic frame and then I can do the rest, Thanks. xxx


~ Cameron

Offline

#4 2008-09-09 14:56:23

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Textile Generator

Hey Driz,

Could you use something like this ?
I know it’s a plugin – but if you need an easy way to allow users to add textile to their articles – this is pretty darn good.

Offline

#5 2008-09-09 14:59:57

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Textile Generator

renobird wrote:

Hey Driz,

Could you use something like this ?
I know it’s a plugin – but if you need an easy way to allow users to add textile to their articles – this is pretty darn good.

That plugin is awesome, but it’s for the write tab! I’m wanting something on the public side like the links above. x


~ Cameron

Offline

#6 2008-09-09 15:05:39

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Textile Generator

OK. Public side only. What does the user do with the resulting textiled text? Does it get entered back into TXP somehow via a public side interface? Otherwise, it sounds like it would be used in an app other than TXP.

Last edited by renobird (2008-09-09 15:05:59)

Offline

#7 2008-09-09 15:08:59

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Textile Generator

The user does what they want with it! It’s mainly to allow the user to understand Textile, it’s not to be integrated into Textpattern in any way, it’s merely a tool/document that will allow a user to create textiled text and learn the syntax.

So really I’m wanting to create exactly what the one on Threshold has. x


~ Cameron

Offline

#8 2008-09-09 15:12:59

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Textile Generator

From the footer of that page.

Copyright 2006 Alex Shiels / Threshold State. All rights reserved. Email for documentation licensing info.

Offline

#9 2008-09-09 15:26:46

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Textile Generator

Yeah, you can’t create exact same thing that Alex has, but you can ofcourse use the textile class to textile your content, and ofcourse it must be done with php.

<textarea name="content"></textarea>
<?php
	$content = $_POST['content'];
	include_once '/lib/classTextile.php'; // Include the classTextile.

	$textile = new Textile(); 
	$textiled = $textile->TextileThis($content);
?>
<p>Results and my humps:</p>
<pre><?php echo htmlspecialchars($textiled); ?></pre>

But I don’t know why you want to use plain php, when simple plugin can do that without any hazzle.

Last edited by Gocom (2008-09-09 15:32:17)

Offline

#10 2008-09-09 16:16:27

reid
Member
From: Atlanta, Ga.
Registered: 2004-04-04
Posts: 224
Website

Re: Textile Generator

driz wrote:

So really I’m wanting to create exactly what the one on Threshold has.

Since “the one on Threshold” does exactly what you want, what’s wrong with using it “as is”? That’s why it was placed there. A simple link will take your users right to it.


TextPattern user since 04/04/04

Offline

#11 2008-09-09 17:33:21

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: Textile Generator

Reid : yes :-)

… primarily one file that users can use to convert their text to textile

Dunno if we’ve been misunderstanding you. What you write suggests you want to convert from word/rtf/html or another source to textile. I don’t remember ever seeing a convert-from-x-to-textile parser. I’m sure lots of people would like an instant word-to-textile parser but it may well be non-trivial to produce.

What Alex’s or the original textile page does is simply convert textile input to HTML. That just uses the textile.php file that you can download it from that page but I think the one in a recent txp installation is more recent (it’s in a subfolder of your textpattern install). Open up textile.php in a texteditor and the entire upper section is a description on how to use it (it’s actually very simple). You can include_once textile.php in your index.php file and then pass the content of the form to be converted by passing the string through the function TextileThis (or Lite). Take a look at the source code for upm_textile (as suggested above) as it is basically a function that makes the bells-and-whistles under the hood available and will give you some pointers.

EDIT: Erm, ah, oh – Jukka already pointed that out ;-)

Last edited by jakob (2008-09-09 17:34:49)


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB