{"id":3076,"date":"2011-04-08T05:53:23","date_gmt":"2011-04-08T13:53:23","guid":{"rendered":"http:\/\/www.yousephtanha.com\/blog\/?p=3076"},"modified":"2011-04-08T05:53:23","modified_gmt":"2011-04-08T13:53:23","slug":"using-markdown","status":"publish","type":"post","link":"http:\/\/www.yousephtanha.com\/blog\/2011\/04\/08\/using-markdown\/","title":{"rendered":"Using Markdown"},"content":{"rendered":"<p>I recently wrote about keeping <a title=\"A Very Simple Wiki\" href=\"http:\/\/www.yousephtanha.com\/blog\/2011\/04\/06\/a-very-simple-wiki\/\" target=\"_blank\">a simple wiki with just text files<\/a>. 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\u00a0operating\u00a0system and it will just work. If you have a modern\u00a0operating\u00a0system 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.<\/p>\n<p>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&#8217;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\u00a0organized\u00a0and easy to read. This is where Markdown comes into play.<\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Markdown\" target=\"_blank\">Wikipedia discribes Markdown<\/a> as this:<\/p>\n<blockquote><p>Markdown is a\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Lightweight_markup_language\" target=\"_blank\">lightweight markup language<\/a>, originally created by\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/John_Gruber\" target=\"_blank\">John Gruber<\/a> and\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Aaron_Swartz\">Aaron Swartz<\/a> allowing people &#8220;to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/XHTML\">XHTML<\/a> (or\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/HTML\">HTML<\/a>)&#8221;.<span style=\"font-size: xx-small;\"> <\/span>The language takes many cues from existing\u00a0<a title=\"Convention (norm)\" href=\"http:\/\/en.wikipedia.org\/wiki\/Convention_(norm)\">conventions<\/a> for marking up\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Plain_text\">plain text<\/a> in\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Email\">email<\/a>.<\/p><\/blockquote>\n<p>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\u00a0structure, 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.<\/p>\n<p>So let me give you an example of what I am talking about. In my post I\u00a0mentioned\u00a0earlier 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.<\/p>\n<blockquote><p>Slow Cooker Corned Beef and Vegetables<\/p>\n<p>Prep Time: 15 min<br \/>\nTotal Time: 9 hours 15 min<br \/>\nMakes: 10 servings<\/p>\n<p>Ingredients<\/p>\n<p>2 and 1\/2 pounds medium new potatoes, (about 8), cut in half<br \/>\n2 cups baby cut carrots<br \/>\n1 cup frozen small whole onions, thawed<br \/>\n1 corned beef brisket (3 to 3 1\/2 pounds)<br \/>\n1\/8 teaspoon pepper<br \/>\n1\/2 cup of water<br \/>\n1 tablespoon Worcestershire sauce<br \/>\n1 tablespoon cornstarch<br \/>\n2 tablespoons cold water<\/p>\n<p>Directions<\/p>\n<p>1.) Mix potatoes, carrots and onions in 4 to 6 quart slow cooker<br \/>\n2.) 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.<br \/>\n3.) Cover and cook on low heat setting 8 to 9 hours or until beef and vegetables are tender.<br \/>\n4.) 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.<\/p>\n<p>Nutrition Information<\/p>\n<p>1 Serving: Calories 340 (Calories from Fat 160 )<\/p><\/blockquote>\n<p>From\u00a0the 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\u00a0beneficial.<\/p>\n<p>So to get started. We are going to jump right to the top of the document. The first line reads:<\/p>\n<blockquote><p>Slow Cooker Corned Beef and Vegetables<\/p><\/blockquote>\n<p>All we are going to do is at a pound sign in front of the title so it looks like this:<\/p>\n<blockquote><p>#Slow Cooker Corned Beef and Vegetables<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/TextMate.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignright size-full wp-image-3100\" title=\"TextMate\" src=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/TextMate.png\" alt=\"\" width=\"180\" height=\"180\" srcset=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/TextMate.png 300w, http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/TextMate-150x150.png 150w\" sizes=\"(max-width: 180px) 85vw, 180px\" \/><\/a>In Markdown a pound sign represents a header 1 tag\u00a0or an H1 tag. The first level header. If we where to put this in a program like <a href=\"http:\/\/macromates.com\/\" target=\"_blank\">Textmate<\/a> (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.<\/p>\n<p>The next three lines of the recipe are:<\/p>\n<blockquote><p>Prep Time: 15 min<br \/>\nTotal Time: 9 hours 15 min<br \/>\nMakes: 10 servings<\/p><\/blockquote>\n<p>Now with this I want to make an unordered list. Unordered is just an odd way to say that I don&#8217;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:<\/p>\n<blockquote><p>&#8211; Prep Time: 15 min<br \/>\n&#8211; Total Time: 9 hours 15 min<br \/>\n&#8211; Makes: 10 servings<\/p><\/blockquote>\n<p>So now my whole plain text document looks like this:<\/p>\n<blockquote><p>#Slow Cooker Corned Beef and Vegetables<\/p>\n<p>&#8211; Prep Time: 15 min<br \/>\n&#8211; Total Time: 9 hours 15 min<br \/>\n&#8211; Makes: 10 servings<\/p><\/blockquote>\n<p>So lets look at what this looks like rendered in Textmate:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3080\" title=\"Corned-Beef-Render\" src=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/Corned-Beef-Render.jpg\" alt=\"\" width=\"530\" height=\"117\" srcset=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/Corned-Beef-Render.jpg 530w, http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/Corned-Beef-Render-300x66.jpg 300w\" sizes=\"(max-width: 530px) 85vw, 530px\" \/><\/p>\n<p>Pretty sharp. From Textmate, I could also render out HTML and it would look like this:<\/p>\n<blockquote><p>&lt;h1 id=&#8221;Slow Cooker Corned Beef and Vegetables&#8221;&gt;Slow Cooker Corned Beef and Vegetables<\/p>\n<p>&lt;ul&gt;<br \/>\n&lt;li&gt;Prep Time: 15 min &lt;\/li&gt;<br \/>\n&lt;li&gt;Total Time: 9 hours 15 min &lt;\/li&gt;<br \/>\n&lt;li&gt;Makes: 10 servings&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/p><\/blockquote>\n<p>So lets continue on with the rest of the recipe.<\/p>\n<blockquote><p>#Slow Cooker Corned Beef and Vegetables<\/p>\n<p>&#8211; Prep Time: 15 min<br \/>\n&#8211; Total Time: 9 hours 15 min<br \/>\n&#8211; Makes: 10 servings<\/p>\n<p>##Ingredients<\/p>\n<p>&#8211; 2 and 1\/2 pounds medium new potatoes, (about 8), cut in half<br \/>\n&#8211;\u00a02 cups baby cut carrots<br \/>\n&#8211;\u00a01 cup frozen small whole onions, thawed<br \/>\n&#8211;\u00a01 corned beef brisket (3 to 3 1\/2 pounds)<br \/>\n&#8211;\u00a01\/8 teaspoon pepper<br \/>\n&#8211;\u00a01\/2 cup of water<br \/>\n&#8211;\u00a01 tablespoon Worcestershire sauce<br \/>\n&#8211;\u00a01 tablespoon cornstarch<br \/>\n&#8211;\u00a02 tablespoons cold water<\/p>\n<p>##Directions<\/p>\n<p>1. Mix potatoes, carrots and onions in 4 to 6 quart slow cooker<br \/>\n2. 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.<br \/>\n3. Cover and cook on low heat setting 8 to 9 hours or until beef and vegetables are tender.<br \/>\n4. 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.<\/p>\n<p>##Nutrition Information<\/p>\n<p>1 Serving: Calories 340 (Calories from Fat 160 )<\/p><\/blockquote>\n<p>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.<\/p>\n<p>Under &#8220;Directions&#8221; 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.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3087\" title=\"corned-beef-render-2\" src=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/corned-beef-render-2.jpg\" alt=\"\" width=\"509\" height=\"639\" srcset=\"http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/corned-beef-render-2.jpg 509w, http:\/\/www.yousephtanha.com\/blog\/wp-content\/uploads\/2011\/04\/corned-beef-render-2-238x300.jpg 238w\" sizes=\"(max-width: 509px) 85vw, 509px\" \/><\/p>\n<p>Not a bad-looking document. Something that looks great and is easy to read as a text file. Giving it\u00a0structure and\u00a0conformity, a\u00a0cleanliness\u00a0that 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\u00a0information\u00a0for Markdown below as my recipe example above did not use all the\u00a0possible\u00a0formatting tags.<\/p>\n<h2>Paragraphs<\/h2>\n<blockquote><p>Just write\u00a0sentences\u00a0like you would normally do. No tags for paragraphs are needed.<\/p><\/blockquote>\n<h2>Emphasized text<\/h2>\n<blockquote><p>*Italics*\u00a0Anything\u00a0surrounded\u00a0with &#8220;*&#8221; Is\u00a0italicized.<\/p>\n<p>**Bold Text** Anything surrounded with two &#8220;*&#8221; is turned bold.<\/p><\/blockquote>\n<h2>Code<\/h2>\n<blockquote><p>Blocking off code inline requires it to be `surrounded` by a backtick.<\/p>\n<p>Indent several lines of code by at least four spaces.<\/p><\/blockquote>\n<h2>Lists<\/h2>\n<blockquote><p>* \u00a0This is an<br \/>\n* unordered list<br \/>\n* This is a sub list item<\/p>\n<p>1. This is an<br \/>\n2.) in\u00a0an enumerated (ordered) list<\/p><\/blockquote>\n<h2>Headings<\/h2>\n<blockquote><p>#First level heading<\/p>\n<p>##Second level heading<\/p>\n<p>######Sixth level heading<\/p><\/blockquote>\n<h2>Blockquotes<\/h2>\n<blockquote><p>&gt; This text will be enclosed in an HTML blockquote element.<br \/>\n&gt; Blockquote elements are reflowable. You may arbitrarily<br \/>\n&gt; wrap the text to your liking, and it will all be parsed<br \/>\n&gt; into a single blockquote element.<\/p><\/blockquote>\n<h2>Links<\/h2>\n<blockquote><p>This is [an example](http:\/\/example.com\/ &#8220;Title&#8221;) inline link.<br \/>\n[This link](http:\/\/example.net\/) has no title attribute.<\/p>\n<p>This is [an example][id] reference-style link.<\/p>\n<p>hen, anywhere in the document, you define your link label like this, on a line by itself:<br \/>\n[id]: http:\/\/example.com\/ \u00a0&#8220;Optional Title Here&#8221;<\/p><\/blockquote>\n<h2>Horizontal rules<\/h2>\n<blockquote><p>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:<br \/>\n* * *<br \/>\n***<br \/>\n*****<br \/>\n&#8211; &#8211; &#8211;<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p><\/blockquote>\n<p>For more information on Markdown and to see a few more tags I did not include here please check out the following links.<\/p>\n<ul>\n<li>DaringFireBall <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/\" target=\"_blank\">Markdown<\/a><\/li>\n<li>DaringFireBall <a href=\"http:\/\/daringfireball.net\/projects\/markdown\/syntax\" target=\"_blank\">Markdown\u00a0Syntax<\/a><\/li>\n<li>SimpleEdtions <a href=\"http:\/\/www.simpleeditions.com\/59001\/markdown-an-introduction\" target=\"_blank\">Markdown: An introduction<\/a><\/li>\n<li>Wikipedia\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Markdown\" target=\"_blank\">Entry\u00a0on Markdown<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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\u00a0operating\u00a0system and it will just work. If you have a modern\u00a0operating\u00a0system like me, (I am running &hellip; <a href=\"http:\/\/www.yousephtanha.com\/blog\/2011\/04\/08\/using-markdown\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using Markdown&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[235,18,13],"tags":[635,638,637,634,632,629,633,636],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1qkdN-NC","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/posts\/3076"}],"collection":[{"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/comments?post=3076"}],"version-history":[{"count":16,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/posts\/3076\/revisions"}],"predecessor-version":[{"id":3104,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/posts\/3076\/revisions\/3104"}],"wp:attachment":[{"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/media?parent=3076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/categories?post=3076"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yousephtanha.com\/blog\/wp-json\/wp\/v2\/tags?post=3076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}