<?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>Blogrescue.com &#187; The Web</title>
	<atom:link href="http://blogrescue.com/topics/the-web/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogrescue.com</link>
	<description>Technical Know-How in Human Terms</description>
	<lastBuildDate>Thu, 26 Aug 2010 14:08:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stylesheet Mahem</title>
		<link>http://blogrescue.com/2010/05/stylesheet-mahem/</link>
		<comments>http://blogrescue.com/2010/05/stylesheet-mahem/#comments</comments>
		<pubDate>Sat, 08 May 2010 21:36:51 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[The Web]]></category>

		<guid isPermaLink="false">http://blogrescue.com/?p=76</guid>
		<description><![CDATA[Just finished up redesigning my 4th site in the past 5 weeks (along with 4 relocations and 2 migrations).  I love starting with a brand new template and coding something very clean and neat, however sometimes it is just better to update existing templates.  Anyone who has reworked templates for a major set [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished up redesigning my 4th site in the past 5 weeks (along with 4 relocations and 2 migrations).  I love starting with a brand new template and coding something very clean and neat, however sometimes it is just better to update existing templates.  Anyone who has reworked templates for a major set of changes knows that sometimes it feels like things are messy and out of control.  Especially with stylesheets.</p>
<p>I still have not found a decent way to order classes in a stylesheet that makes any sense (and is maintainable) but search functions make that passable. However, I still cannot help but feel like the stylesheet is messy since I really have no idea which classes I&#8217;ve obsoleted vs. which classes are still used by some obscure template I never touched.  I&#8217;ve always been meaning to find a better solution to this then my usual method: &lt;i&gt;leave them all there &#8211; just in case&lt;/i&gt;.  A clean and tidy stylesheet reduces server load and is easier to maintain.</p>
<p>So instead of doing the work I was supposed to be doing today, I goofed off and coded a little stylesheet analysis program.  The idea is pretty simple:<span id="more-76"></span></p>
<ul>
<li>Read the stylesheet and parse out the style definitions</li>
<li>Read sample pages from the site and track which styles are referenced</li>
<li>Report back which pages use what styles, and which styles are not used at all</li>
</ul>
<p>My original concept involved reading the sitemap.xml and checking all pages, but that would be a waste of resources for sites with any amount of history.  (Although it might be useful for a site where stylesheet styles were used in individual posts!)  Instead, I settled on a q&amp;d (quick and dirty) php script driving a html form that lets you supply the stylesheet url and up to 9 urls from the site to analyze.  The idea is to add the index, date archive, category archive, about page and maybe a few individual posts so you get a sampling of every template in your theme.</p>
<p>The coding (and debug) took about 90 minutes and I&#8217;m pretty pleased with the result.  This little tool (named StyleCheck) makes it very easy to eliminate the chaff from your stylesheet.  Give it a try if you like: <a rel="nofollow" href="/tools/stylecheck.php">StyleCheck</a> or download the source to see how it works and maybe improve it: <a rel="nofollow" href="/tools/stylecheck.txt">StyleCheck Source Code</a>.  (And don&#8217;t laugh at the form or the code &#8211; again, this is a q&amp;d project.)</p>
<p>Now to go and clean up some stylesheets.</p>
<p><strong><span style="color: #ff0000;">Update:</span></strong> Here are a few more operational details and or caveats:</p>
<ul>
<li>When the stylesheet is scanned, all non-id and non-class items are ignored.  Also, derivative classes (i.e. &#8216;.myclass a&#8217; or &#8216;.myclass ul li&#8217;) are reduced down to the base class name.</li>
<li>When the html is analyzed, anywhere a class is used is consider a single use of that class.  The actual content is never checked, so if &#8216;.myclass a&#8217; is defined as in the stylesheet, the analysis doesn&#8217;t look for anchor links in any element classed with .myclass.  It just knows that .myclass is defined in the stylesheet and looks for any use of it in the html.</li>
</ul>
<p>Improving both of these items is very possible, but I just wanted a general tool that helps me identify unused class families plus I was spending time I did not have.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogrescue.com/2010/05/stylesheet-mahem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yet Another Marketplace</title>
		<link>http://blogrescue.com/2010/03/yet-another-marketplace/</link>
		<comments>http://blogrescue.com/2010/03/yet-another-marketplace/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:41:55 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blogrescue.com/?p=42</guid>
		<description><![CDATA[We started with the iPhone App Store, added the Android Marketplace and now Google announces a new one: The Google App Marketplace.  These apps will be part of Google&#8217;s cloud (think Google Docs).  
So much to learn, so little time. (At least for us independent developers.)
]]></description>
			<content:encoded><![CDATA[<p>We started with the iPhone App Store, added the Android Marketplace and now Google announces a new one: <a href='http://gizmodo.com/5489679/the-google-app-marketplace-doing-it-all-in-the-cloud?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed:+gizmodo/full+(Gizmodo)'>The Google App Marketplace</a>.  These apps will be part of Google&#8217;s cloud (think Google Docs).  </p>
<p>So much to learn, so little time. (At least for us independent developers.)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogrescue.com/2010/03/yet-another-marketplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikipedia&#8230;</title>
		<link>http://blogrescue.com/2010/03/wikipedia/</link>
		<comments>http://blogrescue.com/2010/03/wikipedia/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 12:04:35 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[The Web]]></category>
		<category><![CDATA[Pournelle]]></category>
		<category><![CDATA[Quotes]]></category>

		<guid isPermaLink="false">http://blogrescue.com/?p=39</guid>
		<description><![CDATA[Wikipedia topics are usually dominated by the fanatic with the most time to spare, which is why I don&#8217;t rely on Wikipedia when the matter is both controversial and important.
Jerry Pournelle
]]></description>
			<content:encoded><![CDATA[<blockquote><p>Wikipedia topics are usually dominated by the fanatic with the most time to spare, which is why I don&#8217;t rely on Wikipedia when the matter is both controversial and important.</p></blockquote>
<p><a href='http://www.jerrypournelle.com/mail/2010/Q1/mail612.html#Tuesday'>Jerry Pournelle</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogrescue.com/2010/03/wikipedia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
