{"id":220,"date":"2012-12-09T13:07:13","date_gmt":"2012-12-09T13:07:13","guid":{"rendered":"http:\/\/tech.moosaico.com\/blog\/?p=220"},"modified":"2012-12-10T01:35:27","modified_gmt":"2012-12-10T01:35:27","slug":"how-to-create-a-quick-presentation-with-markdown-in-ubuntu","status":"publish","type":"post","link":"https:\/\/thejoyofstick.com\/blog\/2012\/12\/09\/how-to-create-a-quick-presentation-with-markdown-in-ubuntu\/","title":{"rendered":"How to create a quick presentation with Markdown in Ubuntu"},"content":{"rendered":"<h2>Why the need for presentations in Markdown<\/h2>\n<p>I&#8217;m used to <a title=\"John Gruber's Markdown\" href=\"http:\/\/daringfireball.net\/projects\/markdown\/\">Markdown<\/a> to write down some documentation and procedures at work.<\/p>\n<p>It would be awesome to continue using it for quick presentations, when you want to introduce the team to new concepts or fast learning sessions. Therefore I can write them in plain text wherever I am, even with a mobile, instead of opening <a title=\"LibreOffice's Impress\" href=\"http:\/\/www.libreoffice.org\/features\/impress\/\">Impress<\/a>.<\/p>\n<p>Fortunately there are tools to make you do that.<\/p>\n<h2>What do I need then ?<\/h2>\n<p>Using <a href=\"http:\/\/www.perl.org\/\">Perl<\/a> for most of our tools I&#8217;m very used to&nbsp;<a title=\"TIMTOWTDI\" href=\"http:\/\/en.wikipedia.org\/wiki\/There's_more_than_one_way_to_do_it\">TIMTOWTDI<\/a>. So, this is just one way of implementing what I want.<\/p>\n<p>So, I&#8217;ll choose <a title=\"Markdown Presenter\" href=\"https:\/\/github.com\/chrishulbert\/MarkdownPresenter\">Markdown Presenter<\/a> to display the presentation. It&#8217;s a javascript and CSS combination to simply show your file in a browser. You then use left and right keys to turn forth or back. You separate your slides in the <code>.md<\/code> file using exclamation marks bordered by single lines.<\/p>\n<pre lang=\"markdown\">The Presentation \r\n================\r\n\r\n> My first slide\r\n\r\n!\r\n\r\nSecond slide title\r\n------------------\r\n\r\n* Item 1\r\n* Item 2\r\n\r\n!\r\n\r\nAnother slide just to repeat\r\nmy self without any doubt.<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-261\" title=\"MDP1\" src=\"https:\/\/thejoyofstick.com\/blog\/wp-content\/uploads\/2012\/12\/MDP1.png\" alt=\"\" width=\"168\" height=\"125\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-262\" title=\"MDP2\" src=\"https:\/\/thejoyofstick.com\/blog\/wp-content\/uploads\/2012\/12\/MDP2.png\" alt=\"\" width=\"146\" height=\"124\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-263\" title=\"MDP3\" src=\"https:\/\/thejoyofstick.com\/blog\/wp-content\/uploads\/2012\/12\/MDP3.png\" alt=\"\" width=\"168\" height=\"124\" \/><\/p>\n<p>You may put these all in a site of your own. However as most often I need to have it locally due to network restrictions, I&#8217;ll install a small and simple local web server that&#8217;s already bundle with Ubuntu: webfsd.<\/p>\n<p>Last but not the least, we should have a nice way to edit markdown files in vim.<\/p>\n<h2>Let&#8217;s just build stuff ok ?<\/h2>\n<p>This is a quick way and I haven&#8217;t installed anything you may say :-)<\/p>\n<pre lang=\"linux\">$ sudo apt-get install git webfsd<\/pre>\n<p>Yes, yes, *please* install git if you haven&#8217;t done so yet ;-)<\/p>\n<p>After installed the web server create a zone for your presentations and get Markdown Presenter<\/p>\n<pre lang=\"linux\">$ mkdir ~\/Documents\/MyPresentations\/\r\n$ cd ~\/Documents\/MyPresentations\/\r\n$ git clone https:\/\/github.com\/chrishulbert\/MarkdownPresenter.git<\/pre>\n<p>Now, let&#8217;s start the web server on port <code>8888<\/code> with root&nbsp;<code>~\/Documents\/MyPresentations\/MarkdownPresenter\/<\/code> defaulting its index page to MP page.<\/p>\n<pre lang=\"linux\">$ webfsd -F -p 8888 \\\r\n-r ~\/Documents\/MyPresentations\/MarkdownPresenter\/ -f Presenter.html<\/pre>\n<p>If you go to <a href=\"http:\/\/localhost:8888\/\">http:\/\/localhost:8888\/<\/a> on your web browser you will see a default presentation.<\/p>\n<p>Now just copy your <code>.md<\/code> file to&nbsp;<code>~\/Documents\/MyPresentations\/MarkdownPresenter\/presentation.pm<\/code> and reload the browser page. Voil\u00e0!<\/p>\n<p>This is the simple and quick way. Adapt it the way you like better for your needs.<\/p>\n<h2>Last but not the&#8230; well<\/h2>\n<p>It maybe &#8220;least&#8221;. It&#8217;s not necessary but more of a visual aid.<\/p>\n<p>Vim has a basic support for Markdown since version 7.3. As my <code>.md<\/code> files were identified as &#8220;modula2&#8221; I just added this line to my <code>.vimrc<\/code><\/p>\n<pre lang=\"vim\">au BufRead,BufNewFile *.md set filetype=markdown<\/pre>\n<p>If you need a more capable plugin install <a title=\"PlasticBoy\" href=\"http:\/\/plasticboy.com\/markdown-vim-mode\/\">PlasticBoy<\/a>&#8216;s <a title=\"vim-markdown\" href=\"https:\/\/github.com\/plasticboy\/vim-markdown.git\">vim-markdown<\/a>.<\/p>\n<p>And as you already are using <a title=\"vim-pathogen\" href=\"http:\/\/www.vim.org\/scripts\/script.php?script_id=2332\">vim-pathogen<\/a> (You are, aren&#8217;t you ?)<\/p>\n<pre lang=\"linux\">$ cd ~\/.vim\/bundle\/\r\n$ git clone http:\/\/github.com\/plasticboy\/vim-markdown<\/pre>\n<p>You must change the previous line I told you to add to <code>.vimrc<\/code> because this plugin uses a different identifier for markdown files:<\/p>\n<pre lang=\"vim\">au BufRead,BufNewFile *.md set filetype=mkd<\/pre>\n<p>I don&#8217;t like the way it highlights the 2 spaces at an end of line. I saw <a title=\"MD for VIM\" href=\"http:\/\/stackoverflow.com\/questions\/10964681\/enabling-markdown-highlighting-in-vim\">here<\/a>&nbsp;how to change it for an underline which I prefer.<\/p>\n<pre lang=\"vim\">hi link mkdLineBreak Underlined<\/pre>\n<p>I must warn you there are no great markdown plugin for Vim. Even forks from plasticboy&#8217;s don&#8217;t highlight well block elements within other block elements (e.g. sub headers, sub blockquotes)<\/p>\n<h2>So, and now ?<\/h2>\n<p>Now ? Be productive! :-) You just have simple tools to quickly and simply produce that presentation you were in need for yesterday.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why the need for presentations in Markdown I&#8217;m used to Markdown to write down some documentation and procedures at work. It would be awesome to continue using it for quick presentations, when you want to introduce the team to new&hellip; <a href=\"https:\/\/thejoyofstick.com\/blog\/2012\/12\/09\/how-to-create-a-quick-presentation-with-markdown-in-ubuntu\/\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,4],"tags":[42,43,45,41,44],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-linux","category-ubuntu","tag-markdown","tag-presentation","tag-syntax-highlight","tag-vim","tag-webfsd"],"jetpack_shortlink":"https:\/\/wp.me\/pcmwlL-3y","jetpack_sharing_enabled":true,"jetpack_likes_enabled":false,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":50,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"predecessor-version":[{"id":291,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions\/291"}],"wp:attachment":[{"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thejoyofstick.com\/blog\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}