How to Create and Run a Presentation from the Linux Command Line

Whenever we think of presentations, the first things that usually come to mind are flashy images or colourful diagrams. But there are times when you just want to quickly convey some information through your presentation, while the overall look and feel takes a back seat.

In Linux, you can quickly create as well as run a presentation through command line. There are multiple ways to achieve this, but in this article, we will focus on the basics of the mdp tool, as well as the features it provides.

Mdp is a command-line based markdown presentation tool available for Linux. According to its author, the project started off as a way to learn C programming language and quickly developed into a fully-featured presentation tool.

Run the following commands to download and install mdp on your Debian-based system:

sudo apt-get install git gcc make libncursesw5-dev
git clone https://github.com/visit1985/mdp.git
cd mdp
make
sudo make install

If you’re using any other Linux distribution, head to the project’s GitHub page for instructions on how to download and install mdp on your system.

Before moving on to a working example, here is some basic information that you should know about mdp:

  • You can switch to the next slide using the Enter, Space, Page Down, j, l, Down Arrow, and Right Arrow keys.
  • To switch to the previous slide, use Backspace, Page Up, h, k, Up Arrow, Left Arrow keys.
  • To quit the presentation, press q
  • To reload, press r
  • To go to the first slide, press Home or g, and to switch to the last slide, press End or G.

As we know that mdp works with markdown files, you will need to create your presentation in .md format, and run it in the following way:

 mdp [your-presentation-name]

For example:

 mdp my-presentation.md

The first slide

Here is how you can enter details like title and author, as well as create underlined, simple, and highlighted text.

%title: Maketecheasier - Mdp
%author: Himanshu
 
-> mdp <-
=========
 There are times when you just want to quickly convey some information through your presentation. mdp for Linux allows you to run a presentation from the command line.
-> A command-line based markdown presentation tool. <-
 
_Underlined text:_
 
Simple text            *Highlighted text1*, *highlighted text2*

This is how it looks:

mdp-first-slide

Multiple slides

The presentation can be split into multiple slides by using horizontal rules (hr), represented by at least 3 * or - . For example, each of these represents the start of a new slide:

* * *
---
************************
- - -

Multi-level headers and nested lists

Here is how you can insert different levels of headers and nested lists:

-> # multi-level headers and nested lists <-
 
The following is an example of first- and second-level headers, as well as a nested list.
 
# first-level header
 
second-level header
------------------
 
- *list 1*
    - sub-list 1
        - sub-sub-list 1
        - sub-sub-list 2
        - sub-sub-list 3
    - sub-list 2

This is how it looks:

mdp-multilevel-headers-nested-lists

Note - A single <br> or ^ in a line indicates mdp to stop the output on that position. This can be used to show bullet points line by line.

Code block formatting

Code blocks are automatically detected by 4 spaces at the beginning of a line. Here is an example:

-> # Code block formatting <-
 
This is how you can format a code snippet.
 
    1  /* Hello World */
    2
    3  #include <stdio.h>
    4
    5  int main(void)
    6  {
    7     printf("\nHello World\n");
    8     return 0;
    9  }
 
This example shows inline code: `gcc -Wall helloworld.c -o helloworld`

This is how it looks:

mdp-code-block

Other important points

  • Backslashes force special markdown characters like *, _, # and > to be printed as normal characters.
  • Quotes are auto-detected by preceding >, while multiple > are interpreted as nested quotes.
  • For more tips, go through the sample.md file that comes along with the mdp source code.

As you'd have observed by now, it's quick and easy to create a presentation using mdp. Given the fact that it's open source, you can not only study how it works, but can also extend its feature set. Have you ever used mdp or any other command line presentation tool? How was your experience? Share your thoughts in the comments below.