Why the need for presentations in Markdown
I’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 concepts or fast learning sessions. Therefore I can write them in plain text wherever I am, even with a mobile, instead of opening Impress.
Fortunately there are tools to make you do that.
What do I need then ?
Using Perl for most of our tools I’m very used to TIMTOWTDI. So, this is just one way of implementing what I want.
So, I’ll choose Markdown Presenter to display the presentation. It’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 .md
file using exclamation marks bordered by single lines.
The Presentation
================
> My first slide
!
Second slide title
------------------
* Item 1
* Item 2
!
Another slide just to repeat
my self without any doubt.
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’ll install a small and simple local web server that’s already bundle with Ubuntu: webfsd.
Last but not the least, we should have a nice way to edit markdown files in vim.
Let’s just build stuff ok ?
This is a quick way and I haven’t installed anything you may say :-)
$ sudo apt-get install git webfsd
Yes, yes, *please* install git if you haven’t done so yet ;-)
After installed the web server create a zone for your presentations and get Markdown Presenter
$ mkdir ~/Documents/MyPresentations/
$ cd ~/Documents/MyPresentations/
$ git clone https://github.com/chrishulbert/MarkdownPresenter.git
Now, let’s start the web server on port 8888
with root ~/Documents/MyPresentations/MarkdownPresenter/
defaulting its index page to MP page.
$ webfsd -F -p 8888 \
-r ~/Documents/MyPresentations/MarkdownPresenter/ -f Presenter.html
If you go to http://localhost:8888/ on your web browser you will see a default presentation.
Now just copy your .md
file to ~/Documents/MyPresentations/MarkdownPresenter/presentation.pm
and reload the browser page. Voilà!
This is the simple and quick way. Adapt it the way you like better for your needs.
Last but not the… well
It maybe “least”. It’s not necessary but more of a visual aid.
Vim has a basic support for Markdown since version 7.3. As my .md
files were identified as “modula2” I just added this line to my .vimrc
au BufRead,BufNewFile *.md set filetype=markdown
If you need a more capable plugin install PlasticBoy‘s vim-markdown.
And as you already are using vim-pathogen (You are, aren’t you ?)
$ cd ~/.vim/bundle/
$ git clone https://github.com/plasticboy/vim-markdown
You must change the previous line I told you to add to .vimrc
because this plugin uses a different identifier for markdown files:
au BufRead,BufNewFile *.md set filetype=mkd
I don’t like the way it highlights the 2 spaces at an end of line. I saw here how to change it for an underline which I prefer.
hi link mkdLineBreak Underlined
I must warn you there are no great markdown plugin for Vim. Even forks from plasticboy’s don’t highlight well block elements within other block elements (e.g. sub headers, sub blockquotes)
So, and now ?
Now ? Be productive! :-) You just have simple tools to quickly and simply produce that presentation you were in need for yesterday.