We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Ok here’s a beta version of the Textile Paraser:

    Plugin Name: Textile
    Description: Textile parser
    Event: OnWebPagePrerender

    Code:
    /**
     *	Textile Parser for MODx
     *
     *	Based on the textile parser at www.textism.com
     *
     */
     
    
    $e = &$modx->Event;
    
    switch ($e->name) {
    	case "OnWebPagePrerender":	
    		include_once($modx->config["base_path"].'/assets/plugins/textile/textile.php');
    		$doc = $modx->documentOutput;
    		preg_match_all("|<textile>(.*)</textile>|Uis",$doc,$matches);
    		for ($i=0;$i<count($matches[0]);$i++) {
    			$tag = $matches[0][$i];
    			$text = $matches[1][$i];
    			$text = textile($text);
    			$doc = str_replace($tag,$text,$doc);
    		}
    		$modx->documentOutput = $doc;
    		break;
    		
    	default:	// stop here
    		return; 
    		break;	
    }
    
    return $textile;
     
    


    Please unzip the attached plugin.textile.zip file and copy the assets/plugins/textile/ folder structure along with files into the root of you website.

    USAGE:
    Also remember to put your textile tags inside a the <textile></textile>tags. You could even use a TV to do this. Check out the HTML Generic tag control. This control can wrap the <textile> tags around your textile content.

    PS. I think the textile.php file is very old. It does not parse things like h2{color:green}. My title. Is there a more up-to-date parser?



      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 594
      • 15 Posts
      This is great! I’m going to try this out as soon as I get a chance. For updated versions and whatnot, you may want to try emailing Dean Allen, the creator of Textile. His email address is dean@textism.com. I’m sure if you explain what you’re using this for, he will probably give you all the necessary information and maybe even some other tips and tricks as far as integration is concerned. Can’t hurt. Thanks so much for the plugin!
        Top Dead Center Design, LLC
        Design, Develop, Manage
        http://tdcdesign.com/
        • 6726
        • 7,075 Posts
        As a textpattern user, I’d love to use Textile in MODx (I guess many people will be interrested in MarkDown as well, considering the existence of phpMarkdown it should be even easier to integrate)

        Where are we on this ?
        Anyone tested it huh

        I most certainly will... Thanks Raymond smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 36541
          • 222 Posts
          Raymond, is it possible to make it work as an editor not parser? I mean, the one that you choose in site config.
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 6726
            • 7,075 Posts
            Textile is not an editor indeed but a parser.

            Sometime ago on textpattern’s forum I suggested we create a javascript toolbar for Textile.

            This lead to two quicktag plugins :

            It works pretty much like BBcode formating in boards smiley

            The only thing I have been pushing for is live preview (end users like WYSIWYG). It would allow for the best of both worlds, since Textile or Markdown do a pretty good job of outputting compliant code, while hmtl WYSIWYGS Editor are not... (But TinyMCE is better than FCK in this area...)

            Maybe those plugins could be ported to MODx, this I don’t know...
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 32963
              • 1,732 Posts
              Hi,

              This sounds like a nice idea smiley

              I don’t remember but I think Jeff was working on something like this.

              Btw, Jeff’s the RTE/TE expert smiley



                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 36541
                • 222 Posts
                David, I know what Textile is. I also used it with TXP.

                Maybe I wasn’t clear in my post. I think about Textile used without <textile> elements but parsing the input by default. Just like FCK does. I’d like to be able to set it as the default ’editor’ for the site.

                The toolbar wouldn’t be necessary, a short list of most common tags or a link to small help window would be enough.
                  This is the web: the only thing you know about who will come is that you don't know who will come.
                  • 4018
                  • 1,131 Posts
                  I concur with others here. Textile is really more of a context specific parser than anything else. It’s possible to use it as a parser and then use whatever editor you wish to enter Textile specific tags. However, I’m not sure if some of the editors (FCK, TinyMCE, etc.) will allow for "previewing" Textile specific tags. I’m sure there’s a way to have the best of both worlds...that is, implement Textile with two separate plugins: one for the actual parser and another to allow selection of a textarea only editor field for Textile use (maybe have a key added above or below the textarea with Textile hints). I’m not entirely familiar with Textile since I haven’t really used it...but I’m sure with a little research I could probably figure out a worthwhile solution. smiley
                    Jeff Whitfield

                    "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                    • 36541
                    • 222 Posts
                    Quote from: Bravado at Nov 28, 2005, 09:32 AM

                    another to allow selection of a textarea only editor field for Textile use (maybe have a key added above or below the textarea with Textile hints)
                    That’s exactly what I thought about.
                      This is the web: the only thing you know about who will come is that you don't know who will come.
                      • 6726
                      • 7,075 Posts
                      I finally took some time to install the plugin.

                      My question is, how do I use it. Since it’s not recognized as an editor, I can’t select it to edit documents.

                      Is there some Plugin configuration that could solve this ? I know Textile is not a WYSIWYG editor but it should be easy to turn on or off.

                      Thanks !
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id