Well, in my continuing quest to have everything done for me by others, I have decided that I must have beautiful code and that it should happen even with textile turned on, the way it does on Moveable Type. I’m not sure whether I’ve accomplished that yet, but the only way to really find out is to post some code here [:-)]

Edit Actually, the worst part of this whole thing has been figuring out when WordPress adds all those horrid <br> tags to my post! That’s just wrong! (especially inside my < code > blocks).

Edit Ok, well, the php version of textile that I have isn’t nearly as clever as the perl version Brad Choate whipped up … so I’m not sure what I should do. I mean, I liked some of the features from Brad’s, but I thought that he and Dean were working together on it, so I really thought more of the features would work across the board. At any rate, I got beautifier working, but I have to teach textile (and WordPress’s own formatting function) not to mess with stuff inside < pre > or < code > tags.

Edit Sorted! I figured it out. By upgrading to Textile 2 beta you can get rid of most of these problems [:-D]. I should explain that there’s a trick to that: If you choose to upgrade to Textile 2 in WordPress, you’ll need to rename the single-letter global variables in Textile.php, because the WordPress guys have the same bad habit of using variables who’s names mean nothing. I recommend something more descriptive, but you can just copy mine As a side note, if we were using PHP5, this wouldn’t be a problem, we’d just throw that stuff in a namespace to keep it unique. [:)]

The last thing you have to do is dump all the WordPress formatting stuff by editing the bottom of your b2vars.php file to look like this:


   // so we can use Textile 2 without duplicating effort,
   // Comment out all three lines
   // add_filter('all', 'wptexturize');
   // add_filter('the_content', 'wpautop');
   // add_filter('comment_text', 'wpautop');
   //
   // The following is for Beautifier support
   // It has to come before Textile!!
   include_once('beautifier.php');
   add_filter('the_content', 'beautifier');
   //
   // The following is for Textile support
   include_once('textile.php');
   add_filter('the_content', 'textile');
   add_filter('comment_text', 'textile'); // yeah, I want this on my comments too.
 

Yeah, so there! Of course, you’re going to want my beautifier.php script which you can put in your wp-includes folder, and then dump all the files you get from beautifier.org into a directory called “beautifier” (or whatever you like, just make sure you edit beautifier.php to tell it where to go).

8 Responses to “Am I beautified?”

  • mg says:

    Hi, this Q is some kind of outa topic, but what function calls “finish reading” link? My site is organized like yours, but I can’t find how to organize it like this one.

    Cheers!

  • Rad Smith says:

    You might wanna update those links to the source, they are broken.

  • Jaykul says:

    Yep, sorry … re-ordered that. :-p
    I knew, at the time, that I ought to have posted that code in a … perma-link type location, ah well, I fixed the links now.

  • Jepa says:

    WP version 1.0.1 the b2var.php is now just var.php in the includes folder.

    Just fyi.

    regards,

    Jepa

  • Jepa says:

    Sorry not var.php, but vars.php

    :)

  • FilSchiesty says:

    Links still broken to the readme file.

  • It’s this tag here: < ?php the_content("finish reading..."); ?> The trick is to put a <!--more--> tag in your post wherever you want to break between what gets put on the front page, and what get’s put inside, and then to put a <!--nextpage--> tag for page breaks. It’s all in Wordpress readme file

    Wow, I love that textile & beautifier :-)

  • Yeah, that’s wierd. Anyway, the readme is just about how to get the multi-page posts. And it’s just the readme that comes with WordPress, you’ll get much more up-to-date information from the WordPress Docs

Search
Similar Posts
    None Found
Recent Posts
    None Found