Using Markdown

I recently wrote about keeping a simple wiki with just text files. Text files are fast to open and easy to work with. In fact you can open a text file on any kind of computer running any kind of operating system and it will just work. If you have a modern operating system like me, (I am running Mac OS X) you will be able to do a simple find command to not only locate the text file you want but even search within the content of that text file quickly and easily.

I want to talk a little bit about some ideas on how you should format that text file. There are going to be times where you don’t need to think about formatting your text file. The text file may not contain enough information to bother with formatting. I have text files that just contain the information with in the name of the text file its self, but nothing is actually inside of it. Other times I have so much content in my text file I need to write it in a way that it is organized and easy to read. This is where Markdown comes into play.

Wikipedia discribes Markdown as this:

Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people “to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)”. The language takes many cues from existing conventions for marking up plain text in email.

What does that mean in English? Well, here is how I look at it. Markdown gives you a set of rules for writing a plain text document which gives it structure, which makes it easier to read and at the same time allowing it to be rendered into something you would see in a word processor or in HTML with all the correct tags.

So let me give you an example of what I am talking about. In my post I mentioned earlier about keeping a very simple wiki, I also talked about one of my favorite recipes, Corned beef. With out using any Markdown what-so-ever here is what the text document looks like when you open it up.

Slow Cooker Corned Beef and Vegetables

Prep Time: 15 min
Total Time: 9 hours 15 min
Makes: 10 servings

Ingredients

2 and 1/2 pounds medium new potatoes, (about 8), cut in half
2 cups baby cut carrots
1 cup frozen small whole onions, thawed
1 corned beef brisket (3 to 3 1/2 pounds)
1/8 teaspoon pepper
1/2 cup of water
1 tablespoon Worcestershire sauce
1 tablespoon cornstarch
2 tablespoons cold water

Directions

1.) Mix potatoes, carrots and onions in 4 to 6 quart slow cooker
2.) Thoroughly rinse corned beef; discard seasoning packet. Place beef on vegetables; sprinkle with pepper. Mix 1/2 cup water and the Worcestershire sauce; pour over beef.
3.) Cover and cook on low heat setting 8 to 9 hours or until beef and vegetables are tender.
4.) Remove beef and vegetables from slow cooker; cover to keep warm. Pour juices from slow cooker into 1-quart saucepan; heat to boiling. Mix cornstarch and cold water until smooth; stir into juices. Cook, stirring constantly, until sauce has thickened. Serve sauce with beef and vegetables.

Nutrition Information

1 Serving: Calories 340 (Calories from Fat 160 )

From the get go I am clearly not working with the most complex document on the planet, but I do think it works as a springboard for showing you how to write Markdown and why I think it is so beneficial.

So to get started. We are going to jump right to the top of the document. The first line reads:

Slow Cooker Corned Beef and Vegetables

All we are going to do is at a pound sign in front of the title so it looks like this:

#Slow Cooker Corned Beef and Vegetables

In Markdown a pound sign represents a header 1 tag or an H1 tag. The first level header. If we where to put this in a program like Textmate (the greatest text editor ever) that can render Markdown, it would render the font large and bold. I will show you an example of this once we get a few more lines written.

The next three lines of the recipe are:

Prep Time: 15 min
Total Time: 9 hours 15 min
Makes: 10 servings

Now with this I want to make an unordered list. Unordered is just an odd way to say that I don’t want my list number or alphabetized. So to do this in my text editor I and going to add a dash and a space in front of each line like this:

– Prep Time: 15 min
– Total Time: 9 hours 15 min
– Makes: 10 servings

So now my whole plain text document looks like this:

#Slow Cooker Corned Beef and Vegetables

– Prep Time: 15 min
– Total Time: 9 hours 15 min
– Makes: 10 servings

So lets look at what this looks like rendered in Textmate:

Pretty sharp. From Textmate, I could also render out HTML and it would look like this:

<h1 id=”Slow Cooker Corned Beef and Vegetables”>Slow Cooker Corned Beef and Vegetables

<ul>
<li>Prep Time: 15 min </li>
<li>Total Time: 9 hours 15 min </li>
<li>Makes: 10 servings</li>
</ul>

So lets continue on with the rest of the recipe.

#Slow Cooker Corned Beef and Vegetables

– Prep Time: 15 min
– Total Time: 9 hours 15 min
– Makes: 10 servings

##Ingredients

– 2 and 1/2 pounds medium new potatoes, (about 8), cut in half
– 2 cups baby cut carrots
– 1 cup frozen small whole onions, thawed
– 1 corned beef brisket (3 to 3 1/2 pounds)
– 1/8 teaspoon pepper
– 1/2 cup of water
– 1 tablespoon Worcestershire sauce
– 1 tablespoon cornstarch
– 2 tablespoons cold water

##Directions

1. Mix potatoes, carrots and onions in 4 to 6 quart slow cooker
2. Thoroughly rinse corned beef; discard seasoning packet. Place beef on vegetables; sprinkle with pepper. Mix 1/2 cup water and the Worcestershire sauce; pour over beef.
3. Cover and cook on low heat setting 8 to 9 hours or until beef and vegetables are tender.
4. Remove beef and vegetables from slow cooker; cover to keep warm. Pour juices from slow cooker into 1-quart saucepan; heat to boiling. Mix cornstarch and cold water until smooth; stir into juices. Cook, stirring constantly, until sauce has thickened. Serve sauce with beef and vegetables.

##Nutrition Information

1 Serving: Calories 340 (Calories from Fat 160 )

So you will see with the sub headers. The Header 2 or H2 I started the line with two pound signs. You can do this all the way to header 6 or H6 with six pound signs.

Under “Directions” I also used numbers followed by a period and a space rather than dashes. This means if I render out that section it will be a numbered list. So lets render this out in Textmate and see what we got.

Not a bad-looking document. Something that looks great and is easy to read as a text file. Giving it structure and conformity, a cleanliness that was not there before. It looks even better when rendered out. I hope you I have done a good job explaining how great I think Markdown is and how useful it can be. I will be including all basic formatting information for Markdown below as my recipe example above did not use all the possible formatting tags.

Paragraphs

Just write sentences like you would normally do. No tags for paragraphs are needed.

Emphasized text

*Italics* Anything surrounded with “*” Is italicized.

**Bold Text** Anything surrounded with two “*” is turned bold.

Code

Blocking off code inline requires it to be `surrounded` by a backtick.

Indent several lines of code by at least four spaces.

Lists

*  This is an
* unordered list
* This is a sub list item

1. This is an
2.) in an enumerated (ordered) list

Headings

#First level heading

##Second level heading

######Sixth level heading

Blockquotes

> This text will be enclosed in an HTML blockquote element.
> Blockquote elements are reflowable. You may arbitrarily
> wrap the text to your liking, and it will all be parsed
> into a single blockquote element.

Links

This is [an example](http://example.com/ “Title”) inline link.
[This link](http://example.net/) has no title attribute.

This is [an example][id] reference-style link.

hen, anywhere in the document, you define your link label like this, on a line by itself:
[id]: http://example.com/  “Optional Title Here”

Horizontal rules

Horizontal rules are created by placing three or more hyphens, asterisks, or underscores on a line by themselves. You may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule:
* * *
***
*****
– – –
—————————————

For more information on Markdown and to see a few more tags I did not include here please check out the following links.

A Very Simple Wiki

I have almost always had a wiki in one form or another to help me keep track or remember things that I just don’t use everyday. It’s been a very useful tool for me, not only at home, but also in the work place.  TiddlyWiki stands out as one of my better wiki experience as I could just keep it on a thumb drive in my pocket.

My thoughts on keeping data in a manageable wiki have changed recently. This is due to a post I read at mnmlis titled: Store everything in text files.

The argument it is that text files are not only faster to open, but if you have a modern operating system the contents are completely searchable. On my Mac for example, I can be almost anywhere and press Command + Spacebar and I am presented with a search field. I can just start typing whatever it is I am looking for. If I am looking for my Corned beef recipe I just have to type “Corned beef” and my text file with my corned beef recipe comes right up.

I do keep all my text files in a directory called “Wiki” located in my Documents directory. I also try to keep the titles of my documents somewhat standard. For example, the title of my Corned beef recipe is “Recipe – Corned beef” so if I search for the name of my recipe only Corned beef will show up. If I search for just “Recipe” I get a nice list of every recipe I have saved on my computer.

The whole thing is a lot faster than any wiki I have ever used and has been working out just great for me so far.

Mortal Kombat 9

Last Tuesday I downloaded the Mortal Kombat 9 demo for PS3. I was a fan of the first to Mortal Kombat fighting games, but since then it seemed with every of the game got further and further away from what made the game so popular when it first game out.

With Mortal Kombat 9, which is being called just Mortal Kombat, the people behind the game are finally going back to what made the game so popular when it originally came out. The over the top blood and violence.

The trailer above does not include actual game play but shows off the fact that Kratos from Gods of War is a playable character in the new game.

The demo comes with four playable characters. Scorpion, Johnny Cage, Mileena, and Sub-Zero. I have beaten the demo using all the characters. I have to say that this game really has restored my faith in the Mortal Kombat franchise. I would say this version of Mortal Kombat is one of my all time favorit fighting games second only to Dead or Alive.

I collected the fatality codes for the for playable characters below.

Scorpion – Forward, Down, Forward, Triangle

Johnny Cage – Forward, Forward, Back, Down, X

Mileena – Back, Forward, Back, Forward, Triangle

Sub-Zero – Back, Forward, Down, Forward, Circle

Bob Iger Interview

Bob Iger is the current CEO of The Walt Disney Company. This guy is someone who caught my attention early on when he started working as CEO for Disney because he gave an interview in TIME magazine, I believe ( I still have the interview clipping) where he talked about his normal work day and how he manage to get things done. Little tips and tricks he shared with the Magazine. Things like how to make sure he had enough time to just get work processed that was sitting on his desk. How to properly thank people and to use history as a key to master the future. I guess you could say he is someone I respect and find inspiration in.

The other day I saw this video posted on hulu. I have no Idea how long the video will be available, but I wanted to share with anyone who is interested.

Power Outage

Last night around 9:30 when I should have been in bed, but was instead up watching a movie with Hannah on my Media Center, the power went out. We only pay some of the highest rates in the country for electricity so it stans to reason that it would go out ALL THE TIME. The two of us got up from the couch and lit some candles and got a flash light. Looking out the window I could see that the whole Juneau valley -with exception to the airport- was with out power.

Even without power I was still upbeat. As soon as the power went out I heard the beeping of my APC UPS that power my Qnap NAS going off every 15 seconds. “Is that thing going to be alright”. Hannah asked.

“Yeah. The NAS should power it’s self down in two minutes if power is not restored”.

“Oh, cool”. she said.

Qnap NAS

Sure enough at the two minute mark I heard the shut down signal of the Qnap Nas. Moments later it was off. Things like that make me smile. When things just work as they are supposed to.

After that Hannah and I crawled into bed and as most nights I proceeded to read to her. I no sooner got myself situated in bed when the power came back on.

Update from KINY NewsUnknown cause spurs area wide outage

The city and borough suffered an area wide power outage last night.

Gail Wood of Alaska Electric Light and Power says the lights went out at about 9:45 with power restored around 11 p.m.

Wood says the outage location has been identified as the East Terminal where the lines transmit into the submarine cable that crosses Taku Inlet.  A crew will go to the area at first light to investigate.

Wood says the outage lasted about an hour and a half for those who had power restored last.

In the meantime, AEL&P is running off backup diesel generators, and power from the Annex Creek and Salmon Creek hydro projects.

Update 2 [12:32pm]Utility crew can’t pinpoint cause of area wide power outage

The city and borough suffered an area wide power outage last night.

Gail Wood of Alaska Electric Light and Power says the lights went out at about 9:45 with power restored around 11 p.m.

Wood says the outage location has been identified as the East Terminal where the lines transmit into the submarine cable that crosses Taku Inlet.

A crew went to  the area this morning  to investigate, but could not locate the cause of the problem.

AEL&P  rann the system with backup diesel generators, and power from the Annex Creek and Salmon Creek hydro projects following the problem.  The system was scheduled to be back on full hydro by mid-day today, according to Wood.

She says the outage lasted about an hour and a half for those who had power restored last