如何在Linux命令行中創(chuàng)建以及展示演示稿
你在準備一場演講的時候,腦??赡軙缺粓D文并茂、形象華麗的演示圖稿所占據(jù)。誠然,沒有人會否認一份生動形象的演講稿所帶來的積極作用。然而,并非所有的演講都需要TED Talk的質(zhì)量。更多時候,演講稿只為傳達特定的信息。 而這個,使用文本信息足以完成。在這種情況下,你的時間可以更好的花在信息的搜集和核實上面,而不是在谷歌圖片搜索(Google Image)上尋找好看的圖片。
在Linux的世界里,有幾個不同的方式供你選擇來做演講。比如帶有大量多媒體展示、視覺沖擊效果***的Impress.js,專為LaTex用戶提供的Beamer,等等。而如果你苦于尋找一種簡單的方式來創(chuàng)建并且展示文本演示稿,mdp 就能幫你實現(xiàn)。
什么是Mdp?
mdp是Linux下一款基于ncurses的命令行演示工具。我喜歡mdp在于它對markdown的支持,使得我很容易以熟悉的markdown格式來創(chuàng)建幻燈片。自然,它還可以很輕松地用HTML格式來發(fā)布幻燈片。另一個好處是它支持UTF-8字符編碼,這讓非英語字符(如希臘或西里爾字母)的展示也變得很方便。
在Linux中安裝Mdp
mdp的依賴需求很少(如 ncursesw),這使得安裝非常簡單。
Debian、Ubuntu或者它們的衍生版
- $ sudo apt-get install git gcc make libncursesw5-dev
- $ git clone https://github.com/visit1985/mdp.git
- $ cd mdp
- $ make
- $ sudo make install
Fedora或者CentOS/RHEL
- $ sudo yum install git gcc make ncurses-devel
- $ git clone https://github.com/visit1985/mdp.git
- $ cd mdp
- $ make
- $ sudo make install
Arch Linux
Arch Linux可以通過AUR輕松安裝mdp。
在命令行中創(chuàng)建演示稿
安裝mdp完畢,你可以使用你喜歡的文本編輯器來輕松創(chuàng)建一個演示稿。如果你熟悉markdown的話,很快就可以駕馭mdp。而對于那些不熟悉markdown的人來說,學習mdp***的方式就是從一個實例著手。
這里有一份6頁的演示稿樣本可供參考。
- %title: Sample Presentation made with mdp (Xmodulo.com)
- %author: Dan Nanni
- %date: 2015-01-28
- -> This is a slide title <-
- =========
- -> mdp is a command-line based presentation tool with markdown support. <-
- *_Features_*
- * Multi-level headers
- * Code block formatting
- * Nested quotes
- * Nested list
- * Text highlight and underline
- * Citation
- * UTF-8 special characters
- -------------------------------------------------
- -> # Example of nested list <-
- This is an example of multi-level headers and a nested list.
- # first-level title
- second-level
- ------------
- - *item 1*
- - sub-item 1
- - sub-sub-item 1
- - sub-sub-item 2
- - sub-sub-item 3
- - sub-item 2
- -------------------------------------------------
- -> # Example of code block formatting <-
- This example shows how to format a code snippet.
- 1 /* Hello World program */
- 2
- 3 #include <stdio.h>
- 4
- 5 int main()
- 6 {
- 7 printf("Hello World");
- 8 return 0;
- 9 }
- This example shows inline code: `sudo reboot`
- -------------------------------------------------
- -> # Example of nested quotes <-
- This is an example of nested quotes.
- # three-level nested quotes
- > This is the first-level quote.
- >> This is the second-level quote
- >> and continues.
- >>> *This is the third-level quote, and so on.*
- -------------------------------------------------
- -> # Example of citations <-
- This example shows how to place a citation inside a presentation.
- This tutorial is published at [Xmodulo](http://xmodulo.com)
- You are welcome to connect with me at [LinkedIn](http://www.linkedin.com/in/xmodulo)
- Pretty cool, huh?
- -------------------------------------------------
- -> # Example of UTF-8 special characters <-
- This example shows UTF-8 special characters.
- ae = ä, oe = ö, ue = ü, ss = ß
- alpha = ?, beta = ?, upsilon = ?, phi = ?
- Omega = ?, Delta = ?, Sigma = ?
- ???????????
- ?rectangle?
- ???????????
在命令行中展示演示稿
當你把以上代碼保存為slide.md的文本文件后,你可以運行以下命令來展示演示稿:
- $ mdp slide.md
你可以通過按鍵 回車/空格/下翻頁/向下光標鍵 (下一張幻燈)、回退/上翻頁/向上光標鍵 (上一張幻燈)、Home (幻燈首頁)、 End (幻燈末頁)或者 數(shù)字N (第N頁幻燈)來操作你的演示稿。
演示稿的標題將在每頁幻燈的頂部展示,而你的名字和頁碼則會出現(xiàn)在幻燈的底部。
這是嵌套列表和多層次標題的實例效果。
這是代碼片段和內(nèi)聯(lián)代碼的實例效果。
這是嵌套引用的實例效果。
這是放置引文的實例效果。
這是UTF-8編碼特殊字符支持的實例效果。
總結(jié)
在本教程中,我演示了在命令行中如何使用mdp來創(chuàng)建并且展示一個演示稿。mdp的markdown兼容性讓我們省去了學習其它新格式的麻煩,這相對于另一種名為tpp的演示工具來說是一個優(yōu)勢。拘于mdp的局限性,它可能無法作為你的默認演示工具。但是,值得肯定的是它一定能在某個場合下派上用場。你覺得mdp怎么樣呢?你還喜歡其它的什么東西嗎?
via: http://xmodulo.com/presentation-command-line-linux.html
作者:Dan Nanni 譯者:soooogreen 校對:wxy