Go to file
Jesse Portnoy 318a6fefd5 Formatting 2023-08-31 08:55:45 +02:00
include Fix typos 2018-10-16 10:24:35 +02:00
src Add option to not invert code background color. 2018-10-04 00:01:58 +02:00
.gdbinit added getopts argument parsing + usage + debug mode 2014-08-17 14:56:21 +02:00
.gitignore updated ignored files 2017-12-27 22:47:53 +01:00
AUTHORS version bump 2018-08-28 00:37:21 +02:00
COPYING rewrote Makefile + copyright and license infos 2014-09-14 11:21:42 +02:00
CREDITS removed old tests 2014-09-14 11:26:22 +02:00
Makefile Pass -O3 for non-debug builds and strip (-s), don't strip in debug and 2023-07-23 21:34:13 +02:00
README.md Formatting 2023-08-31 08:55:45 +02:00
mdp.1 add missing options to man page (#150) 2021-05-21 12:34:11 +02:00
mdp.cygport added PREFIX to cygport definition 2017-01-12 14:45:57 +01:00
mdp.sublime-project updated sublime build system 2015-04-12 00:05:44 +02:00
sample.md Pandoc fenced code link in sample (#137) 2020-04-10 22:07:06 +02:00


mdp - A command-line based markdown presentation tool.


How to get started:

mdp needs the ncursesw headers to compile. So make sure you have them installed:

  • on Raspbian (Raspberry Pi) you need libncurses5-dev and libncursesw5-dev

Now download and install mdp:

$ git clone https://github.com/visit1985/mdp.git
$ cd mdp
$ make
$ make install
$ mdp sample.md
  • On Arch Linux, you can use the existing package.
  • on Cygwin you can use the existing package from the setup program.
  • On Debian, you can use the existing DEB package, or run apt-get install mdp.
  • On FreeBSD, you can use the port misc/mdp.
  • On MacOS, use either the Homebrew Formula by running brew install mdp or install with MacPorts with sudo port install mdp.
  • On Slackware, grab the SlackBuild here: (http://slackbuilds.org/apps/mdp/), or run sbopkg -i mdp.
  • On Ubuntu, you can use the existing DEB package, or run apt-get install mdp.

Most terminals support 256 colors only if the TERM variable is set correctly. To enjoy mdp's color fading feature:

$ export TERM=xterm-256color

How to use it:

Horizontal rulers are used as slide separator.

Supports basic markdown formating:

  • line wide markup

    • headlines
    • code
    • quotes
    • unordered list
  • in-line markup

    • bold text
    • underlined text
    • code

Supports headers prefixed by @ symbol.

  • first two header lines are displayed as title and author in top and bottom bar

Review sample.md for more details.


  • h, j, k, l, Arrow keys, Space, Enter, Backspace, Page Up, Page Down - next/previous slide
  • Home, g - go to first slide
  • End, G - go to last slide
  • 1-9 - go to slide n
  • r - reload input file
  • q - exit

How to debug it:

To make a debug version of mdp, just type:

$ make DEBUG=1

Convert to PDF:

  • Install md2pdf by obtaining the release for your arch and OS or, if you have go installed, invoke:
$ go install github.com/mandolyte/mdtopdf/cmd/md2pdf@latest

md2pdf supports all major mdp features and accepts local files, remote HTTP(s) URL and STDIN inputs. The below command will convert an mdp compatible markdown file to a PDF with a dark theme, syntax highlighting (you'll need to provide the language hint, of course), page/slide separation and a footer:

md2pdf -i https://github.com/jessp01/crash-course-in/raw/main/courses/apt_dpkg_deb/apt_dpkg_deb.md \
    -o apt_dpkg_deb.pdf \
    -s ~/.config/zaje/syntax_files \
    --theme dark \
    --new-page-on-hr \
    --with-footer \
    --author "Jesse Portnoy <jesse@packaman.io>" \
    --title "A crash course on handling deb packages"

Since markdown does not support the centering escape sequences (i.e: -> and <-), you will want to remove these before converting, for example:

$ sed 's@^->\s*\(#.*\)\s*<-@\1@g' sample.md | ~/go/bin/md2pdf -o mdp.pdf \
    --theme dark --new-page-on-hr