歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 如何在Linux命令行中創建以及展示演示稿

如何在Linux命令行中創建以及展示演示稿

日期:2017/2/27 15:55:29   编辑:Linux教程
你在准備一場演講的時候,腦海可能會先被圖文並茂、形象華麗的演示圖稿所占據。誠然,沒有人會否認一份生動形象的演講稿所帶來的積極作用。然而,並非所有的演講都需要TED Talk的質量。更多時候,演講稿只為傳達特定的信息。 而這個,使用文本信息足以完成。在這種情況下,你的時間可以更好的花在信息的搜集和核實上面,而不是在谷歌圖片搜索(Google Image)上尋找好看的圖片。

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

什麼是Mdp?
mdp是Linux下一款基於ncurses的命令行演示工具。我喜歡mdp在於它對markdown的支持,使得我很容易以熟悉的markdown格式來創建幻燈片。自然,它還可以很輕松地用HTML格式來發布幻燈片。另一個好處是它支持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。

在命令行中創建演示稿
安裝mdp完畢,你可以使用你喜歡的文本編輯器來輕松創建一個演示稿。如果你熟悉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 (幻燈末頁)或者 數字N (第N頁幻燈)來操作你的演示稿。

演示稿的標題將在每頁幻燈的頂部展示,而你的名字和頁碼則會出現在幻燈的底部。
這是嵌套列表和多層次標題的實例效果。
這是代碼片段和內聯代碼的實例效果。
這是嵌套引用的實例效果。
這是放置引文的實例效果。
這是UTF-8編碼特殊字符支持的實例效果。
總結
在本教程中,我演示了在命令行中如何使用mdp來創建並且展示一個演示稿。mdp的markdown兼容性讓我們省去了學習其它新格式的麻煩,這相對於另一種名為tpp的演示工具來說是一個優勢。拘於mdp的局限性,它可能無法作為你的默認演示工具。但是,值得肯定的是它一定能在某個場合下派上用場。你覺得mdp怎麼樣呢?你還喜歡其它的什麼東西嗎?
原文:http://linux.cn/article-4858-1.html
Copyright © Linux教程網 All Rights Reserved