如何在Linux命令列中建立以及展示示範稿

來源:互聯網
上載者:User

如何在Linux命令列中建立以及展示示範稿

你在準備一場演講的時候,腦海可能會先被圖文並茂、形象華麗的示範圖稿所佔據。誠然,沒有人會否認一份生動形象的演講稿所帶來的積極作用。然而,並非所有的演講都需要TED Talk的品質。更多時候,演講稿只為傳達特定的資訊。 而這個,使用文本資訊足以完成。在這種情況下,你的時間可以更好的花在資訊的搜集和核實上面,而不是在Google圖片搜尋Google Image)上尋找好看的圖片。

在Linux的世界裡,有幾個不同的方式供你選擇來做演講。比如帶有大量多媒體展示、視覺衝擊效果極佳的Impress.js,專為LaTex使用者提供的Beamer,等等。而如果你苦於尋找一種簡單的方式來建立並且展示文本示範稿,mdp 就能幫你實現。

什麼是Mdp?

mdp是Linux下一款基於ncurses的命令列示範工具。我喜歡mdp在於它對markdown的支援,使得我很容易以熟悉的markdown格式來建立投影片。自然,它還可以很輕鬆地用HTML格式來發布投影片。另一個好處是它支援UTF-8字元編碼,這讓非英語字元如希臘或西裡爾字母)的展示也變得很方便。

在Linux中安裝Mdp

mdp的依賴需求很少如 ncursesw),這使得安裝非常簡單。

Debian、Ubuntu或者它們的衍生版
  1. $ sudo apt-get install git gcc make libncursesw5-dev
  2. $ git clone https://github.com/visit1985/mdp.git
  3. $ cd mdp
  4. $ make
  5. $ sudo make install

Fedora或者CentOS/RHEL
  1. $ sudo yum install git gcc make ncurses-devel
  2. $ git clone https://github.com/visit1985/mdp.git
  3. $ cd mdp
  4. $ make
  5. $ sudo make install

Arch Linux

Arch Linux可以通過AUR輕鬆安裝mdp。

在命令列中建立示範稿

安裝mdp完畢,你可以使用你喜歡的文字編輯器來輕鬆建立一個示範稿。如果你熟悉markdown的話,很快就可以駕馭mdp。而對於那些不熟悉markdown的人來說,學習mdp最好的方式就是從一個執行個體著手。

這裡有一份6頁的示範稿樣本可供參考。

  1. %title: Sample Presentation made with mdp (Xmodulo.com)
  2. %author: Dan Nanni
  3. %date: 2015-01-28
  4.  
  5. -> This is a slide title <-
  6. =========
  7.  
  8. -> mdp is a command-line based presentation tool with markdown support. <-
  9.  
  10. *_Features_*
  11.  
  12. * Multi-level headers
  13. * Code block formatting
  14. * Nested quotes
  15. * Nested list
  16. * Text highlight and underline
  17. * Citation
  18. * UTF-8 special characters
  19.  
  20. -------------------------------------------------
  21.  
  22. -> # Example of nested list <-
  23.  
  24. This is an example of multi-level headers and a nested list.
  25.  
  26. # first-level title
  27.  
  28. second-level
  29. ------------
  30.  
  31. - *item 1*
  32. - sub-item 1
  33. - sub-sub-item 1
  34. - sub-sub-item 2
  35. - sub-sub-item 3
  36. - sub-item 2
  37.  
  38. -------------------------------------------------
  39.  
  40. -> # Example of code block formatting <-
  41.  
  42. This example shows how to format a code snippet.
  43.  
  44. 1 /* Hello World program */
  45. 2
  46. 3 #include <stdio.h>
  47. 4
  48. 5 int main()
  49. 6 {
  50. 7 printf("Hello World");
  51. 8 return 0;
  52. 9 }
  53.  
  54. This example shows inline code: `sudo reboot`
  55.  
  56. -------------------------------------------------
  57.  
  58. -> # Example of nested quotes <-
  59.  
  60. This is an example of nested quotes.
  61.  
  62. # three-level nested quotes
  63.  
  64. > This is the first-level quote.
  65. >> This is the second-level quote
  66. >> and continues.
  67. >>> *This is the third-level quote, and so on.*
  68.  
  69. -------------------------------------------------
  70.  
  71. -> # Example of citations <-
  72.  
  73. This example shows how to place a citation inside a presentation.
  74.  
  75. This tutorial is published at [Xmodulo](http://xmodulo.com)
  76.  
  77. You are welcome to connect with me at [LinkedIn](http://www.linkedin.com/in/xmodulo)
  78.  
  79. Pretty cool, huh?
  80.  
  81. -------------------------------------------------
  82.  
  83. -> # Example of UTF-8 special characters <-
  84.  
  85. This example shows UTF-8 special characters.
  86.  
  87. ae = ä, oe = ö, ue = ü, ss = ß
  88. alpha = ?, beta = ?, upsilon = ?, phi = ?
  89. Omega = ?, Delta = ?, Sigma = ?
  90.  
  91. ???????????
  92. ?rectangle?
  93. ???????????

在命令列中展示示範稿

當你把以上代碼儲存為slide.md的文字檔後,你可以運行以下命令來展示示範稿:

  1. $ mdp slide.md

你可以通過按鍵 斷行符號/空格/下翻頁/向下游標鍵 (下一張幻燈)、回退/上翻頁/向上游標鍵 (上一張幻燈)、Home (幻燈首頁)、 End (幻燈末頁)或者 數字N (第N頁幻燈)來操作你的示範稿。

示範稿的標題將在每頁幻燈的頂部展示,而你的名字和頁碼則會出現在幻燈的底部。

這是嵌套列表和多層次標題的執行個體效果。

這是程式碼片段和內聯代碼的執行個體效果。

這是嵌套引用的執行個體效果。

這是放置引文的執行個體效果。

這是UTF-8編碼特殊字元支援的執行個體效果。

總結

在本教程中,我示範了在命令列中如何使用mdp來建立並且展示一個示範稿。mdp的markdown相容性讓我們省去了學習其它新格式的麻煩,這相對於另一種名為tpp的示範工具來說是一個優勢。拘於mdp的局限性,它可能無法作為你的預設示範工具。但是,值得肯定的是它一定能在某個場合下派上用場。你覺得mdp怎麼樣呢?你還喜歡其它的什麼東西嗎?

via: http://xmodulo.com/presentation-command-line-linux.html

作者:Dan Nanni 譯者:soooogreen 校對:wxy

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.