xwisdom Reply #1, 6 years, 11 months ago
Ok here's a beta version of the Textile Paraser:
Plugin Name: Textile
Description: Textile parser
Event: OnWebPagePrerender
Code:
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?
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?
