<?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>The Bright Lines &#187; Documentation</title>
	<atom:link href="http://www.thebrightlines.com/category/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thebrightlines.com</link>
	<description>HTML, CSS, Javascript and more</description>
	<lastBuildDate>Tue, 17 Jan 2012 22:00:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Crucial stuff for your company&#8217;s internal projects</title>
		<link>http://www.thebrightlines.com/2012/01/17/1028/</link>
		<comments>http://www.thebrightlines.com/2012/01/17/1028/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 20:49:44 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Web development in general]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=1028</guid>
		<description><![CDATA[I was musing about what is crucial to make an internal project like Bootstrap from Twitter work.]]></description>
			<content:encoded><![CDATA[<p>Reading the <a href="http://www.alistapart.com/articles/building-twitter-bootstrap/">article on Twitter&#8217;s Bootstrap</a> on A List Apart definitely gave me positive vibe. Twitter and above all its team proved that you can create cool and useful tools if you think further ahead than just pondering how you&#8217;re going to write your 20th incarnation of a sitemap link list for some project.</p>
<p>Yes, it takes some time and discussions between the disciplines but you can win so much time in the future if done right. Doing stuff right depends on some crucial things:</p>
<ul>
<li><strong>Work interdisciplinary and as (almost) equals.</strong> It&#8217;s easy to say what you think out the whole plan yourself, but if you do that, others are not inclined to think with you. Each new idea becomes just another bump in the project instead of a good contribution to a discussion to get a better understanding of a problem. By putting your problem on the table and make team members <em>real</em> team members, you get a real discussion. And a better product in the end</li>
<li><strong>Make your work public.</strong> You also get a whole other situation if you know that other people (clients or the community) are keeping an eye on you. In the positive sense of the word, that is. You have to think (just like Twitter) what is really useful outside your little bubble. And you might get good feedback to make your code even better/stable/useful.<br />
By thinking hard how to make stuff usable for the outside world, you&#8217;re instantly making a very usable and learnable tool for anyone who&#8217;s going to work at your firm.<br />
Making open source software could also motivate people. They&#8217;re not just working hard for the company anymore, they&#8217;re also working on something that can also be useful outside of the company and the greater good. That can be the motivation to work a more on it outside work time.</li>
<li><strong>Results before deadlines or budget.</strong> Ok, projects with limitless budgets aren&#8217;t realistic. But making reusable code or applications without keeping an eye on its usability or not even testing isn&#8217;t realistic either. To get quality reusable code you do not only need to write it, you have to think it out, write it <em>and</em> rewrite it <em>and</em> rewrite it. If you&#8217;re not prepared to do that, just save yourself the trouble.</li>
<li><strong>Continuous testing.</strong> Don&#8217;t wait until the very end of the project to measure its quality. You cannot remove the concrete slabs below an ill-constructed house either. Everybody has to at least check the end result of the finished component before moving on to the next target.</li>
<li><strong>Reusability is epic.</strong> Don&#8217;t kid yourself: Most of the stuff you do now has been done in the past as well. Talk with designers, programmers and developers to aim for reusability while preventing that all websites start to look the same. Getting some framework that works for everybody is everybody&#8217;s priority.</li>
<li><strong>Keep it simple.</strong> Some projects need solid plans. Others don&#8217;t. Some stuff does not have to be written out in threefold as long as the basics are known and the outer borders have been drawn. Be wary if the 5th version of the plan is mailed in PDF form to all team members, project time already gets out of hand and no real work is done yet.</li>
</ul>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2012/01/17/1028/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Considerations on building a frontend codebase</title>
		<link>http://www.thebrightlines.com/2011/09/22/considerations-on-building-a-frontend-template-in-html-css-and-javascript/</link>
		<comments>http://www.thebrightlines.com/2011/09/22/considerations-on-building-a-frontend-template-in-html-css-and-javascript/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 20:46:34 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Web development in general]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=933</guid>
		<description><![CDATA[This article is about my thoughts on how to build a solid codebase for your (frontend) web development.]]></description>
			<content:encoded><![CDATA[<p>Every developer at one time stops looking for code from previous built websites and starts building his own standardized code to cut down on production time and repetative work. Call it a boiler plate, codebase, template, scaffolding, framework or whatever. The bottom line is that every developer needs one.</p>
<h2>Problems with my current codebase</h2>
<p>Well, I already have a codebase, but it has some problems. The important one is that it only covers the very basics. That&#8217;s because designs can be very diverse and as a developer I want to stay true to the design. So it&#8217;s hard to build a codebase with grids and blocks if all design differ from eachother.</p>
<p>Another problem major issue is something I have more control over: the codebase and the documentation is a bit scattered. The last problem I have is that I have no demo page of my standard CSS code, so there&#8217;s no easy way to check the template on browser compatibilities.</p>
<p>Now my <a href="/onopager/website/">jQuery plugin project</a> has reached version 1.1, I had the time to do some thinking about a new codebase that would be solid, extendable, easy to deploy and would replace all other codebases and documentation.</p>
<p>Let me make it clear: this article is about my considerations about building a solid framework for myself. It may not apply to you and my ideas not unique either. It still may be helpful for you to get an idea of what sort of codebase you need.</p>
<h2>Existing examples</h2>
<p>The most important thing about a codebase is to decide how to set it up and how to store it. I like the way open source grids like <a href="http://960.gs/">Grid960</a> and <a  href="http://developer.yahoo.com/yui/grids/">YUI</a> have organized their code into little reusable bits and have created a demo and test page for each and every component.</p>
<p>I must admit: I hardly ever used these grids. Most of those grids talk the language of the web developer, not of the designer. And the designers I know don&#8217;t have to limit themselves to a 24-column grid system. Not to mention the designers that are totally ignorant of such a system and whose task is to design a website and mail the Photoshop file to some other company that has to build it. Although I have my reservations towards grids, I like the way these codebases are organized. It can serve as a good <a href="http://www.blueprintcss.org/">Blueprint</a> for my own codebase.</p>
<p>I also get my inspiration from Nicole Sullivan&#8217;s talk on Object Oriented CSS (OOCSS). OOCSS basically means that you build your components in such a way that they become extendable objects. Just like in real object oriented programming. Just have a look at <a href="http://www.stubbornella.org/content/2009/03/23/object-oriented-css-video-on-ydn/">her talk about OOCSS on Yahoo! Developer Network</a>.</p>
<h2>Prefix classes</h2>
<p>By adding a (relatively) unique string before the name of the class you have created your own CSS namespace. It will minimize any interference of other CSS styling that is not part of your own code. Some real life examples can be found in the code that is generated by the CMS systems I have experience with: <a href="http://www.sitefinity.com">Sitefinity</a> and <a href="http://www.sitecore.com">Sitecore</a>. The CMS Sitefinity for example prefixes all CSS classes with &#8220;sf_&#8221;.</p>
<h2>Grids, blocks and text</h2>
<p>All CSS code will be split into different categories that work relatively independently of each other. Until now I can come up with 3 of them.</p>
<h3>Grids</h3>
<p>Grids are the frameworks of placeholders in which we put our content. You know: header, visual, column1, column2, column3 and footer. There are lots of grid templates around like <a href="http://960.gs/">Grid960</a> and <a href="http://www.blueprintcss.org/">Blueprint</a>. My view is that those templates only work if the designer agrees to work within the limits of that framework. My ambition is to write a framework that makes my work easier while still being flexible enough to keep the designers happy.</p>
<h3>Blocks</h3>
<p>There are as many block as the designer can come up with. I think it will be a real time saver to talk with the designer and write down all the types of blocks he thinks he&#8217;ll like to use often. Or even better: just open the last 20 or so web designs he/she made and destil the common blocks and its common features. like menus, news article lists, homepage spotlights, etc. Finally you create basic blocks of it in your template system.</p>
<p>Standarization is not always popular with designers but if it means that projects can be created cheaper there may eventually be budget left to build cool stuff. At least, I hope&#8230;</p>
<h3>Text</h3>
<p>Basic text styling is also a relatively independent component in CSS code. You always define a basic font color, family, size and line height that serves as a base styling for the whole websites. More specific text styling in blocks should be kept to a minimum and preferably relatively to the base text style. So if you have a base style of <code>font: 1em/1.5em normal Arial, sans-serif</code>, you ideally should style a header in a block like this: <code>font-size: 1.5em; line-height: 1.2em;</code>.</p>
<p>Although <code>font-weight</code> is not something you can set relative to a base style, it&#8217;s not likely that it will look ugly in combination with some design if you add <code>font-weight</code> styling to a block. Setting the <code>font-family</code> in the styling of blocks on the other hand will most likely interfere with design, since designs tend to depend heavily on a particular font.</p>
<h2>Create base templates and extend themes</h2>
<p>The code for each grid system and each block will be stored in a seperate base CSS file. Each grid or block can be extended with extra themes or styles. Each style extension will have its own CSS file and presumes that the base file is already loaded.</p>
<h2>Optimizing CSS</h2>
<p>Having all code seperated in small snippets is great for maintaining an overview. As long as you can see what a CSS file does by looking at its filename, its will be easy to add and extend styling to a website.</p>
<p>The template code is not optimized for speed, though. If we don&#8217;t do anything about the fragmentation, the server will have to load a bunch of little CSS files. It&#8217;s important to stress this: It&#8217;s not just the total filesize that matters, each http request costs time. Check out <a href="http://developer.yahoo.com/yslow/">YSlow</a> if you want to know more about this and if it affects your site.</p>
<h3>YUI</h3>
<p>That&#8217;s why all CSS in the website has to be exported, merged and its code minified to one single CSS file. Normally I use <a href="http://developer.yahoo.com/yui/compressor/">YUI compressor</a> for it.</p>
<h3>Less</h3>
<p>But you can do more than just minification. <a href="http://lesscss.org/">Less</a> is a system that extends the CSS syntax with stuff like variables, nested rules and mixins. Less was originally built in Ruby, but there&#8217;s also an <a href="http://www.dotlesscss.org/">ASP.NET port</a>. I hope it will help me create very flexible grids.</p>
<p>By exporting CSS into optimized code, you can focus on making the most readable CSS source file because all comments and spaces in the code will be removed in the end. This is also what I do with JavaScript code and certainly will continue to do.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2009/12/24/too-advanced-css-selectors/' rel='bookmark' title='Permanent Link: Too advanced CSS selectors'>Too advanced CSS selectors</a></li>
<li><a href='http://www.thebrightlines.com/2011/09/08/the-last-resort-in-css-debugging/' rel='bookmark' title='Permanent Link: The last resort in CSS debugging'>The last resort in CSS debugging</a></li>
<li><a href='http://www.thebrightlines.com/2011/11/21/debugging-less-css/' rel='bookmark' title='Permanent Link: Tips for using and debugging of Less CSS code'>Tips for using and debugging of Less CSS code</a></li>
<li><a href='http://www.thebrightlines.com/2012/01/17/1028/' rel='bookmark' title='Permanent Link: Crucial stuff for your company&#8217;s internal projects'>Crucial stuff for your company&#8217;s internal projects</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2011/09/22/considerations-on-building-a-frontend-template-in-html-css-and-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Codeview is on Github now</title>
		<link>http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/</link>
		<comments>http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 21:14:34 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[codeview]]></category>
		<category><![CDATA[jsdoc]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=834</guid>
		<description><![CDATA[Codeview, the template for JsDoc Toolkit, is now available on Github.]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/WouterBos/Codeview">https://github.com/WouterBos/Codeview</a></p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/09/29/another-codeview-update/' rel='bookmark' title='Permanent Link: Another Codeview update'>Another Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/27/codeview-update/' rel='bookmark' title='Permanent Link: Codeview update'>Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/' rel='bookmark' title='Permanent Link: Codeview, a new template for JSDoc Toolkit'>Codeview, a new template for JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2010/11/30/codeview-1-2/' rel='bookmark' title='Permanent Link: Codeview 1.2'>Codeview 1.2</a></li>
<li><a href='http://www.thebrightlines.com/2011/09/10/the-jquery-plugin-ono-list-pager-reached-version-1-0/' rel='bookmark' title='Permanent Link: The jQuery plugin Ono List Pager reached version 1.0!'>The jQuery plugin Ono List Pager reached version 1.0!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeview 1.2</title>
		<link>http://www.thebrightlines.com/2010/11/30/codeview-1-2/</link>
		<comments>http://www.thebrightlines.com/2010/11/30/codeview-1-2/#comments</comments>
		<pubDate>Tue, 30 Nov 2010 07:29:58 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=738</guid>
		<description><![CDATA[Codeview 1.2 is out with again some new stuff.]]></description>
			<content:encoded><![CDATA[<p><strong>What has changed in 1.2:</strong></p>
<ul>
<li>A quick filter, to filter the class list and methods</li>
<li>Extra command line options, thanks to Aaron Wirtz</li>
<li>A more logical template structure, thanks to Aaron Wirtz</li>
<li>Some bug fixes, including one reported by Gregor</li>
</ul>
<p>Go to the <a href="https://github.com/WouterBos/Codeview/downloads">download page</a>.</p>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/' rel='bookmark' title='Permanent Link: Codeview, a new template for JSDoc Toolkit'>Codeview, a new template for JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/27/codeview-update/' rel='bookmark' title='Permanent Link: Codeview update'>Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/29/another-codeview-update/' rel='bookmark' title='Permanent Link: Another Codeview update'>Another Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/' rel='bookmark' title='Permanent Link: Codeview is on Github now'>Codeview is on Github now</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/11/30/codeview-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Codeview update</title>
		<link>http://www.thebrightlines.com/2010/09/29/another-codeview-update/</link>
		<comments>http://www.thebrightlines.com/2010/09/29/another-codeview-update/#comments</comments>
		<pubDate>Wed, 29 Sep 2010 19:24:58 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[codeview]]></category>
		<category><![CDATA[jsdoc]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=714</guid>
		<description><![CDATA[Codeview is now at 1.1.1]]></description>
			<content:encoded><![CDATA[<p><a href="http://whatsthepointeh.blogspot.com/">Sean O Shea</a> was kind enough to report that the bottom part of the menu cannot be reached if you have many links in your left menu because of a large JavaScript library.</p>
<p>So I just wanted you guys to know that there&#8217;s a minor bugfix for Codeview</p>
<p><a class="button download" href="https://github.com/WouterBos/Codeview/downloads"><span> </span>Go to download page</a></p>
<div class="clear"></div>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/09/27/codeview-update/' rel='bookmark' title='Permanent Link: Codeview update'>Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/' rel='bookmark' title='Permanent Link: Codeview, a new template for JSDoc Toolkit'>Codeview, a new template for JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/' rel='bookmark' title='Permanent Link: Codeview is on Github now'>Codeview is on Github now</a></li>
<li><a href='http://www.thebrightlines.com/2010/11/30/codeview-1-2/' rel='bookmark' title='Permanent Link: Codeview 1.2'>Codeview 1.2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/09/29/another-codeview-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeview update</title>
		<link>http://www.thebrightlines.com/2010/09/27/codeview-update/</link>
		<comments>http://www.thebrightlines.com/2010/09/27/codeview-update/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 21:07:38 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[codeview]]></category>
		<category><![CDATA[design queries]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=701</guid>
		<description><![CDATA[I made an update for Codeview, a template for jsdoc-toolkit. Jsdoc-toolkit is a JavaScript documentation tool.]]></description>
			<content:encoded><![CDATA[<p>The template has some new features:</p>
<ul>
<li> <strong>Support for mobile devices</strong><br />
Through the use of CSS media queries.</li>
<li> <strong>Updated design</strong>
<ul>
<li>The left menu remains in view when scrolling down the page (in most browsers anyway)</li>
<li>Namespaces in left menu will wordwrap</li>
<li>Headings now have a custom font: M+</li>
</ul>
</li>
</ul>
<p><a class="button download" href="https://github.com/WouterBos/Codeview/downloads"><span> </span>Go to download page</a></p>
<div class="clear"></div>
<div class="wp-caption alignnone" style="width: 450px"><img title="Codeview for desktops" src="/article-data/images/codeview1.1-screen.png" alt="Codeview for desktops" width="440" height="372" /><p class="wp-caption-text">Codeview for desktops</p></div>
<div class="wp-caption alignnone" style="width: 310px"><img title="Codeview for handheld devices" src="/article-data/images/codeview1.1-handheld.png" alt="Codeview for handheld devices" width="300" height="455" /><p class="wp-caption-text">Codeview for handheld devices</p></div>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/' rel='bookmark' title='Permanent Link: Codeview, a new template for JSDoc Toolkit'>Codeview, a new template for JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/29/another-codeview-update/' rel='bookmark' title='Permanent Link: Another Codeview update'>Another Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/11/helping-browsers-with-media-queries/' rel='bookmark' title='Permanent Link: Extending media queries with JavaScript'>Extending media queries with JavaScript</a></li>
<li><a href='http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/' rel='bookmark' title='Permanent Link: Codeview is on Github now'>Codeview is on Github now</a></li>
<li><a href='http://www.thebrightlines.com/2010/11/30/codeview-1-2/' rel='bookmark' title='Permanent Link: Codeview 1.2'>Codeview 1.2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/09/27/codeview-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeview, a new template for JSDoc Toolkit</title>
		<link>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/</link>
		<comments>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:18:29 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[codeview]]></category>
		<category><![CDATA[jsdoc]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=605</guid>
		<description><![CDATA[I created a new HTML template for the Javascript documentation tool JSDoc, which is now free for download. It is tested in IE6 to IE9, FF3.6, Chrome 5 and Safari 4.]]></description>
			<content:encoded><![CDATA[<p><a class="button download" href="https://github.com/WouterBos/Codeview/downloads"><span> </span>Download Codeview 1.2</a></p>
<div class='clear'></div>
<p>The template is based on the basic template of <a href="http://code.google.com/p/jsdoc-toolkit/">JSDoc Toolkit</a>. The HTML structure is basically the same, but with a new design for both desktop and mobile browsers.</p>
<h2>Command line options</h2>
<ul>
<li><strong>Set title</strong> <code>-D="title:Estate Library"</code></li>
<li><strong>Remove _global_</strong> <code>-D="noGlobal:true"</code></li>
<li><strong>Make &#8220;Files&#8221; the homepage instead of &#8220;Classes&#8221;</strong> <code>-D="index:files"</code></li>
</ul>
<p>
    Example:<br />
    <code>java -jar jsdoc-toolkit\jsrun.jar jsdoc-toolkit\app\run.js -d=Documentation\ -D="noGlobal:true" -D="title:Estate Library" -D="index:files" -t=jsdoc-toolkit\templates\codeview -p -v Javascript\Estate\Source\Estate*.js</code>
</p>
<h2>Screenshots (version 1.1.2)</h2>
<div class="wp-caption alignnone" style="width: 450px"><img title="Codeview for desktops" src="/article-data/images/codeview1.1-screen.png" alt="Codeview for desktops" width="440" height="372" /><p class="wp-caption-text">Codeview for desktops</p></div>
<div class="wp-caption alignnone" style="width: 310px"><img title="Codeview for handheld devices" src="/article-data/images/codeview1.1-handheld.png" alt="Codeview for handheld devices" width="300" height="455" /><p class="wp-caption-text">Codeview for handheld devices</p></div>
<h2>Changelog:</h2>
<ul>
<li>
		<strong>1.2</strong><br />
		- Extra command line options, thanks to Aaron Wirtz<br />
		- A more logical template structure, thanks to Aaron Wirtz<br />
		- A quick filter, to filter the class list and methods<br />
		- Some bug fixes, including one reported by Gregor
	</li>
<li>
		<strong>1.1.2</strong><br />
		- Option for removing the _global_ link by adding <code>-D="noGlobal:true"</code> in the command line
	</li>
<li>
		<strong>1.1.1</strong><br />
		- Styling fixes
	</li>
<li>
		<strong>1.1</strong><br />
		- Support for mobile devices<br />
		- Updated design and styling fixes
	</li>
</ul>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/11/30/codeview-1-2/' rel='bookmark' title='Permanent Link: Codeview 1.2'>Codeview 1.2</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/27/codeview-update/' rel='bookmark' title='Permanent Link: Codeview update'>Codeview update</a></li>
<li><a href='http://www.thebrightlines.com/2010/03/28/document-your-javascript-interview-with-michael-mathews-of-jsdoc/' rel='bookmark' title='Permanent Link: Document your Javascript: interview with Michael Mathews of JSDoc Toolkit'>Document your Javascript: interview with Michael Mathews of JSDoc Toolkit</a></li>
<li><a href='http://www.thebrightlines.com/2011/07/30/codeview-is-on-github-now/' rel='bookmark' title='Permanent Link: Codeview is on Github now'>Codeview is on Github now</a></li>
<li><a href='http://www.thebrightlines.com/2010/09/29/another-codeview-update/' rel='bookmark' title='Permanent Link: Another Codeview update'>Another Codeview update</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Document your Javascript: interview with Michael Mathews of JSDoc Toolkit</title>
		<link>http://www.thebrightlines.com/2010/03/28/document-your-javascript-interview-with-michael-mathews-of-jsdoc/</link>
		<comments>http://www.thebrightlines.com/2010/03/28/document-your-javascript-interview-with-michael-mathews-of-jsdoc/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 20:19:45 +0000</pubDate>
		<dc:creator>Wouter Bos</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[jsdoc]]></category>
		<category><![CDATA[MichaelMathews]]></category>
		<category><![CDATA[micmath]]></category>

		<guid isPermaLink="false">http://www.thebrightlines.com/?p=525</guid>
		<description><![CDATA[Documenting source code is something that doesn't always get the priority it deserves. Especially Javascript which can be implemented rather ad-hoc. But there are enough tools around that can make documentation a lot easier.]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 200px"><img title="Michael Mathews" src="/article-data/images/micmath.jpg" alt="Michael Mathews" width="190" height="229" /><p class="wp-caption-text">Michael Mathews</p></div>
<p>I recently discovered <a href="http://code.google.com/p/jsdoc-toolkit/">JSDoc Toolkit</a>, a tool that generates documentation of your Javascript code in the form of a website. That was dearly needed because I wanted to give me and other team members a better overview of my growing JavaScript codebase.</p>
<h2>The history of JSDoc</h2>
<p>The JSDoc-toolkit and its predecessor JSDoc have been around for nearly 10 years now and in both cases the bulk of the code is programmed by Michael Mathews, often shortened to &#8220;micmath&#8221;. JSDoc started as a solution for the growing Javascript code at the company he worked for: &#8220;I couldn&#8217;t find any existing tool that did what I wanted, so I just naturally started building my own. I didn&#8217;t want to totally reinvent the wheel of course. I basically tried to port Sun&#8217;s JavaDoc idea over to JavaScript.&#8221; So he wrote a documentation tool in Perl. &#8220;Once it was done and we&#8217;d used it a bit, I decided to release it as open source on SourceForge. I figured if I found it useful then maybe someone else would as well.&#8221;</p>
<p>Although JSDoc is a very useful documentation tool and probably the first free tool as well, it wasn&#8217;t received that well back in 2001 according to Michael Mathews: &#8220;It seemed the general JavaScript community was not yet ready for JSDoc. Back then the majority of folks doing JavaScript were not in the habit of practicing what you would call &#8216;Software Engineering&#8217; best practice! It was, more often than not, a field dominated scripting cowboys. The idea of automatic documentation generation, I think, was seen as something unneeded by most. According to the stats from SourceForge, the JSDoc tool was only downloaded a few hundred times in the first several years &#8211; and frankly that already seemed amazing enough to me.&#8221;</p>
<h2>The renaissance of JavaScript</h2>
<p>But as the web got more mature, so did the developers. Javascript gained respect in the last few years and the emerge of large libraries such as YUI, jQuery and Prototype showed that Javascript can be used in a complex but constructive way. New ways of coding were used to structure Javascript. Michael noticed the trend: &#8220;Since about 2005 JSDoc really started to take off. Since then it&#8217;s been downloaded over 30,000 times. It still seems amazing to me.&#8221; The latest version of JSDoc Toolkit is downloaded almost 5000 times since it was published in September 2009.</p>
<h2>JSDoc in the wild</h2>
<p>The term JSDoc by the way is a bit confusing. It refers both to the syntax and the program. The syntax has been relatively successful as well: &#8220;I know that a few of Google&#8217;s projects use JsDoc comments to extend their functionality. Closure Compiler is a good example of that, though it can be a pain when other projects start redefining the JsDoc syntax for their own purposes in ways that are incompatible with the original project. Of course there is no official standard for JsDoc comments, so I can&#8217;t blame them, but that is something I&#8217;d really like to see: an official JsDoc standard, I mean.&#8221;</p>
<p>&#8220;The <em>idea</em> of JSDoc has been picked up by many large projects over the years. However, my application was originally written in Perl and wasn&#8217;t very flexible, consequently it got rewritten by others a few times for internal use only. I don&#8217;t want to name any names because I personally think that, while perfectly legal to do that, it violates the open source spirit I intended the work to be used in.&#8221;</p>
<div class="wp-caption alignnone" style="width: 450px"><img title="Document your code..." src="/article-data/images/micmath-4.png" alt="Document your code..." width="440" height="266" /><p class="wp-caption-text">Document your code...</p></div>
<div class="wp-caption alignnone" style="width: 450px"><img title="...run the tool" src="/article-data/images/micmath-2.png" alt="...run the tool" width="440" height="221" /><p class="wp-caption-text">...run the tool...</p></div>
<div class="wp-caption alignnone" style="width: 450px"><img title="... and publish the generated documentation website" src="/article-data/images/micmath-3.png" alt="... and publish the generated documentation website" width="440" height="266" /><p class="wp-caption-text">...and publish the generated documentation website.</p></div>
<h2>The Toolkit of JSDoc</h2>
<p>A year after JSDoc was released, Michael resigned as an active contributor to the project. Gabriel Reid took care of JSDoc after that. He maintained and extended it. But around 2006 Michael decided to do a major upgrade for JSDoc. &#8220;Big frameworks were the norm and along with that was both the need for API documentation as well as the complexity of writing documentation for all the new and interesting things people were doing with JavaScript. I was beginning to think that, in order to get JSDoc up to speed with this new world, it would need to be rewritten from scratch. So I started a discussion about that on the users&#8217; list. That eventually led to the current incarnation of the project: JsDoc Toolkit.&#8221;</p>
<p>The rewrite was written in Javascript itself. That was possible with the open source <a href="http://www.mozilla.org/rhino/">Rhino</a> platform that parses the Javascript. That wasn&#8217;t based on any technical issue: &#8220;I just liked the idea of a program parsing itself. As a bonus the users were more likely to be able to modify the source code if it was written in a language they work in.&#8221;</p>
<p>Rhino runs on Java and was  initially developed by Netscape. Rhino would have been a part of a  larger project to port Netscape Navigator to the Java platform, but that  never happened. Rhino is still being used and is maintained by the  Mozilla Foundation.</p>
<h2>How JSDoc works</h2>
<p>JSDoc reads the code and the comments. The comments need to be formatted according to the JSDoc convention. It&#8217;s a notation that&#8217;s used in other tools like Google&#8217;s Closure as well and is similar to the JavaDoc convention.</p>
<p>The comments give hints to JSDoc Toolkit how the JavaScript is structured. Unfortunately not all notations are recognized by the tool. In fact: most of the really exotic notations are not recognized. Michael: &#8220;People don&#8217;t realize how difficult it can be to do static code analysis on a language as dynamic as JavaScript. Well, at least I didn&#8217;t. It is provably impossible in most cases to know what the various states of a JavaScript program will be at runtime, just from looking at the source code. I tell people, if you can get a program to know what you want have programmed, just from the plain source code, consider yourself lucky!&#8221;</p>
<p>&#8220;But for the rest of us JsDoc Toolkit provides a way to document your code in such a way that the tool never has to even see your code. In fact, you can even use JsDoc Toolkit in files with just comments, no code whatsoever! So in that sense there isn&#8217;t any code you can&#8217;t document with JsDoc Toolkit, as long as you don&#8217;t rely on the static code analysis features.&#8221;</p>
<p>The word &#8220;Toolkit&#8221; in the name &#8220;JSDoc Toolkit&#8221;, by the way refers to the template engine JSPlate. Michael: &#8220;I eventually went with the &#8216;Toolkit&#8217; name mostly because I liked the sound of it, but also as a little nod to a favourite templating system of mine, Andy Wardley&#8217;s Perl Template Toolkit.&#8221;</p>
<h2>JsDoc Toolkit Version 3</h2>
<p>Right now Michael is in the middle of programming version 3 of JSDoc of which the first beta should be released somewhere this summer. &#8220;Basically there are a few feature requests from JsDoc Toolkit 2 that seem reasonable enough -things like documenting the same symbol more than once- which are utterly impossible due to the core architecture of the tool itself. All those feature requests are now on the table and I&#8217;ll try to include them in the new version.&#8221;</p>
<p>&#8220;One feature that will definitely be supported is the idea of overloaded functions. A typical example would be a function named &#8216;width()&#8217; that returns the width when it is called with no arguments, but will set the width when called with a numeric argument.&#8221;</p>
<p>&#8220;This is fundamentally not possible to document in JsDoc Toolkit Version 2. And that really is the point of rewriting the tool for Version 3: it will include, in it&#8217;s core, all the lessons learned from the past several years of supporting JsDoc Toolkit. I believe it will provide a much more flexible foundation to build on.&#8221;</p>
<p>In addition, Michael will make more use of Rhino than he already did. Until now Rhino was only used to parse the server-side JavaScript. The parser that walks over the source code looking for doc comments and things like function declarations was written by Michael himself. Rhino has a JavaScript parser built in, but it would took &#8220;some serious Java hacking&#8221; to get it right.</p>
<p>&#8220;Fast forward a few years and some important things have changed: namely, Norris Boyd has made accessing Rhino&#8217;s internal Abstract Syntax Tree much easier. In fact, it is now as easy to walk over your source code as it is to use, say, DOM nodes to walk over HTML. I&#8217;d be crazy not to take advantage of all that free power just sitting there waiting to be used!&#8221;</p>
<p>&#8220;So Version 3 will have none of my own parser left in it. This means I get to shed about 40% of the project&#8217;s code, which was dedicated to just that one task, and can now focus on the more important bits: parsing the doc comments.&#8221;</p>
<p>&#8220;It also means that, in theory, if Rhino can understand it, you&#8217;ll be able to get JsDoc Toolkit to understand it. Of course this is all taking time to get up to speed with, but I&#8217;ve decided to use build my tool on top of the new <a href="http://ringojs.org/wiki/">RingoJS</a> framework and that&#8217;s made my life much easier, and the process much faster.&#8221;</p>
<p>The first beta of version 3 is estimated to be released in early summer.</p>
<h2>Continuation</h2>
<p>One of the weak spots of the JSDoc project is that most of the time there&#8217;s only one active developer working on it. Although the tool is still alive and kicking, it naturally needs some nurturing to prevent it from getting stale. &#8220;To be honest it can feel like a real burden sometimes.&#8221; Michael admits. &#8220;It&#8217;s essentially just me these days, and I mostly can&#8217;t give the project all the time it deserves.&#8221; So developers are welcomed to join in the project: &#8220;I&#8217;m ready to sign them up! The fact is that I think of JSDoc as my baby. Not that I invented anything new or amazing, I most emphatically didn&#8217;t. But I&#8217;d lived with it long enough and I&#8217;d become associated with it, so I wanted to see it do well in life.&#8221;</p>
<p>And so the development continues even though there are now some other tools around like JSDoc. He even used some of them. &#8220;I used to write a lot of Perl and JavaScript at the same time and found NaturalDocs to be a great tool because it required a single format that could work in any language.&#8221;</p>
<h2>Server side JavaScript</h2>
<p>Although JavaScript as a program language is appreciated much more than a few years ago, it is still a quirky language. But that&#8217;s no problem for Michael: &#8220;Yeh, it&#8217;s a weird language. But I come from a background of Perl, so I like weird languages! But actually, JavaScript on the server side is a totally refreshing experience. Rhino, for example, allows you to use all the latest cutting-edge JavaScript syntax and features, and you never have to worry about running in an ancient or buggy web browser. I hope and expect that server side JavaScript will really start catching on in the next few years.&#8221;</p>
<h2>A bit about Michael Mathews</h2>
<p>It was hard to find a bit of information about New Yorker Michael Mathews. Although JSDoc has been around for almost 10 years and is downloaded a lot, he hasn&#8217;t been interviewed before. He has been asked many times for some assistance though. It can create funny situations: &#8220;I was doing some freelance work and the fellow sitting next to me asked if I&#8217;d ever heard anything about this &#8216;JSDoc&#8217; stuff he was trying to use. I said I had heard of it and helped him sort it out. I had to eventually admit that I was the creator of the tool. He seemed a little surprised by that.&#8221;</p>
<p>Mathews started as a zookeeper, which he had done for a few years. But it wasn&#8217;t that much fun for him. &#8220;I basically cleaned up after lots of unusual animals.&#8221; When he wasn&#8217;t working, he played with his computer. &#8220;By the late nineties I was had my own homepage, complete with the large, requisite, &#8216;Under Construction&#8217; message.&#8221; His work behind the computer payed off eventually: &#8220;in the fall of 1998 I was employed as a Web Developer for MTV Online, working in Times Square in New York City. It still seems amazing to me.</p>
<p>He now works since 2008 for the BBC in London where he works on the <a href="http://www.bbc.co.uk/glow/">Glow</a> JavaScript library. And yes, everything of it is documented with the help of JSDoc Toolkit.</p>
<p>Glow is a JavaScript library that just, like Prototype and jQuery, makes programming in JavaScript easier. The difference is that Glow supports whatever standard is currently defined by the BBC Standards and Guidelines for browsers, accessibility and usability. This could mean it has to support older browsers that other major JavaScript libraries have already dropped.</p>
<h2>Links</h2>
<ul>
<li><a href="http://code.google.com/u/micmath/">JSDoc Toolkit</a></li>
<li><a href="http://twitter.com/jsdoctoolkit">JSDoc Toolkit Twitter</a></li>
<li><a href="http://micmath.github.com/">JSDoc Toolkit 3 Blog</a></li>
<li><a href="http://groups.google.com/group/jsdoc-2?pli=1">JsDoc Toolkit Users Group</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://www.thebrightlines.com/2010/05/06/new-template-for-jsdoctoolkit-codeview/' rel='bookmark' title='Permanent Link: Codeview, a new template for JSDoc Toolkit'>Codeview, a new template for JSDoc Toolkit</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.thebrightlines.com/2010/03/28/document-your-javascript-interview-with-michael-mathews-of-jsdoc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

