<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Notes Log &#187; CSS</title>
	<atom:link href="http://noteslog.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://noteslog.com</link>
	<description></description>
	<lastBuildDate>Sat, 15 May 2010 13:31:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to download scripts and stylesheets</title>
		<link>http://noteslog.com/post/how-to-download-scripts-and-stylesheets/</link>
		<comments>http://noteslog.com/post/how-to-download-scripts-and-stylesheets/#comments</comments>
		<pubDate>Fri, 25 May 2007 19:59:12 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[Toolkit]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://noteslog.com/post/how-to-download-scripts-and-stylesheets/</guid>
		<description><![CDATA[With the help of some basic DOM manipulation and no AJAX at all it is possible to write some useful functions for downloading scripts and stylesheets after the page has been loaded. load_javascript = function( uri ) { if( document.createElement ) { var e = document.createElement( "script" ); e.type = "text/javascript"; e.src = uri; document.getElementsByTagName( [...]]]></description>
			<content:encoded><![CDATA[<p>With the help of some basic DOM manipulation and no AJAX at all it is possible to write some useful functions for downloading scripts and stylesheets after the page has been loaded.</p>
<p>load_javascript = function( uri ) {
	if( document.createElement ) {
		var e = document.createElement( "script" );
		e.type = "text/javascript";
		e.src = uri;
		document.getElementsByTagName( "head" )[0].appendChild( e );
	}
};

load_javascript_inline = function( sourceCode ) {
	if( document.createElement ) {
		var e = document.createElement( "script" );
		e.type = "text/javascript";
		e.text = sourceCode;
		document.getElementsByTagName( "head" )[0].appendChild( e );
	}
};

load_stylesheet = function( uri ) {
	if( document.createElement ) {
		var e = document.createElement( "link" );
		e.rel = "stylesheet";
		e.type = "text/css";
		e.href = uri;
		document.getElementsByTagName( "head" )[0].appendChild( e );
	}
};

load_stylesheet_inline = function( sourceCode ) {
	if( document.createElement ) {
		var e = document.createElement( "style" );
		e.type = "text/css";
		if( e.styleSheet ) { // IE
			e.styleSheet.cssText = sourceCode;
		} 
		else {
			var t = document.createTextNode( sourceCode );
			e.appendChild( t );
		}
		document.getElementsByTagName( "head" )[0].appendChild( e );
	}
};</p>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/how-to-download-scripts-and-stylesheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PunchCard 1.3 Released Today</title>
		<link>http://noteslog.com/post/punchcard-13-released-today/</link>
		<comments>http://noteslog.com/post/punchcard-13-released-today/#comments</comments>
		<pubDate>Fri, 27 Apr 2007 19:20:44 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[PunchCard]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://noteslog.com/post/punchcard-13-released-today/</guid>
		<description><![CDATA[Changes Faster Page Loads With Image Concatenation Updated the code to use version 1.1.2 of the jQuery library (bundled) Files download all in a zip read the manual (the greeny thing below this line is a punchcard)]]></description>
			<content:encoded><![CDATA[<h5>Changes</h5>
<ul>
<li><a href="http://borkweb.com/story/faster-page-loads-with-image-concatenation" target="_blank">Faster Page Loads With Image Concatenation</a></li>
<li>Updated the code to use version 1.1.2 of the jQuery library (bundled)</li>
</ul>
<h5>Files</h5>
<ul>
<li><a href="/personal/projects/punchcard/1.3/punchcard-1.3-all.zip" onclick="javascript:urchinTracker('/downloads/punchcard-1.3');">download all in a zip</a></li>
<li><a href="/punchcard/">read the manual</a></li>
</ul>
<p align="center">(the greeny thing below this line is a punchcard)</p>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/punchcard-13-released-today/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Highlight Mixed Language Source Code</title>
		<link>http://noteslog.com/post/mixed-language-snippets/</link>
		<comments>http://noteslog.com/post/mixed-language-snippets/#comments</comments>
		<pubDate>Fri, 16 Feb 2007 15:35:29 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[Chili]]></category>
		<category><![CDATA[Enzymes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://noteslog.com/?p=143</guid>
		<description><![CDATA[Web pages contain many snippets from different languages, like HTML, PHP, CSS, and JavaScript. Chili 1.x cannot highlight mixed language source code automatically, but the forthcoming released Chili 2.0 will be is able to do that. Meanwhile, if you are using a Chili + Enzymes setup, then it&#8217;s possible to write an Enzymes template capable [...]]]></description>
			<content:encoded><![CDATA[<p>Web pages contain many snippets from different languages, like HTML, PHP, CSS, and JavaScript. Chili 1.x cannot highlight mixed language source code automatically, but the <span style="text-decoration: line-through;">forthcoming</span> released <a href="http://noteslog.com/post/chili-20-released-today/">Chili 2.0</a> <span style="text-decoration: line-through;">will be</span> is able to do that.</p>
<p>Meanwhile, if you are using a Chili + Enzymes setup, then it&#8217;s possible to write an Enzymes template capable of making Chili 1.x highlight a web page perfectly (expanding on my previous php template).</p>
<p>Here is the <span style="text-decoration: line-through;">new</span> updated (2007/02/19) <span style="text-decoration: underline;">chili-web.php</span> Enzymes template. At the moment it supports XHTML, and embedded CSS, JavaScript, and PHP snippets.</p>
<p><?php 
if( ! function_exists( 'format_code' ) ) {

	function snippet_wrap( $class, $code ) {
		return '' == $code ? '' : '<code class="'.$class.'">'.htmlentities( $code ).'</code>';
	}

	function snippet_php( $open, $code, $close ) {
		return snippet_wrap( 'html', $open ).snippet_wrap( 'php', $code ).snippet_wrap( 'html', $close );
	}

	function php_inside_html( $matches ) {
		list( $all, $before, $open, $code, $close ) = $matches;

		if( '' == $open ) 
			return snippet_wrap( 'html', $all );
		else 
			return snippet_wrap( 'html', $before ).snippet_php( $open, $code, $close );
	}

	function php_inside_css( $matches ) {
		list( $all, $before, $open, $code, $close ) = $matches;

		if( '' == $open ) 
			return snippet_wrap( 'css', $all );
		else 
			return snippet_wrap( 'css', $before ).snippet_php( $open, $code, $close );
	}

	function php_inside_javascript( $matches ) {
		list( $all, $before, $open, $code, $close ) = $matches;

		if( '' == $open ) 
			return snippet_wrap( 'javascript', $all );
		else 
			return snippet_wrap( 'javascript', $before ).snippet_php( $open, $code, $close );
	}

	function php_inside( $class, $code ) {
		return preg_replace_callback( '/(?:(.*?)(\<\?php\s)(.*?)(\?\>))|(?:.+)/si', "php_inside_$class", $code );
	}

	function snippet_web( $class, $open, $code, $close ) {
		return snippet_wrap( 'html', $open ).php_inside( $class, $code ).snippet_wrap( 'html', $close );
	}

	function format_code( $matches ) {
		list( $all, $before, $open, $tag, $code, $close ) = $matches;

		if( '' == $open ) {
			return php_inside( 'html', $all );
		}
		else {
			switch( $tag ) {
				case 'script': $class = 'javascript'; break;
				case 'style' : $class = 'css';        break;
				default      : $class = 'html';
			}
			return php_inside( 'html', $before ).snippet_web( $class, $open, $code, $close );
		}
	}

	function format_clean( $out ) {
		do {
			$len = strlen( $out );
			$out = preg_replace( '/(\<code class="(\w+)"\>[^<]*)\<\/code\>\<code class="\2"\>/is', '$1', $out );
		} while( $len != strlen( $out ) );
		return $out;
	}
}

?>
<pre class="chili-<?php 
	$tmp = preg_split( '/(?:\r?\n)+/', $this->result );
	if( count( $tmp ) > 28 ) echo 'clip';
	else echo 'all'; 
?>"><?php
	$out = preg_replace_callback( '/(?:(.*?)(\<(script|style)\b.*?\>)(.*?)(\<\/\3\>))|(?:.+)/is', 'format_code', $this->result );
	echo format_clean( $out );
?></pre></p>
<p>The WordPress file <span style="text-decoration: underline;">/wp-content /themes /default /comments-popup.php</span> is a page that uses all the supported languages, so it&#8217;s a good test for the previous template:</p>
<p><?php
/* Don't remove these lines. */
add_filter('comment_text', 'popuplinks');
while ( have_posts()) : the_post();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
     <title><?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?></title>

	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?> );
		body { margin: 3px; }
	</style>

</head>
<body id="commentspopup">

<h1 id="header"><a href="" title="<?php echo get_option('blogname'); ?>"><?php echo get_option('blogname'); ?></a></h1>

<h2 id="comments">Comments</h2>

<p><a href="<?php echo get_option('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>

<?php if ('open' == $post->ping_status) { ?>
<p>The <abbr title="Universal Resource Locator">URL</abbr> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
<?php } ?>

<?php
// this line is WordPress' motor, do not delete it.
$commenter = wp_get_current_commenter();
extract($commenter);
$comments = get_approved_comments($id);
$post = get_post($id);
if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
	echo(get_the_password_form());
} else { ?>

<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
	<li id="comment-<?php comment_ID() ?>">
	<?php comment_text() ?>
	<p><cite><?php comment_type('Comment', 'Trackback', 'Pingback'); ?> by <?php comment_author_link() ?> â€” <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
	</li>

<?php } // end for each comment ?>
</ol>
<?php } else { // this is displayed if there are no comments so far ?>
	<p>No comments yet.</p>
<?php } ?>

<?php if ('open' == $post->comment_status) { ?>
<h2>Leave a comment</h2>
<p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
	<p>
	  <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
	   <label for="author">Name</label>
	<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
	<input type="hidden" name="redirect_to" value="<?php echo attribute_escape($_SERVER["REQUEST_URI"]); ?>" />
	</p>

	<p>
	  <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
	   <label for="email">E-mail</label>
	</p>

	<p>
	  <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
	   <label for="url"><abbr title="Universal Resource Locator">URL</abbr></label>
	</p>

	<p>
	  <label for="comment">Your Comment</label>
	<br />
	  <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
	</p>

	<p>
	  <input name="submit" type="submit" tabindex="5" value="Say It!" />
	</p>
	<?php do_action('comment_form', $post->ID); ?>
</form>
<?php } else { // comments are closed ?>
<p>Sorry, the comment form is closed at this time.</p>
<?php }
} // end password check
?>

<div><strong><a href="javascript:window.close()">Close this window.</a></strong></div>

<?php // if you delete this the sky will fall on your head
endwhile;
?>

<!-- // this is just the end of the motor - don't touch that line either :) -->
<?php //} ?>
<p class="credit"><?php timer_stop(1); ?> <cite>Powered by <a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform"><strong>Wordpress</strong></a></cite></p>
<?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
<script type="text/javascript">
<!--
document.onkeypress = function esc(e) {
	if(typeof(e) == "undefined") { e=event; }
	if (e.keyCode == 27) { self.close(); }
}
// -->
</script>
</body>
</html></p>
<p>Chili &amp; Enzymes confirm to be a perfect match.</p>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/mixed-language-snippets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PunchCard 1.2 Released Today</title>
		<link>http://noteslog.com/post/punchcard-12-released-today/</link>
		<comments>http://noteslog.com/post/punchcard-12-released-today/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 18:27:21 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[PunchCard]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://noteslog.com/?p=107</guid>
		<description><![CDATA[Changes Simplified the inclusion of the PunchCard code in a page The configuration of a widget is now by means of a metaboject, and is compliant with XHTML 1.0 Strict Updated the code to use version 1.1.1 of the jQuery library (bundled) The example.html file shows how to put on the same page as many [...]]]></description>
			<content:encoded><![CDATA[<h5>Changes</h5>
<ul>
<li>Simplified the inclusion of the PunchCard code in a page</li>
<li>The configuration of a widget is now by means of a metaboject, and is compliant with <u>XHTML 1.0 Strict</u></li>
<li>Updated the code to use version 1.1.1 of the jQuery library (bundled)</li>
<li>The <u>example.html</u> file shows how to put on the same page as many widgets as you like. Each of them can have it&#8217;s own style</li>
<li>Simplified the stylesheets. Add new styles for colors and shapes of the widgets to the <u>punchcard.css</u> stylesheet (compare with <u>example.html</u>)</li>
</ul>
<h5>Files</h5>
<ul>
<li>download all in a zip</li>
<li><a href="/punchcard/">read the manual</a></li>
</ul>
<p align="center">(the greeny thing below this line is a punchcard)</p>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/punchcard-12-released-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PunchCard 1.1 Released Today &#8211; updated</title>
		<link>http://noteslog.com/post/punchcard-11-released-today/</link>
		<comments>http://noteslog.com/post/punchcard-11-released-today/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 21:11:18 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[PunchCard]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://noteslog.com/?p=85</guid>
		<description><![CDATA[Changes implemented a different format for widgets configurations: now it&#8217;s xhtml compliant Files download all in a zip read the manual]]></description>
			<content:encoded><![CDATA[<p><strong>Changes</strong></p>
<ul>
<li>implemented a different format for widgets configurations: now it&#8217;s xhtml compliant</li>
</ul>
<p><strong>Files</strong></p>
<ul>
<li>download all in a zip</li>
<li><a href="/?page_id=86">read the manual</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/punchcard-11-released-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PunchCard 1.0 Released Today &#8211; updated</title>
		<link>http://noteslog.com/post/punchcard-10-released-today/</link>
		<comments>http://noteslog.com/post/punchcard-10-released-today/#comments</comments>
		<pubDate>Tue, 14 Nov 2006 14:09:03 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[PunchCard]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://noteslog.com/?p=84</guid>
		<description><![CDATA[see the PunchCard category for updates Features A jQuery widget for displaying in a small area a lot of social bookmarking sites, like del.icio.us, digg, technorati&#8230; (there are 45 now) Punchcard metaphore Every button is a tiny mark in a punchcard When the mouse hovers the punchcard a tooltip pops up The tooltip shows icon [...]]]></description>
			<content:encoded><![CDATA[<p>see the <a href="/?cat=17">PunchCard</a> category for updates<strong> </strong></p>
<p><strong>Features</strong></p>
<ul>
<li>A jQuery widget for displaying in a small area a lot of social bookmarking sites, like del.icio.us, digg, technorati&#8230; (there are 45 now)</li>
<li>Punchcard metaphore
<ol>
<li>Every button is a tiny mark in a punchcard</li>
<li>When the mouse hovers the punchcard a tooltip pops up</li>
<li>The tooltip shows icon and name of the site</li>
<li>If the user punches the mark, the site opens in a new window, and</li>
<li>The punchcard gets a new hole which stays put</li>
</ol>
</li>
</ul>
<p align="left">{[.test]}</p>
<ul>
<li>You can add as many punchcards as you like to the same page, each one for submitting a different content: the holes belong to that content</li>
<li>Easy to add
<ol>
<li>Use a div element with a &#8216;punchcard&#8217; class</li>
<li>Set its &#8216;title&#8217; and &#8216;id&#8217; attributes to the title and URL of your contentFor example, this is the html code used to display the above punchcard</li>
</ol>
</li>
</ul>
<p><center>
<div class="punchcard" title="PunchCard 1.0 Released Today" 
id="/?p=84"></div>
</center></p>
<ul>
<li>Easy to install
<ol>
<li>HEAD: reference all the needed scripts and stylesheets</li>
<li>BODY: set the path of the icons folder (relative to your domain)</li>
</ol>
</li>
</ul>
<p>HEAD<script type="text/javascript" src="jquery-1.0.3.pack.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<script type="text/javascript" src="cooltip.js"></script>
<link rel="stylesheet" type="text/css" href="cooltip.css" />
<script type="text/javascript" src="crc32.js"></script>
<script type="text/javascript" src="punchcard.js"></script>
<link rel="stylesheet" type="text/css" href="punchcard.css" />BODY<script language="JavaScript">
PunchCard.icons = "/punchcard/icons/";
</script></p>
<ul>
<li>Easy to customize<br />
Change everything from colors to links, directly in the code and stylesheet files.</li>
</ul>
<p><strong>Files</strong></p>
<ul>
<li>download all in a zip</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/punchcard-10-released-today/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Chili &amp; Enzymes</title>
		<link>http://noteslog.com/post/chili-enzymes/</link>
		<comments>http://noteslog.com/post/chili-enzymes/#comments</comments>
		<pubDate>Wed, 08 Nov 2006 02:01:32 +0000</pubDate>
		<dc:creator>Andrea Ercolino</dc:creator>
				<category><![CDATA[Chili]]></category>
		<category><![CDATA[Enzymes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://noteslog.com/?p=81</guid>
		<description><![CDATA[UPDATE (2008-03-20): There is a new post about Chili &#38; Enzymes. Thanks to their new versions, it&#8217;s now much easier to config WordPress highlighting than described here. If you post many code snippets, then Chili and Enzymes can work together for making your life simpler.Here is my proposed configuration: 1. Install Enzymes Download the latest [...]]]></description>
			<content:encoded><![CDATA[<p><em>UPDATE (2008-03-20): There is a new post about <a href="http://noteslog.com/post/how-to-highlight-code-in-wordpress/">Chili &amp; Enzymes</a>. Thanks to their new versions, it&#8217;s now much easier to config WordPress highlighting than described here.</em></p>
<p>If you post many code snippets, then Chili and Enzymes can work together for making your life simpler.Here is my proposed configuration:</p>
<p><strong>1. Install Enzymes</strong><br />
Download the <a href="/?cat=9">latest version</a> to your computer, upload it to your server, in the &#8216;plugins&#8217; directory under &#8216;/wp-content&#8217;, and activate it. No configuration needed.</p>
<p><strong>2. Upload jQuery and Chili<br />
</strong>For this configuration I&#8217;m going to put the file &#8216;jquery-1.0.3.pack.js&#8217; in a &#8216;jquery&#8217; directory under the &#8216;/wp-content&#8217; directory, and the file &#8216;chili-1.1.pack.js&#8217; in a &#8216;chili&#8217; directory under the &#8216;jquery&#8217; directory. In the &#8216;chili&#8217; directory I&#8217;ll put also any recipes and stylesheets I&#8217;ll need.<br />
I recommend to upload and setup at least one of the examples provided with Chili. It&#8217;ll be useful for proving that Chili is properly configured (bypassing WordPress).</p>
<p><strong>3. Upload an E</strong><strong>nzymes template for each language you&#8217;ll use</strong><br />
In fact there are many valid alternatives, but I think that this one is pretty simple and you can eventually expand on it. Here is the template I&#8217;m going to use for JavaScript snippets: <pre class="chili-<?php 
	$tmp = preg_split( '/[\r\n]+/', $this->result );
	if( count( $tmp ) > 28 ) echo 'clip';
	else echo 'all'; 
?>"><code class="javascript"><?php 
	echo htmlentities( $this->result ); 
?></code></pre>Note that the template decides the style of the &#8216;pre&#8217; tag and that the result is automatically escaped. Anyway this is still a naive template, which is not suitable for javascript snippets mixed into html snippets. Remember that the base directory for Enzymes templates is &#8216;wp-content&#8217;.</p>
<p><strong>4. Add style settings to the stylesheet of your current WordPress theme</strong><br />
You should provide only general format for the tags you are going to use for wrapping your code snippets. For example, I&#8217;m going to use a &#8216;pre&#8217; tag wrapped around the &#8216;code&#8217; tag. In the style.css file, I&#8217;ll add these definitions: pre.chili-all {
	color: #333333; 
	background-color: #f4f4f4; 
	font-size: 9pt; 
	line-height: 120%;
	width: 450px; 
	overflow: auto; 
	}

pre.chili-clip {
	color: #333333; 
	background-color: #f4f4f4; 
	font-size: 9pt; 
	line-height: 150%;
	width: 450px; 
	height: 450px; 
	overflow: auto; 
	}

pre.chili-all code, pre.chili-clip code {
	font-size: 9pt; 
	line-height: 150%;
	}As you see, they are very similar: chili-all adjust the height of the box to the length of the content; chili-clip fixes the height to a maximum.</p>
<p><strong>5. Edit the header.php file of your current WordPress theme</strong><br />
This is to enable support for Chili in each HTML page of the blog. It&#8217;s just three script elements: two for loading jQuery and Chili, and one for configuring Chili.</p>
<p>The following two items must appear in the &#8216;head&#8217; section, maybe just before the closing tag. <script type="text/javascript" src="<?php 
	bloginfo('siteurl'); 
?>/wp-content/jquery/jquery-1.0.3.pack.js"></script>
<script type="text/javascript" src="<?php 
	bloginfo('siteurl'); 
?>/wp-content/jquery/chili/chili-1.1.js"></script>The following two items must appear in the &#8216;body&#8217; section, maybe just after the opening tag. <script>
ChiliBook.recipeFolder = "<?php 
	bloginfo('siteurl'); 
?>/wp-content/jquery/chili/";
ChiliBook.stylesheetFolder = "<?php 
	bloginfo('siteurl'); 
?>/wp-content/jquery/chili/";
</script></p>
<p><strong>6. Done, now test the configuration</strong></p>
<ol>
<li>Create a new post titled &#8220;Testing Enzymes &amp; Chili&#8221;. Hit &#8216;Save and Continue Editing&#8217;</li>
<li>Add a custom field with a Key &#8220;js-snippet&#8221; and a Value &#8220;document.writeln( "Hello World!" );&#8221;</li>
<li>Add this Enzymes statement &#8220;{[.js-snippet /enzymes/chili-js.php]}&#8221; into the post area</li>
<li>Hit &#8216;Publish&#8217; and then &#8216;View site&#8217;</li>
</ol>
<p>If it looks like this document.writeln( "Hello World!" ); then all is fine. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://noteslog.com/post/chili-enzymes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
