Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
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
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
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
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
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
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
Re: Textile Generator
From the footer of that page.
Copyright 2006 Alex Shiels / Threshold State. All rights reserved. Email for documentation licensing info.
Offline
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
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
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
Pages: 1