4 种基于 Markdown 的幻灯片生成器
markdown 演示 幻灯片

> 
> 这些简单的幻灯片创建工具可以无缝地使用 Markdown，可以让你的演示添加魅力。
> 
> 
> 


![](/data/attachment/album/201806/09/234956jzrziipqpjci4djw.png)


假设你需要做一个<ruby> 演示 <rt>  presentation </rt></ruby>。在准备的过程中，你想到“我需要写几张幻灯片”。


你可能倾向于简洁的[纯文本](https://plaintextproject.online/)，认为 LibreOffice Writer 这样的软件对你要做的事情而言像是杀鸡用牛刀。或者你只是遵从你内心深处的极客意识。


将 [Markdown](https://en.wikipedia.org/wiki/Markdown) 格式的文件转换为优雅的演示幻灯片并不困难。下面介绍可以完成这项工作的四种工具。


### Landslide


在这些工具中，[Landslide](https://github.com/adamzap/landslide) 具有更高的灵活性。它是一个命令行工具，可以将 Markdown、[reStructuredText](https://en.wikipedia.org/wiki/ReStructuredText) 或 [Textile](https://en.wikipedia.org/wiki/Textile_(markup_language)) 格式的文件转换为基于 [Google HTML5 幻灯片模板](https://github.com/skaegi/html5slides)的 HTML 文件。


你要做的不过是编写 Markdown 格式的幻灯片源文件，打开一个终端窗口并运行 `landslide` 命令即可，其中命令参数为 Markdown 文件的文件名。Landslide 会生成 `presentation.html`，可以在任何 Web 浏览器中打开。简单吧？


但不要被简易的操作误导你。Landslide 提供了不少有用的特性，例如增加注记以及为幻灯片增加配置文件。为何要使用这些特性呢？按照 Landslide 开发者的说法，这样可以汇聚不同演示中的源文件目录并重用。


![landslide.png](/data/attachment/album/201806/09/235000jfbqul77q7y22zpf.png "landslide.png")


*在 Landslide 演示中查看演示者注记*


### Marp


[Marp](https://yhatt.github.io/marp/) 仍处于开发中，但值得期待。它是 “Markdown Presentation Writer” 的简写。Marp 是一个基于 [Electron](https://en.wikipedia.org/wiki/Electron_(software_framework)) 的工具，让你在一个简单的双栏编辑器中编写幻灯片：在左栏编写 Markdown，在右栏中预览效果。


Marp 支持 [GitHub 风格 Markdown](https://guides.github.com/features/mastering-markdown/)。如果你需要一个使用 GitHub 风格 Markdown 编写幻灯片的快速教程，可以参考 [示例项目](https://raw.githubusercontent.com/yhatt/marp/master/example.md)。GitHub 风格 Markdown 比基础 Markdown 更加灵活。


Marp 只自带两个基础主题，但你可以为幻灯片增加背景图片、调整图片大小以及增加数学表达式。不足之处，目前只支持 PDF 格式导出。老实说，我很好奇为何不一开始就提供 HTML 格式导出。


![marp.png](/data/attachment/album/201806/09/235003f1zilvija1vnllha.png "marp.png")


*使用 Marp 编辑简单的幻灯片*


### Pandoc


你可能已经知道 [pandoc](https://pandoc.org/) 是一种支持多种<ruby> 标记语言 <rt>  markup languages </rt></ruby>相互转换的神奇工具。但你可能不知道，pandoc 可以将 Markdown 格式文件转换为 [Slidy](https://www.w3.org/Talks/Tools/Slidy2/Overview.html#(1))、[Slideous](http://goessner.net/articles/slideous/)、[DZSlides](http://paulrouget.com/dzslides/) 和 [Reveal.js](https://revealjs.com/#/) 等演示框架支持的优雅 HTML 幻灯片。如果你使用 [LaTeX](https://www.latex-project.org/)，可以使用 [Beamer 软件包](https://en.wikipedia.org/wiki/Beamer_(LaTeX))输出 PDF 格式的幻灯片。


你需要在幻灯片中[使用特定格式](https://pandoc.org/MANUAL.html#producing-slide-shows-with-pandoc)，但可以通过[变量](https://pandoc.org/MANUAL.html#variables-for-slides)控制其效果。你也可以更改幻灯片的外观与风格，增加幻灯片之间的暂停，添加演示者注记等。


当然，你需要在你的主机上安装你喜欢的演示框架，因为 Pandoc 只生成原始幻灯片文件。


![pandoc.png](/data/attachment/album/201806/09/235017vfh129lz14zl6ffk.png "pandoc.png")


*查看使用 Pandoc 和 DZSlides 创建的幻灯片*


### Hacker Slides


[Hacker Slides](https://github.com/jacksingleton/hacker-slides) 是一个 [Sandstorm](https://sandstorm.io/) 和 [Sandstorm Oasis](https://oasis.sandstorm.io/) 平台上的应用，基于 Markdown 和 [Reveal.js](https://revealjs.com/#/) 幻灯片框架。生成的幻灯片可以比较朴素，也可以很炫。


在浏览器的两栏界面中编写幻灯片，左栏输入 Markdown 文本，右栏渲染效果。当你制作完成后，可以在 Sandstorm 中演示，也可以生成分享链接让其它人演示。


你可能会说，你不使用 Sandstorm 或 Sandstorm Oasis 怎么办？不要担心，Hacker Slides 提供了可以在桌面或服务器上运行的[版本](https://github.com/msoedov/hacker-slides)。


![hacker-slides.png](/data/attachment/album/201806/09/235019ckuqu19dlqnk8bt1.png "hacker-slides.png")


*在 Hacker Slides 中编辑幻灯片*


### 两点特别补充


如果你使用 [Jupyter <ruby> 笔记本 <rt>  Notebooks </rt></ruby>](http://jupyter.org/) （参考社区版主 Don Watkins 的[文章](/article-9664-1.html)）发布数据或指令文本，你可以使用 [Jupyter2slides](https://github.com/datitran/jupyter2slides)。该工具基于 Reveal.js，可以将笔记本转换为一系列精美的 HTML 幻灯片。


如果你倾向于托管应用，试试 [GitPitch](https://gitpitch.com/)，支持 GitHub、GitLab 和 Bitbucket。只需在将幻灯片源文件推送到支持的代码仓库中，在 GitPitch 中指向该仓库，这样你就可以在 GitPitch 网站上看到你的幻灯片了。


你有最喜欢的基于 Markdown 的幻灯片生成器吗？留下评论分享吧。




---


via: <https://opensource.com/article/18/5/markdown-slide-generators>


作者：[Scott Nesbitt](https://opensource.com/users/scottnesbitt) 选题：[lujun9972](https://github.com/lujun9972) 译者：[pinewall](https://github.com/pinewall) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
Imagine you've been tapped to give a presentation. As you're preparing your talk, you think, "I should whip up a few slides."

Maybe you prefer the simplicity of [plain text](https://plaintextproject.online/), or maybe you think software like LibreOffice Writer is overkill for what you need to do. Or perhaps you just want to embrace your inner geek.

It's easy to turn files formatted with [Markdown](https://en.wikipedia.org/wiki/Markdown) into attractive presentation slides. Here are four tools that can do help you do the job.

## Landslide

One of the more flexible applications on this list, [Landslide](https://github.com/adamzap/landslide) is a command-line application that takes files formatted with Markdown, [reStructuredText](https://en.wikipedia.org/wiki/ReStructuredText), or [Textile](https://en.wikipedia.org/wiki/Textile_(markup_language)) and converts them into an HTML file based on [Google’s HTML5 slides template](https://github.com/skaegi/html5slides).

All you need to do is write up your slides with Markdown, crack open a terminal window, and run the command `landslide`

followed by the name of the file. Landslide will spit out *presentation.html*, which you can open in any web browser. Simple, isn’t it?

Don't let that simplicity fool you. Landslide offers more than a few useful features, such as the ability to add notes and create configuration files for your slides. Why would you want to do that? According to Landslide's developer, it helps with aggregating and reusing source directories across presentations.

![landslide.png landslide.png](https://opensource.com/sites/default/files/uploads/landslide.png)

Viewing presenter notes in a Landslide presentation

## Marp

[Marp](https://yhatt.github.io/marp/) is a work in progress, but it shows promise. Short for "Markdown Presentation Writer," Marp is an [Electron](https://en.wikipedia.org/wiki/Electron_(software_framework)) app in which you craft slides using a simple two-pane editor: Write in Markdown in the left pane and you get a preview in the right pane.

Marp supports [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). If you need a quick tutorial on using GitHub Flavored Markdown to write slides, check out the [sample presentation](https://raw.githubusercontent.com/yhatt/marp/master/example.md). It's a bit more flexible than baseline Markdown.

While Marp comes with only two very basic themes, you can add background images to your slides, resize them, and include math. On the down side, it currently lets you export your slides only as PDF files. To be honest, I wonder why HTML export wasn’t a feature from day one.

![marp.png marp.png](https://opensource.com/sites/default/files/uploads/marp.png)

Editing some simple slides in Marp

## Pandoc

You probably know [pandoc](https://pandoc.org/) as a magic wand for converting between various markup languages. What you might not know is that pandoc can take a file formatted with Markdown and create attractive HTML slides that work with the [Slidy](https://www.w3.org/Talks/Tools/Slidy2/Overview.html#(1)), [Slideous](http://goessner.net/articles/slideous/), [DZSlides](http://paulrouget.com/dzslides/), [S5](https://meyerweb.com/eric/tools/s5/), and [Reveal.js](https://revealjs.com/#/) presentation frameworks. If you prefer [LaTeX](https://www.latex-project.org/), you can also output PDF slides using the [Beamer package](https://en.wikipedia.org/wiki/Beamer_(LaTeX)).

You'll need to [use specific formatting](https://pandoc.org/MANUAL.html#producing-slide-shows-with-pandoc) for your slides, but you can add some [variables](https://pandoc.org/MANUAL.html#variables-for-slides) to control how they behave. You can also change the look and feel of your slides, add pauses between slides, and include speaker notes.

Of course, you must have the supporting files for your preferred presentation framework installed on your computer. Pandoc spits out only the raw slide file.

![pandoc.png pandoc.png](https://opensource.com/sites/default/files/uploads/pandoc.png)

Viewing slides created with Pandoc and DZSlides

## Hacker Slides

[Hacker Slides](https://github.com/jacksingleton/hacker-slides) is an application for [Sandstorm](https://sandstorm.io/) and [Sandstorm Oasis](https://oasis.sandstorm.io/) that mates Markdown and the [Reveal.js](https://revealjs.com/#/) slide framework. The slides are simple, but they can be visually striking.

Craft your slide deck in a two-pane editor in your browser—type in Markdown on the left and see it rendered on the right. When you're ready to present, you can do it from within Sandstorm or get a link that you can share with others to present remotely.

What’s that—you say that you don’t use Sandstorm or Sandstorm Oasis? No worries.There's a [version of Hacker Slides](https://github.com/msoedov/hacker-slides) that you can run on your desktop or server.

![hacker-slides.png hacker-slides.png](https://opensource.com/sites/default/files/uploads/hacker-slides.png)

Editing slides in Hacker Slides

## Two honorable mentions

If you use [Jupyter Notebooks](http://jupyter.org/) (see community moderator Don Watkins' [article](https://opensource.com/article/18/3/getting-started-jupyter-notebooks)) to publish data or instructional texts, then [Jupyter2slides](https://github.com/datitran/jupyter2slides) is for you. It works with Reveal.js to convert a notebook into a nice set of HTML slides.

If you prefer your applications hosted, test-drive [GitPitch](https://gitpitch.com/). It works with GitHub, GitLab, and Bitbucket. Just push the source files for your slides to a repository on one of those services, point GitPitch to that repository, and your slides are ready to view at the GitPitch site.

Do you have a favorite Markdown-powered slide generator? Share it by leaving a comment.

## 4 Comments