如何在Linux命令行中創(chuàng)建以及展示演示稿

字號(hào):


    你在準(zhǔn)備一場(chǎng)演講的時(shí)候,腦海可能會(huì)先被圖文并茂、形象華麗的演示圖稿所占據(jù)。誠(chéng)然,沒(méi)有人會(huì)否認(rèn)一份生動(dòng)形象的演講稿所帶來(lái)的積極作用。然而,并非所有的演講都需要TED Talk的質(zhì)量。更多時(shí)候,演講稿只為傳達(dá)特定的信息。 而這個(gè),使用文本信息足以完成。在這種情況下,你的時(shí)間可以更好的花在信息的搜集和核實(shí)上面,而不是在谷歌圖片搜索(Google Image)上尋找好看的圖片。
    在Linux的世界里,有幾個(gè)不同的方式供你選擇來(lái)做演講。比如帶有大量多媒體展示、視覺(jué)沖擊效果極佳的Impress.js,專(zhuān)為L(zhǎng)aTex用戶(hù)提供的Beamer,等等。而如果你苦于尋找一種簡(jiǎn)單的方式來(lái)創(chuàng)建并且展示文本演示稿,mdp 就能幫你實(shí)現(xiàn)。
    什么是Mdp?
    mdp是Linux下一款基于ncurses的命令行演示工具。我喜歡mdp在于它對(duì)markdown的支持,使得我很容易以熟悉的markdown格式來(lái)創(chuàng)建幻燈片。自然,它還可以很輕松地用HTML格式來(lái)發(fā)布幻燈片。另一個(gè)好處是它支持UTF-8字符編碼,這讓非英語(yǔ)字符(如希臘或西里爾字母)的展示也變得很方便。
    在Linux中安裝Mdp
    mdp的依賴(lài)需求很少(如 ncursesw),這使得安裝非常簡(jiǎn)單。
    Debian、Ubuntu或者它們的衍生版
    $ sudo apt-get install git gcc make libncursesw5-dev
    $ git clone
    $ cd mdp
    $ make
    $ sudo make install
    Fedora或者CentOS/RHEL
    $ sudo yum install git gcc make ncurses-devel
    $ git clone
    $ cd mdp
    $ make
    $ sudo make install
    Arch Linux
    Arch Linux可以通過(guò)AUR輕松安裝mdp。
    在命令行中創(chuàng)建演示稿
    安裝mdp完畢,你可以使用你喜歡的文本編輯器來(lái)輕松創(chuàng)建一個(gè)演示稿。如果你熟悉markdown的話(huà),很快就可以駕馭mdp。而對(duì)于那些不熟悉markdown的人來(lái)說(shuō),學(xué)習(xí)mdp最好的方式就是從一個(gè)實(shí)例著手。
    這里有一份6頁(yè)的演示稿樣本可供參考。
    %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]()
    You are welcome to connect with me at [LinkedIn]()
    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?
    ???????????
    在命令行中展示演示稿
    當(dāng)你把以上代碼保存為slide.md的文本文件后,你可以運(yùn)行以下命令來(lái)展示演示稿:
    $ mdp slide.md
    你可以通過(guò)按鍵 回車(chē)/空格/下翻頁(yè)/向下光標(biāo)鍵 (下一張幻燈)、回退/上翻頁(yè)/向上光標(biāo)鍵 (上一張幻燈)、Home (幻燈首頁(yè))、 End (幻燈末頁(yè))或者 數(shù)字N (第N頁(yè)幻燈)來(lái)操作你的演示稿。
    演示稿的標(biāo)題將在每頁(yè)幻燈的頂部展示,而你的名字和頁(yè)碼則會(huì)出現(xiàn)在幻燈的底部。
    
    這是嵌套列表和多層次標(biāo)題的實(shí)例效果。
    
    這是代碼片段和內(nèi)聯(lián)代碼的實(shí)例效果。
    
    這是嵌套引用的實(shí)例效果。
    
    這是放置引文的實(shí)例效果。
    
    這是UTF-8編碼特殊字符支持的實(shí)例效果。