<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>And now it's all this</title>
	<link>http://www.leancrew.com/all-this</link>
	<description>I just said what I said and it was wrong. Or was taken wrong.</description>
	<pubDate>Fri, 04 Jul 2008 16:34:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>Iraq, June 2008</title>
		<link>http://www.leancrew.com/all-this/2008/07/iraq-june-2008-2/</link>
		<comments>http://www.leancrew.com/all-this/2008/07/iraq-june-2008-2/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 16:34:58 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[politics]]></category>

		<category><![CDATA[politics iraq war]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/07/iraq-june-2008-2/</guid>
		<description><![CDATA[June continued the low casualty rate that&#8217;s been in place since the latter half of September.



For the past eight months we&#8217;ve seen casualty rates that are about a third of what they were over the previous twelve months, but we have yet to see an explanation. &#8220;The surge&#8221; is not an explanation; its a convenient [...]]]></description>
			<content:encoded><![CDATA[<p>June continued the low casualty rate that&#8217;s been in place since the latter half of September.</p>

<p><a href="http://www.leancrew.com/all-this/images/ic-200806.png"><img class="ss" src="http://www.leancrew.com/all-this/images/ic-200806-t.png" /></a></p>

<p>For the past eight months we&#8217;ve seen casualty rates that are about a third of what they were over the previous twelve months, but we have yet to see an explanation. &#8220;The surge&#8221; is not an explanation; its a convenient dodge for supporters of the war. The high military death rates continued for several months after the surge began.</p>

<p>One would think the real story of the sudden decrease in casualties&#8212;a decrease which, oddly, coincided with General Petraeus&#8217;s first appearance before Congress&#8212;would be of interest to the nation&#8217;s great newspapers. But all we get are soundbytes from the right and speculations from the left.</p>

<p>The answer will not change my belief that the war was both a strategic mistake and, more important, immoral, but it&#8217;s something we should all know. The Founding Fathers gave us a free press because they wanted an informed citizenry voting on the issues of the day. We&#8217;re being let down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/07/iraq-june-2008-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Iraq, June 2008</title>
		<link>http://www.leancrew.com/all-this/2008/07/iraq-june-2008/</link>
		<comments>http://www.leancrew.com/all-this/2008/07/iraq-june-2008/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 13:06:37 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[politics]]></category>

		<category><![CDATA[politics iraq war]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/07/iraq-june-2008/</guid>
		<description><![CDATA[June continued the low casualty rate that&#8217;s been in place since the latter half of September.



For the past eight months we&#8217;ve seen casualty rates that are about a third of what they were over the previous twelve months, but we have yet to see an explanation. &#8220;The surge&#8221; is not an explanation; its a convenient [...]]]></description>
			<content:encoded><![CDATA[<p>June continued the low casualty rate that&#8217;s been in place since the latter half of September.</p>

<p><a href="http://www.leancrew.com/all-this/images/ic-200806.png"><img class="ss" src="http://www.leancrew.com/all-this/images/ic-200806-t.png" /></a></p>

<p>For the past eight months we&#8217;ve seen casualty rates that are about a third of what they were over the previous twelve months, but we have yet to see an explanation. &#8220;The surge&#8221; is not an explanation; its a convenient dodge for supporters of the war. The high military death rates continued for several months after the surge began.</p>

<p>One would think the real story of the sudden decrease in casualties&#8212;a decrease which, oddly, coincided with General Petreas&#8217;s first appearance before Congress&#8212;would be of interest to the nation&#8217;s great newspapers. But all we get are soundbytes from the right and speculations from the left.</p>

<p>The answer will not change my belief that the war was both a strategic mistake and, more important, immoral, but it&#8217;s something we should all know. The Founding Fathers gave us a free press because they wanted an informed citizenry voting on the issues of the day. We&#8217;re being let down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/07/iraq-june-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why vi?</title>
		<link>http://www.leancrew.com/all-this/2008/07/why-vi/</link>
		<comments>http://www.leancrew.com/all-this/2008/07/why-vi/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 21:23:39 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[productivity]]></category>

		<category><![CDATA[text editing]]></category>

		<category><![CDATA[productivity textediting vi beeswax]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/07/why-vi/</guid>
		<description><![CDATA[You may have seen in the past week or so links to Beeswax, a new terminal-based productivity application inspired by Lotus Agenda. I&#8217;m not looking for a new productivity app&#8212;OmniFocus is working pretty well for me now&#8212;but I did find it interesting that Beeswax uses vi keybindings for adding and editing tasks.

Vi may be the [...]]]></description>
			<content:encoded><![CDATA[<p>You may have seen in the past week or so links to <a href="http://waxandwane.org/beeswax/">Beeswax</a>, a new terminal-based productivity application inspired by <a href="http://en.wikipedia.org/wiki/Lotus_Agenda">Lotus Agenda</a>. I&#8217;m not looking for a new productivity app&#8212;<a href="http://www.omnigroup.com/omnifocus">OmniFocus</a> is working pretty well for me now&#8212;but I did find it interesting that Beeswax uses <a href="http://thomer.com/vi/vi.html">vi</a> keybindings for adding and editing tasks.</p>

<p>Vi may be the oldest text editor still in wide use. The original vi was written by <a href="http://en.wikipedia.org/wiki/Bill_Joy">Bill Joy</a> while he was a member of the <a href="http://en.wikipedia.org/wiki/Berkeley_Software_Distribution">BSD</a> development group in the ’70s. It&#8217;s been rewritten several times since then; the most popular version nowadays is probably <a href="http://www.vim.org/">vim</a>.</p>

<p>Text editing in vi is characterized by <em>modes</em>. Text is added to a file while in <em>insert mode</em>, where every keystroke results in a character appearing on the screen, just like the most familiar editors of today. Text is edited in <em>command mode</em>, where keystrokes do things to the text in the file. For example:</p>

<ul>
<li><em>x</em> deletes the character at the cursor;</li>
<li><i>5x</i> deletes five characters, starting at the cursor;</li>
<li><em>w</em> moves the cursor forward one word;</li>
<li><em>d3w</em> deletes three words, starting at the cursor.</li>
</ul>

<p>As you can see, vi commands can be combined and multiplied. Also, the command mode eliminates the need for Command- and Control-key combinations.</p>

<p>Modal editing may seem weird now, but it was the norm in the old days. In fact, vi was a big hit because it was a &#8220;screen editor,&#8221; allowing you to look at and work on an entire screenful of text at a time. Most editors back then were &#8220;line editors,&#8221; which restricted you to just one line at a time.</p>

<p>Vi is intriguing to productivity geeks because its ability to combine commands gives users the leverage to do a lot of editing with very little typing. <a href="http://www.43folders.com/">Merlin Mann at 43 Folders</a> has mentioned vi several times, both on the blog and on the <a href="http://twit.tv/mbw">MacBreak Weekly</a> podcast. I&#8217;ve gone through my vi phases, too.</p>

<p>Back in my Linux days, I would periodically use vi as my primary text editor for a week or two at a time, but the modes always defeated me. I can&#8217;t tell you how many times I had to delete &#8220;:w&#8221; from my work<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>. I&#8217;m glad I spent the time to learn the basics, because vi can be very useful when I need to ssh into a remote computer and do a quick file edit. If the remote computer is Unix-like, some form of vi will certainly be there. But I was never able stay with vi as my regular text editor because of how I write.</p>

<p>As I see it, there are three types of writer:</p>

<p>First, there&#8217;s the kind that write final copy directly. Words, sentences, and paragraphs flow out in a smooth stream with no need for editing. While I don&#8217;t think any professional writing gets done this way, I know many people who can do correspondence like this. I&#8217;ve often gotten mail from clients with the notation at the bottom that the letter was &#8220;dictated but not reviewed.&#8221; Since these people don&#8217;t edit, the text editor they use is immaterial.</p>

<p>Second, there&#8217;s the kind that write in drafts. When I was a kid in the pre-PC era, school essays were always written as a longhand draft first, then edited and typed up as a final copy. Even today, when everyone writes on a computer, many writing guides suggest that you &#8220;get everything out&#8221; in a first draft and then clean things up with a good editing session. Vi&#8217;s modal editing can be great for this kind of writer. All of the first draft is done in insert mode and all the later editing in command mode.</p>

<p>Finally, there&#8217;s the kind that constantly fiddles with the text. This is me, and this is why my experiments with vi failed. I tend to rewrite sentences as I&#8217;m typing, stopping in the middle to go back and reset the tense or flip clauses around. It&#8217;s rare that I can type an entire paragraph without stopping to edit it. The need to keep shifting in vi from command to insert mode makes it a very clumsy editor for this type of writer.</p>

<p>I&#8217;ve tried to change my writing habits. I&#8217;ve tried to turn my brain&#8217;s internal editor off and just let the words come out, trusting myself to fix them later on. It would make writing much easier, regardless of the text editor I use. But I can&#8217;t do it.</p>

<p>One of the few advantages of reaching middle age is coming to recognize your strengths and weaknesses and knowing what you can change and what you can&#8217;t. This is something I can&#8217;t.</p>

<p>I wish the Beeswax developers well; I&#8217;m sure their system will be just the thing for many people. But I know my limitations.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/textediting" rel="tag">textediting</a>
<a href="http://technorati.com/tag/vi" rel="tag">vi</a>
<a href="http://technorati.com/tag/beeswax" rel="tag">beeswax</a></p>

<!-- technorati tags end -->

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>That&#8217;s the command for saving.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/07/why-vi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Words with many doubled letters</title>
		<link>http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/</link>
		<comments>http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 18:26:49 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[programming]]></category>

		<category><![CDATA[programming perl dictionary]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/</guid>
		<description><![CDATA[In a footnote to my last post, I mentioned that typing &#8220;bookkeeper&#8221; over and over made me realize that it had three consecutive doubled letters, and I wondered if it was the only such word in English. Today I learned that the answer is basically &#8220;yes.&#8221;

Unix and Unix-like systems (Linux, OS X) have a builtin [...]]]></description>
			<content:encoded><![CDATA[<p>In a footnote to <a href="http://www.leancrew.com/all-this/2008/06/repeating-dates-in-omnifocus-and-ical/">my last post</a>, I mentioned that typing &#8220;bookkeeper&#8221; over and over made me realize that it had three consecutive doubled letters, and I wondered if it was the only such word in English. Today I learned that the answer is basically &#8220;yes.&#8221;</p>

<p>Unix and Unix-like systems (Linux, OS X) have a builtin spellchecker that accesses a simple text-only dictionary at <code>/usr/share/dict/words</code>. This is a file with, on my machine, 234,936 words, one per line. Finding out how many have three consecutive doubled letters is a simple Perl one-liner:</p>

<pre><code>perl -ne 'print if /(.)\1(.)\2(.)\3/' /usr/share/dict/words
</code></pre>

<p>The <code>n</code> option tells Perl to read the file one line at a time and apply the program to each line in turn. The <code>e</code> option tells it that the program is on the command line, not in a file. The program itself&#8212;between the single quotes&#8212;prints the line if it matches the regular expression between the slashes. The regular expression looks for</p>

<pre><code>(.)       any character (captured)
\1        the first captured expression
(.)       any character (captured)
\2        the second captured expression
(.)       any character (captured)
\3        the third captured expression
</code></pre>

<p>which is regular expression-speak for three consecutive doubled characters. The result is</p>

<pre><code>bookkeeper
bookkeeping
subbookkeeper
</code></pre>

<p>So &#8220;bookkeeper&#8221; and other forms of it are the only words in the dictionary with three consecutive doubled letters. I find &#8220;subbookeeper&#8221; rather suspect; it seems like a word coined specifically to have <em>four</em> consecutive doubled letters. It can be <a href="http://www.definition-of.com/subbookkeeper">found on the Internet</a>, but I&#8217;m not buying it.</p>

<p>The one-liner can be generalized to find all the words with three doubled letters, regardless of whether they&#8217;re consecutive.</p>

<pre><code>perl -ne 'print if /(.)\1.*(.)\2.*(.)\3/' /usr/share/dict/words
</code></pre>

<p>This gives a list of 170 words. Some, like &#8220;whippoorwill,&#8221; &#8220;successfully,&#8221; and &#8220;committee,&#8221; are pretty common. Most, like &#8220;unpossessedness&#8221; and &#8220;buttressless,&#8221; are weird constructions with &#8220;-ness&#8221; or &#8220;-less&#8221; suffixes that only a lawyer or bureaucrat would use.</p>

<p>There are four words with four doubled letters. The one-liner</p>

<pre><code>perl -ne 'print if /(.)\1.*(.)\2.*(.)\3.*(.)\4/' /usr/share/dictwords
</code></pre>

<p>yields</p>

<pre><code>killeekillee
possessionlessness
subbookkeeper
successlessness
</code></pre>

<p>I love &#8220;successlessness&#8221; because it defines whoever would use it.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/programming" rel="tag">programming</a>
<a href="http://technorati.com/tag/perl" rel="tag">perl</a>
<a href="http://technorati.com/tag/dictionary" rel="tag">dictionary</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Repeating dates in OmniFocus and iCal</title>
		<link>http://www.leancrew.com/all-this/2008/06/repeating-dates-in-omnifocus-and-ical/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/repeating-dates-in-omnifocus-and-ical/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 04:46:49 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[mac software productivity gtd omnifocus ical calendar]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/repeating-dates-in-omnifocus-and-ical/</guid>
		<description><![CDATA[In trying to create a repeating OmniFocus task, I learned that its handling of repeating dates is pretty rudimentary. iCal is much better, but is still lacking some niceties that can come in handy.

My company uses an outside bookkeeper who comes to our office on the last Friday of every month to do the accounting [...]]]></description>
			<content:encoded><![CDATA[<p>In trying to create a repeating OmniFocus task, I learned that its handling of repeating dates is pretty rudimentary. iCal is much better, but is still lacking some niceties that can come in handy.</p>

<p>My company uses an outside bookkeeper who comes to our office on the last Friday of every month to do the accounting that pays our bills, taxes, and salaries. Some paperwork needs to be done by one of the partners before her visit, and if I&#8217;m in town, I&#8217;m usually the one who does it. Last week I tried to set up an <a href="http://www.omnigroup.com/omnifocus">OmniFocus</a> task to remind me of the necessary paperwork, but I was stopped short by some of OmniFocus&#8217;s limitations.</p>

<p>I started with what I thought was the obvious approach. I created an Accounting project and added a repeating task to get the needed paperwork ready. Two problems:</p>

<ol>
<li>When I&#8217;m showing Next Actions&#8212;which is my usual working Perspective&#8212;<em>all</em> the Next Actions appear. But the paperwork for the bookkeeper shouldn&#8217;t be done until a few days before salary checks are cut, so this task will just clutter up my view for most of the month. I may be able to get around this problem by fiddling with start dates or by scheduling an AppleScript to toggle the task status from On Hold to Active near the end of the month.</li>
<li>OmniFocus&#8217;s Repeat Every setting is just too limited. It allows you repeat a task every so many days, weeks, months, or years, but it can&#8217;t handle something like &#8220;the last Friday of the month.&#8221;</li>
</ol>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/of-repeat-every.png" /></p>

<p>This second problem is the killer, and it&#8217;s a pretty embarrassing lack of functionality. The algorithms for this kind of repetition are well established and available. Papers and books on the topic by Reingold and Dershowitz can be found <a href="http://emr.cs.iit.edu/home/reingold/calendar-book/papers/">here</a>, and you can always look at the source code for the <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Calendar_002fDiary.html#Calendar_002fDiary">Calendar/Diary module in Emacs</a>, or for the old <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/calendar.1.html">BSD <code>calendar</code> program</a>, which comes with OS X.</p>

<p><a href="http://www.apple.com/macosx/features/300.html#ical">iCal</a> has a much better repeating date implementation. I&#8217;ve used it to create an event for the bookkeeper&#8217;s visit on the morning of the last Friday of every month.</p>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/ical-repeating-event.png" /></p>

<p>This is great for keeping track of the visits, but isn&#8217;t ideal for keeping track of my paperwork task. <a href="http://davidco.com/store/product.php?productid=16182">David Allen saith</a> that the calendar is <em>only</em> for things that must be done on that day. The paperwork can be done any time in the week before the last Friday of the month and is best done a day or two before the bookkeeper&#8217;s visit.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Since OmniFocus can&#8217;t do what I need on its own, the iCal entry will have to suffice until the OmniGroup improves its date repetition code, or until I can figure out a way to force OmniFocus to do my bidding.</p>

<p>I should mention here that iCal&#8217;s repeated date handling isn&#8217;t perfect. It can&#8217;t, for example, handle US election days or the US federal holiday for Christmas. Election day is <em>not</em> the first Tuesday in November, it&#8217;s the <a href="http://en.wikipedia.org/wiki/Election_Day_(United_States)">day after the first Monday in November</a>. And the federal Christmas holiday&#8212;the day you get off work&#8212;is December 25 only if December 25 falls on a weekday. If it falls on a weekend, the <a href="http://aa.usno.navy.mil/faq/docs/holidays.php">Christmas holiday is the weekday nearest to December 25</a>. Try doing either of these as a repeating event in iCal.</p>

<p>Although I have no solution now, I&#8217;m not giving up. Maybe I can use iCal&#8217;s ability to schedule AppleScripts to run a few days before an event to create an OmniFocus task telling me to get the paperwork ready. I need to dig into OmniFocus&#8217;s AppleScript library.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/mac" rel="tag">mac</a>
<a href="http://technorati.com/tag/software" rel="tag">software</a>
<a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/gtd" rel="tag">gtd</a>
<a href="http://technorati.com/tag/omnifocus" rel="tag">omnifocus</a>
<a href="http://technorati.com/tag/ical" rel="tag">ical</a>
<a href="http://technorati.com/tag/calendar" rel="tag">calendar</a></p>

<!-- technorati tags end -->

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>My repeated typing of &#8220;bookkeeper&#8221; is making me wonder if it&#8217;s the only word with three consecutive doubled letters. (<strong>Update</strong>: <a href="http://www.leancrew.com/all-this/2008/07/words-with-many-doubled-letters/">Yes!</a>)&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/repeating-dates-in-omnifocus-and-ical/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flickr updates in the sidebar</title>
		<link>http://www.leancrew.com/all-this/2008/06/flickr-updates-in-the-sidebar/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/flickr-updates-in-the-sidebar/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 16:06:15 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[blogging]]></category>

		<category><![CDATA[blogging php wordpress flickr flickrrss]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/flickr-updates-in-the-sidebar/</guid>
		<description><![CDATA[I just added a section to the sidebar to display my most recent upload to Flickr. The flickrRSS plugin from Eightface makes it very simple. I almost never use my Flickr account, but I hope to change that now that I&#8217;ve added the email address for Flickr uploading to my iPhone.

The photo will be 100 [...]]]></description>
			<content:encoded><![CDATA[<p>I just added a section to the sidebar to display my most recent upload to <a href="http://www.flickr.com/">Flickr</a>. The <a href="http://eightface.com/wordpress/flickrrss/">flickrRSS plugin from Eightface</a> makes it very simple. I almost never use my Flickr account, but I hope to change that now that I&#8217;ve added the email address for Flickr uploading to my iPhone.</p>

<p>The photo will be 100 pixels wide. Because the width of the sidebar changes with the user&#8217;s font size (it&#8217;s specified in ems), the photo will take up different amounts of the sidebar for different users. But it should always fit unless you use a really small default font.</p>

<p>I&#8217;ve also eliminated the RSS feed links from the sidebar, since browsers now look for feeds on their own and display them in the toolbar.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/blogging" rel="tag">blogging</a>
<a href="http://technorati.com/tag/php" rel="tag">php</a>
<a href="http://technorati.com/tag/wordpress" rel="tag">wordpress</a>
<a href="http://technorati.com/tag/flickr" rel="tag">flickr</a>
<a href="http://technorati.com/tag/flickrrss" rel="tag">flickrrss</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/flickr-updates-in-the-sidebar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>OmniFocus and OmniOutliner Pro</title>
		<link>http://www.leancrew.com/all-this/2008/06/omnifocus-and-omnioutliner-pro/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/omnifocus-and-omnioutliner-pro/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 16:52:04 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[mac productivity software omnifocus omnioutliner gtd]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/omnifocus-and-omnioutliner-pro/</guid>
		<description><![CDATA[My free test period for OmniFocus ran out today and I couldn&#8217;t open my GTD lists. This bothered me, which I took to be a sign that it&#8217;s a program I really use and should buy.

OmniFocus normally sells for $80, but if you&#8217;re a licensed owner of OmniOutliner Pro, you can buy OmniFocus for $60. [...]]]></description>
			<content:encoded><![CDATA[<p>My free test period for <a href="http://www.omnigroup.com/omnifocus">OmniFocus</a> ran out today and I couldn&#8217;t open my GTD lists. This bothered me, which I took to be a sign that it&#8217;s a program I really use and should buy.</p>

<p>OmniFocus normally sells for $80, but if you&#8217;re a licensed owner of <a href="http://www.omnigroup.com/applications/omnioutliner/pro/">OmniOutliner Pro</a>, you can buy OmniFocus for $60. I <em>don&#8217;t</em> own OO Pro, but I do have the regular version of OO that was bundled with my iMac. Since that can be upgraded to OO Pro for $30, doing the upgrade and then buying OmniFocus was just $10 more than getting OmniFocus alone. OK, OmniGroup, you win&#8212;I&#8217;ll get both.</p>

<p>And yes, I&#8217;ll get <a href="http://www.omnigroup.com/applications/omnifocus/iphone/">OmniFocus for the iPhone</a> when it comes out. I&#8217;m turning into the OmniBitch.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/mac" rel="tag">mac</a>
<a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/software" rel="tag">software</a>
<a href="http://technorati.com/tag/omnifocus" rel="tag">omnifocus</a>
<a href="http://technorati.com/tag/omnioutliner" rel="tag">omnioutliner</a>
<a href="http://technorati.com/tag/gtd" rel="tag">gtd</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/omnifocus-and-omnioutliner-pro/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My no-server personal wiki—Part 3</title>
		<link>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-3/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-3/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 00:24:51 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[mac productivity programming wiki python javascript]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/my-no-sever-personal-wiki%e2%80%94part-3/</guid>
		<description><![CDATA[This the last post describing the self-contained wiki-like system I use to keep track of project notes at work. The first post in the series explained my motivation for creating this system. The second post described how I use it. In this post, I&#8217;ll show the behind-the-scenes programming that puts it together.

Makefile

Let&#8217;s start with the [...]]]></description>
			<content:encoded><![CDATA[<p>This the last post describing the self-contained wiki-like system I use to keep track of project notes at work. <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/">The first post in the series</a> explained my motivation for creating this system. <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-2/">The second post</a> described how I use it. In this post, I&#8217;ll show the behind-the-scenes programming that puts it together.</p>

<h2>Makefile</h2>

<p>Let&#8217;s start with the Makefile. I mentioned <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-2/">before</a> that the HTML pages are generated by running the <code>make</code> utility in the <code>notes</code> directory. Here&#8217;s the Makefile.</p>

<pre><code> 1:  # Makefile for project notes.
 2:  
 3:  mdfiles := $(wildcard *.md)
 4:  htmlfiles := $(patsubst %.md, %.html, $(mdfiles))
 5:  
 6:  all: notesList.js $(htmlfiles)
 7:  
 8:  notesList.js::
 9:     python buildNotesList.py &gt; notesList.js
10:  
11:  %.html: %.md project.info header.tmpl footer.tmpl
12:     python buildPage.py $* &gt; $@
13:     
14:  clean:
15:     rm $(htmlfiles) notesList.js
</code></pre>

<p>Lines 2 and 3 use wildcards and pattern substitutions to create variables that define all the <a href="http://daringfireball.net/projects/markdown/">Markdown</a>-formatted (<code>.md</code>) content files and the corresponding HTML pages.</p>

<p>Line 6 defines the <code>all</code> rule; because it&#8217;s the first rule in the Makefile, it&#8217;s also the default rule, so executing <code>make</code> is the same as running <code>make all</code>. It builds the JavaScript file <code>notesList.js</code> and the HTML pages.</p>

<p>Lines 8 and 9 define the rules for building the <code>notesList.js</code> file. It&#8217;s built by running the Python program <code>buildNotesList.py</code>, which we&#8217;ll get to in a bit. As we&#8217;ll see, <code>notesList.js</code> defines the sidebar links to all the HTML pages in the <code>notes</code> folder. Since new notes can be added at any time, <code>notesList.js</code> must be rebuilt whenever <code>make</code> is run.</p>

<p>Lines 11 and 12 define the rule for building the HTML notes pages. A page gets (re)built whenever</p>

<ul>
<li>its corresponding <code>.md</code> file is created;</li>
<li>its corresponding <code>.md</code> file is updated; or</li>
<li>whenever the header or footer template file is updated.</li>
</ul>

<p>The page is built by running another Python program, <code>buildPage.py</code>, taking the corresponding <code>.md</code> file as input.</p>

<p>Lines 14 and 15 define a cleanup rule that deletes the HTML files and <code>notesList.js</code>. This rule is executed by running <code>make clean</code> from the Terminal. It&#8217;s sort of a defensive rule; if things get really screwed up, <code>make clean</code> will take me back to a pristine state. All the deleted files can be regenerated by running <code>make</code>.</p>

<h2>notesList.js  and buildNotesList.py</h2>

<p>As mentioned above, <code>notesList.js</code> is a JavaScript file that&#8217;s used to generate the list of links to other notes pages that appears at the top of the sidebar (see the screenshot of a page in <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-2/">Part 2</a>). It defines a JavaScript function, <code>showNotesList</code>, that writes a series of list items with links to the notes pages. In the skeleton version of the <code>notes</code> folder described in <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-2/">Part 2</a>, there is only one HTML notes page so <code>notesList.js</code> is very simple:</p>

<pre><code>function showNotesList(){
  document.write('&lt;li&gt;&lt;a href="aa-overview.html"&gt;Overview&lt;/a&gt;&lt;/li&gt;')
}
</code></pre>

<p>The <code>notesList.js</code> file is generated by the Python program, &#8216;buildNotesList.py`:</p>

<pre><code> 1:  #!/usr/bin/python
 2:  
 3:  import os
 4:  
 5:  # Get the titles of all the notes files in the directory. The
 6:  # title is assumed to be the first line of the file. Truncate
 7:  # the title at a word boundary if it's longer than maxlength.
 8:  # Print out a JavaScript function that will write an HTML list
 9:  # of the notes files.
10:  
11:  fileLI = []
12:  maxlength = 35
13:  allFiles = os.listdir('.')
14:  baseNames = [ f[:-3] for f in allFiles if f[-3:] == '.md' ]
15:  for fn in baseNames:
16:    f = file(fn + '.md')
17:    top = f.readline()
18:    title = top.strip('# \n')
19:    if len(title) &gt; maxlength:
20:      words = title.split()
21:      twords = []
22:      count = 0
23:      for w in words:
24:        if count + len(w) &gt; maxlength:
25:          break
26:        else:
27:          twords.append(w)
28:          count += len(w) + 1 
29:      title = ' '.join(twords) + "&amp;#8230;"
30:    fileLI.append('&lt;li&gt;&lt;a href="%s.html"&gt;%s&lt;/a&gt;&lt;/li&gt;' % (fn,title))
31:    f.close()
32:  
33:  print '''function showNotesList(){
34:    document.write('%s')
35:  }''' % ' '.join(fileLI)
</code></pre>

<p>I think the comment at the top of the file describes it pretty well. The trickiest part of the program is getting the title of the link. The title of the <em>page</em> is the first line of the <code>.md</code> file, with any leading or trailing hash marks (#) deleted. But since a page title could be pretty long and the sidebar is rather narrow, I wanted the <em>link</em> titles to be truncated to the nearest word boundary short of 35 characters. That&#8217;s what Lines 19-29 do, putting an ellipsis (…, HTML entity <code>&amp;#8230;</code>) at the end to indicate the truncation.</p>

<h2>buildPage.py</h2>

<p>This is the real workhorse of the system.</p>

<pre><code> 1:  #!/usr/bin/env python
 2:  
 3:  import sys
 4:  import os
 5:  import os.path
 6:  import time
 7:  import string
 8:  import urllib
 9:  
10:  # The argument is the basename of the Markdown source file.
11:  mdFile = sys.argv[1] + '.md'
12:  
13:  # Open the page files and process the content.
14:  header = open('header.tmpl', 'r')
15:  footer = open('footer.tmpl', 'r')
16:  cmd = 'MultiMarkdown %s | SmartyPants' % mdFile
17:  content = os.popen(cmd, 'r')
18:  
19:  #  Make the template.
20:  templateParts = [header.read(), content.read(), footer.read()]
21:  template = string.Template(''.join(templateParts))
22:  
23:  # Close the page files.
24:  header.close()
25:  footer.close()
26:  content.close()
27:  
28:  # Initialize the dictionary of dynamic information.
29:  info = {}
30:  
31:  # Dictionary entry with long modification date of the Markdown file.
32:  mdModTime = time.localtime(os.path.getmtime(mdFile))
33:  info['modldate'] = time.strftime('%B %e, %Y', mdModTime)
34:  info['modldate'] = info['modldate'].replace('  ', ' ')
35:  
36:  # Dictionary entry with short modification date of the Markdown file.
37:  info['modsdate'] = time.strftime('%m/%e/%y', mdModTime)
38:  info['modsdate'] = info['modsdate'].replace(' ', '')
39:  
40:  # Dictionary entry with modification time of the Markdown file.
41:  info['modtime'] = time.strftime('%l:%M %p', mdModTime)
42:  if info['modtime'][0] == ' ':
43:    info['modtime'] = info['modtime'][1:]
44:  
45:  # Dictionary entry with absolute path to the Markdown file (for editing).
46:  info['mdpath'] = os.path.abspath(mdFile)
47:  
48:  # Add project info to the dictionary.
49:  projInfo = open('project.info', 'r')
50:  for line in projInfo:
51:    if line[0] == '#' or line.strip() == '':
52:      continue
53:    name, value = [s.strip() for s in line.split('=', 1)]
54:    if name in info:
55:      info[name] += '\n' + value
56:    else:
57:      info[name] = value
58:  
59:  projInfo.close()
60:  
61:  # Dictionary entry with absolute path to project info file (for editing).
62:  info['infopath'] = os.path.abspath('project.info')
63:  
64:  # Convert the contacts into a series of HTML list items.
65:  if 'contact' in info:
66:    contactLI = []
67:    cl = [s.split(':',1) for s in info['contact'].split('\n')]
68:    for c in cl:
69:      if len(c) == 1:
70:        contactLI.append('&lt;li&gt;%s&lt;/li&gt;' % c[0])
71:      else:
72:        contactLI.append('&lt;li&gt;&lt;a href="addressbook://%s"&gt;%s&lt;/a&gt;&lt;/li&gt;'\
73:        % tuple(reversed(c)))
74:    info['contactlist'] = '\n'.join(contactLI)
75:  else:
76:    info['contactlist'] = ''
77:  
78:  # Output the template with the dynamic information substituted in.
79:  print template.safe_substitute(info)
</code></pre>

<p>It does basically five things:</p>

<ol>
<li>It processes the given Markdown file through <a href="http://fletcherpenney.net/MultiMarkdown">MultiMarkdown</a> (Fletcher Penney&#8217;s extended version of Markdown that includes support for tables and other niceties) and <a href="http://daringfireball.net/projects/smartypants/">SmartyPants</a> (John Gruber&#8217;s typographical conversion program that substitutes curly quotes for straight quotes and m- and n- dashes for multiple hyphen sequences). See Lines 16 and 17.</li>
<li>It concatenates the header template, the just-generated main content, and the footer template into a new string template that will later be turned into the HTML page file. See Lines 20 and 21.</li>
<li>It queries the file system for info about the source Markdown (<code>.md</code>) file and creates a set of dictionary entries with that information. See Lines 31-46.</li>
<li>It goes through the <code>project.info</code> file, and creates another set of dictionary entries with the data it reads from that file. See Lines 48-76.</li>
<li>It creates the HTML page by substituting the dictionary entries from Steps 3 and 4 into the string template from Step 2.</li>
</ol>

<h2>header.tmpl and footer.tmpl</h2>

<p>The header template file looks like this:</p>

<pre><code> 1:  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 2:     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
 3:  &lt;html&gt;
 4:  &lt;head&gt;
 5:     &lt;title&gt;$projname ($projnumber)&lt;/title&gt;
 6:     &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
 7:     &lt;link rel="stylesheet" type="text/css" media="all" href="notes.css" /&gt;
 8:     &lt;link rel="stylesheet" type="text/css" media="print" href="notes-print.css" /&gt;
 9:     &lt;!-- &lt;script type="text/javascript" src="file:///Users/drang/Library/JavaScript/jsMath/easy/load.js"&gt;&lt;/script&gt; --&gt;
10:     &lt;script type="text/javascript" src="styleLineNumbers.js"&gt;&lt;/script&gt;
11:     &lt;script type="text/javascript" src="notesList.js"&gt;&lt;/script
12:  &lt;/head&gt;
13:  &lt;body onload="styleLN()"&gt;
14:     &lt;div id="container"&gt;
15:        &lt;div id="title"&gt;
16:           &lt;h1 class="left"&gt;$projname&lt;/h1&gt;
17:              &lt;h1 class="right"&gt;$projnumber&lt;/h1&gt;
18:        &lt;/div&gt; &lt;!-- title --&gt;
19:        &lt;div id="sidebar"&gt;
20:           &lt;h1&gt;Project notes:&lt;/h1&gt;
21:           &lt;ul&gt;
22:              &lt;script type="text/javascript"&gt;showNotesList()&lt;/script&gt;
23:           &lt;/ul&gt;
24:           &lt;hr /&gt;
25:           &lt;h1&gt;Contacts:&lt;/h1&gt;
26:           &lt;ul&gt;
27:              $contactlist
28:           &lt;/ul&gt;
29:           &lt;hr /&gt;
30:           &lt;h1&gt;Source:&lt;/h1&gt;
31:           &lt;ul&gt;
32:              &lt;li&gt;&lt;a href="txmt://open?url=file://$mdpath"&gt;Edit in TextMate&lt;/a&gt;&lt;/li&gt;
33:              &lt;li&gt;Last modified&lt;br /&gt;
34:                 &amp;nbsp;$modldate&lt;br /&gt;
35:                 &amp;nbsp;at $modtime&lt;/li&gt;
36:            &lt;/ul&gt;
37:            &lt;hr /&gt;
38:            &lt;ul&gt;
39:              &lt;li&gt;&lt;a href="txmt://open?url=file://$infopath"&gt;Edit project info&lt;/a&gt;&lt;/li&gt;
40:            &lt;/ul&gt;
41:        &lt;/div&gt; &lt;!-- sidebar --&gt;
42:        
43:        &lt;div id="note"&gt;
</code></pre>

<p>Although it&#8217;s called <code>header.tmpl</code>, you&#8217;ll see that it really contains both the header and the sidebar.</p>

<p>Line 9 in the <code>&lt;head&gt;</code> section contains a call to a JavaScript file that isn&#8217;t in the <code>notes</code> folder. This is one of the files that comes with the <a href="http://www.math.union.edu/~dpvc/jsmath/">jsMath</a> library, a set of JavaScript and PNG files created by Davide Cervone that allow equations to be embedded in the pages without the need for MathML support. Since most people don&#8217;t need equations in their notes, I&#8217;ve commented this line out. My project notes often do need equations, so I usually have this line uncommented and it brings in jsMath library from its spot in my <code>~/Library/JavaScript</code> folder.</p>

<p>The footer template looks like this:</p>

<pre><code> 1:  &lt;hr /&gt;
 2:  &lt;p class="info"&gt;
 3:     Source: &lt;a href="txmt://open?url=file://$mdpath"&gt;$mdpath&lt;/a&gt;&lt;br /&gt;
 4:     Last modified: $modldate at $modtime&lt;br /&gt;
 5:     &lt;!-- This page built: $buildtime --&gt;
 6:  &lt;/p&gt;
 7:  &lt;/div&gt; &lt;!-- note --&gt;
 8:  &lt;/div&gt; &lt;!-- container --&gt;
 9:  &lt;/body&gt;
10:  &lt;/html&gt;
</code></pre>

<p>It adds a little notation at the bottom of the page, telling where the source file is and when it was last updated.</p>

<p>The structure of the resulting HTML page is pretty simple:</p>

<pre><code>&lt;div id="container"&gt;
   &lt;div id="title"&gt;
      blahblahblah
   &lt;/div&gt; &lt;!-- title --&gt;
   &lt;div id="sidebar"&gt;
      blahblahblah
   &lt;/div&gt; &lt;!-- sidebar --&gt;
   &lt;div id="note"&gt;
      blahblahblah
    &lt;/div&gt; &lt;!-- note --&gt;
&lt;/div&gt; &lt;!-- container --&gt;
</code></pre>

<h2>CSS</h2>

<p>I&#8217;m not going to go through the CSS files because they&#8217;re long and not that interesting. suffice it to say that <code>notes.css</code> floats the sidebar to the right and defines a set of colors, type sizes, and spacing that I find pleasing. Not surprisingly, it&#8217;s quite similar to the layout of this blog. The CSS file for printing, <code>notes-print.css</code>, hides the sidebar because navigation links don&#8217;t work on paper and turns all the colors to black and white because that&#8217;s the kind of printer I use.</p>

<h2>styleLineNumbers.js</h2>

<p>If a notes file contains source code with line numbers, the JavaScript functions in this file will style it nicely and allow me to toggle the line numbers on and off. It&#8217;s the same set of functions I use on this blog and which I&#8217;ve described in <a href="http://www.leancrew.com/all-this/2007/12/source-code-line-numbers-and-javascript/">an earlier post</a>.</p>

<h2>All together now</h2>

<p>If you&#8217;re interested in playing around with this system, I&#8217;ve made a zip file of my skeleton <code>notes</code> folder available to <a href="http://www.leancrew.com/downloads/notes.zip">download</a>. Have fun, and let me know of any improvements you make.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/mac" rel="tag">mac</a>
<a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/programming" rel="tag">programming</a>
<a href="http://technorati.com/tag/wiki" rel="tag">wiki</a>
<a href="http://technorati.com/tag/python" rel="tag">python</a>
<a href="http://technorati.com/tag/javascript" rel="tag">javascript</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My no-server personal wiki—Part 2</title>
		<link>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-2/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-2/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 22:19:55 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[productivity wiki python markdown]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-2/</guid>
		<description><![CDATA[In my last post, I gave my reasons for needing a wiki for project notes, what I wanted it to do, and why I decided to roll my own instead of going with any of the readily available free or commercial offerings. In this post, I&#8217;ll describe how my system works. If some of the [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/">my last post</a>, I gave my reasons for needing a wiki for project notes, what I wanted it to do, and why I decided to roll my own instead of going with any of the readily available free or commercial offerings. In this post, I&#8217;ll describe how my system works. If some of the choices I&#8217;ve made seem odd to you, the <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/">earlier post</a> should explain the whys and wherefores.</p>

<p>The files for the wiki&#8212;both the content and the build files&#8212;sit in a folder called &#8220;notes.&#8221; This makes the system portable. I keep a skeleton version of this folder on my Desktop, and whenever I need a notes wiki for a new project, I drag a copy from the Desktop into the project folder. Here&#8217;s a view of the skeleton.</p>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/notes-wiki-folder.png" /></p>

<p>The content is kept in the Markdown-formatted files with an <code>.md</code> extension. The skeleton provides just one of these, <code>aa-overview.md</code>, which is filled with mostly nonsense. Any file added to the folder with an <code>.md</code> extension will be taken as the content for a new page. The wiki pages themselves are the <code>.html</code> files with the same basenames as the <code>.md</code> files. Everything else in the folder is either a programming, template, or configuration file.</p>

<p>The HTML version of <code>aa-overview</code> is intended to be the home page of the wiki. For the skeleton file, it looks like this:</p>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/notes-wiki-overview.png" /></p>

<p>The skeleton <code>aa-overview.md</code>, as with all the Markdown files, contains just the content of the main section of the page:</p>

<pre><code># Overview #

## Background ##

This is where I describe the project.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</code></pre>

<p>The header, the sidebar, and the footer are all built from the template and configuration files. The page is built statically, so <code>aa-overview.html</code> is a full HTML file, not a fragment.</p>

<p>The top section of the sidebar contains links to all the notes files in the folder. The links are created automatically by the build script, which looks through the folder for all the <code>.md</code> files. These links will be in the sidebar of every page, so I can go directly from any page in the wiki to any other. This would make for a very cluttered sidebar if my projects had hundreds of notes pages, but I&#8217;ve never needed more than a dozen or so.</p>

<p>Each page&#8217;s name is taken from top line of its <code>.md</code> file. The page links are sorted according to the file name, which is why the overview page is given the &#8220;aa-&#8221; prefix&#8212;I want it at the top of the list. I use this method of sorting to group similar pages in the list of links; inspection notes have an &#8220;ii-&#8221; prefix, lab notes have an &#8220;ll-&#8221; prefix, etc.</p>

<p>The project name and number in the header and the contact link in the sidebar come from the <code>project.info</code> file:</p>

<pre><code>projname = Project Name
projnumber = 9999
contact = Apple:A1A2AA41-FA30-40AE-9925-FD6DB270B0A5%3AABPerson
</code></pre>

<p>This file defines variables that are used by the build script to create the pages. The <code>projname</code> and <code>projnumber</code> are obvious; the <code>contact</code> variable contains the name of the contact (&#8220;Apple&#8221; for the skeleton file) and its Address Book ID, separated by a colon. I described a script for extracting the ID <a href="http://www.leancrew.com/all-this/2008/06/address-book-urls-revisited/">earlier this month</a>&#8212;this is where I use it. When you click on a contact link in the sidebar, the Address Book opens to the card for that entry.</p>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/apple-card.png" /></p>

<p>This is convenient when I&#8217;m reviewing a project and want call or email my client.</p>

<p>Although the skeleton version of the <code>project.info</code> file has just one contact, a page can have any number of contact links. I just add more <code>contact =</code> lines to the file.</p>

<p>I can, of course, edit a page by going to the Finder, working my way to the appropriate <code>notes</code> folder, and opening the <code>.md</code> file in my text editor. But I&#8217;ve made it easier than that. The editor I use, <a href="http://macromates.com/">TextMate</a>, is the handler for special URLs of the form</p>

<pre><code>txmt://open?url=file:///Users/drang/Desktop/notes/aa-overview.md
</code></pre>

<p>By including a link like that in the sidebar, I can just click on it and TextMate will open the <code>.md</code> file associated with the page. The bottom of the sidebar has a similar link to the <code>project.info</code> file.</p>

<p>I mentioned before that the HTML files in the <code>notes</code> folder are built statically, which means that, unlike a regular wiki, I have to do something to get them built. And what I need to do is run the <code>make</code> utility on the <code>Makefile</code> in the <code>notes</code> directory. This could be done through the Terminal, but I&#8217;ve made a simple TextMate command that runs <code>make</code> whenever I type Command-Option-Control-M.</p>

<p><img class="ss" src="http://www.leancrew.com/all-this/images/make-command.png" /></p>

<p>There&#8217;s probably a clever way to use Folder Actions to run the <code>Makefile</code> whenever an <code>.md</code> file is added or changed, but I haven&#8217;t looked into that yet.</p>

<p>In summary, when I want to create a new wiki for project notes, I</p>

<ol>
<li>Drag the skeleton <code>notes</code> folder from my Desktop to the project folder.</li>
<li>Edit the <code>project.info</code> and <code>aa-overview.md</code> files to include the appropriate information.</li>
<li>Add new <code>.md</code> files as my work on the project grows.</li>
</ol>

<p>In my next post in this series, I&#8217;ll describe the template files and build scripts and will provide a zipfile with my skeleton <code>notes</code> folder.</p>

<p><strong>Update</strong><br />
<a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-3/">Part 3</a> is now up.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/wiki" rel="tag">wiki</a>
<a href="http://technorati.com/tag/python" rel="tag">python</a>
<a href="http://technorati.com/tag/markdown" rel="tag">markdown</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki%e2%80%94part-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My no-server personal wiki—Part 1</title>
		<link>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/</link>
		<comments>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 23:09:57 +0000</pubDate>
		<dc:creator>drdrang</dc:creator>
		
		<category><![CDATA[mac]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[productivity wiki python programming markdown]]></category>

		<guid isPermaLink="false">http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/</guid>
		<description><![CDATA[This is the first of what I expect to be a two- or three-part post on a wiki-like note taking system I&#8217;ve developed for keeping track of the work I do on my professional projects. I&#8217;ll start by explaining what I want out of such a system and how other solutions didn&#8217;t fit my needs.

At [...]]]></description>
			<content:encoded><![CDATA[<p>This is the first of what I expect to be a two- or three-part post on a wiki-like note taking system I&#8217;ve developed for keeping track of the work I do on my professional projects. I&#8217;ll start by explaining what I want out of such a system and how other solutions didn&#8217;t fit my needs.</p>

<p>At any given time, I&#8217;m working on several projects, each with its own client and its own set of facts, figures, and research results. My habit has always been to keep all computer files related to a particular project in its own folder (usually with subfolders) on my hard disk, just as I keep all physical files related to the project in a set of manila folders that are labeled and kept together in my file cabinets. Keeping everything related to a project together is important for three reasons:</p>

<ol>
<li>It&#8217;s just easier to keep track of things this way. Despite the improvements in Spotlight, dragging a file into a folder is less time-consuming than tagging it with a project name.</li>
<li>Sometimes I need to copy all my work on a project and send it to the client. My paper files go off to a copy shop for photocopying, and my computer files get burned to DVD. If all the computer files are in one folder, burning a DVD is a one-step operation.</li>
<li>When the project is done, I archive the computer files to DVD, put them with the paper files, and send them off to storage. Again, if all the computer files are in one folder, burning a DVD is a one-step operation.</li>
</ol>

<p>Until recently, most of my project notes were on paper rather than in computer files. This was primarily because most of my notes are taken in the field, away from my computer, and there&#8217;s been no organizational advantage to rewriting those notes on the computer. But I did <em>want</em> the notes on the computer, so I began looking for ways to organize my notes that way.</p>

<p>At first, a <a href="http://en.wikipedia.org/wiki/Wiki">wiki</a> seemed like a natural fit. It&#8217;s easy to create new pages, and the pages are easy to navigate and edit. If I choose the right wiki software, I can use <a href="http://daringfireball.net/projects/markdown/">Markdown</a> formatting, which I use to write almost everything these days. Unfortunately, the usual server-based wikis keep all the information in a central database, which means that my project notes would <em>not</em> be kept in the project folder. This makes it too difficult to archive the notes with the other project files, so server-based wikis were out.</p>

<p>The notion of a file-based wiki led me to <a href="http://www.tiddlywiki.com/">TiddlyWiki</a> and its various offshoots. Because it&#8217;s run with JavaScript, TiddlyWiki would let me keep my notes for a particular project in a single big HTML file in the project folder, just as I want. But there were two problems with TiddlyWiki: First, I didn&#8217;t like the default style and found its CSS structure very difficult to delve into and modify. Second, TiddlyWiki doesn&#8217;t work well with Safari because Safari&#8217;s JavaScript doesn&#8217;t like the idea of saving changes to the HTML file, which is essential to the idea of a wiki. (I tried using the Java applet that gets around this problem, but it didn&#8217;t work for me. I suspect I could have gotten it to work if I&#8217;d kept at it, but since I didn&#8217;t like the look of TiddlyWiki it didn&#8217;t seem worth the effort.)</p>

<p>So then I moved on to <a href="http://flyingmeat.com/voodoopad/">VoodooPad</a>, Gus Mueller&#8217;s personal wiki application for the Mac. This seemed like the perfect solution. Its pages can be styled however I like, its data are saved to a file that can be put anywhere on my hard disk and can be exported to various open formats&#8212;this is important because I don&#8217;t want to get stuck in a proprietary system&#8212;and it&#8217;s backed by a developer known to be responsive to his customers. I tried it, I bought a license for it, but I just couldn&#8217;t get used to using it because it doesn&#8217;t use Markdown. I was a bit surprised at this reaction, but after a decade of using text-only systems (<a href="http://en.wikipedia.org/wiki/SGML">SGML</a>, <a href="http://www.latex-project.org/">LaTeX</a>, and now Markdown) I just couldn&#8217;t stand using something that works like a word processor. Eventually, I gave up and gave my copy of VoodooPad to my daughter to help her organize her college notes. Since it came from me, I suspect she&#8217;s ignored it&#8212;most parents of teenagers will understand that&#8212;but I still think VoodooPad would be a great solution for someone who likes writing in a word processor.</p>

<p>At this point, I decided to create my own system. The rules I set for myself were:</p>

<ol>
<li>It has to use text files that can be stored anywhere and are easily moved and archived.</li>
<li>The notes are to be written in Markdown. If I later decide that <a href="http://textism.com/tools/textile/">Textile</a> or <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> or something else is better, changing to the new markup system should be easy.</li>
<li>The notes are to be written in a text editor rather than in an HTML text box so I don&#8217;t feel like I&#8217;m writing in a straightjacket.</li>
<li>The notes should be styled according to my taste. Since my taste can change, the style should be easy to change.</li>
<li>The creation of new pages and new links to those pages should be simple and/or automatic.</li>
</ol>

<p>I&#8217;ll start describing the system I came up with in the next post.</p>

<p><strong>Update</strong><br />
<a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-2/">Part 2</a> and <a href="http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki—part-3/">Part 3</a> are now up.</p>

<!-- technorati tags start -->

<p class="tags">Tags: <a href="http://technorati.com/tag/productivity" rel="tag">productivity</a>
<a href="http://technorati.com/tag/wiki" rel="tag">wiki</a>
<a href="http://technorati.com/tag/python" rel="tag">python</a>
<a href="http://technorati.com/tag/programming" rel="tag">programming</a>
<a href="http://technorati.com/tag/markdown" rel="tag">markdown</a></p>

<!-- technorati tags end -->
]]></content:encoded>
			<wfw:commentRss>http://www.leancrew.com/all-this/2008/06/my-no-server-personal-wiki-part-1/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
