Home

Awesome

mdp - A command-line based markdown presentation tool.

image


How to get started:

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

Now download and install mdp:

$ git clone https://github.com/visit1985/mdp.git
$ cd mdp
$ make
$ make install
$ mdp sample.md

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:

Supports headers prefixed by @ symbol.

Review sample.md for more details.


Default controls:


Configuration:

A config.h configuration file is available in include/, change the settings you want and recompile. Colors, keybindings and list types are configurable as of now. Note that configuring colors only works in 8 color mode.


How to debug it:

To make a debug version of mdp, just type:

$ make DEBUG=1

Convert to PDF:

$ 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