Github每日精选(第88期):命令行下的ppt-slides

slides

基于终端的演示工具,在终端中,我们想要ppt的形式来展现我们的文件,文件可以用markdown的形式来编写,这样是不是很方便呢?

slides 就是这样的一个应用。

在这里插入图片描述
github上的地址在这里

安装

macos下的安装:

brew install slides

go语言进行安装:

go install github.com/maaslalani/slides@latest

从源中,进行安装:

git clone https://github.com/maaslalani/slides.git
cd slides
go install

用法

创建一个包含幻灯片的简单降价文件:

# Welcome to Slides
A terminal based presentation tool

---

## Everything is markdown
In fact, this entire presentation is a markdown file.

---

## Everything happens in your terminal
Create slides and present them without ever leaving your terminal.

---

## Code execution
```go
package main

import "fmt"

func main() {
  fmt.Println("Execute code directly inside the slides")
}
```

You can execute code inside your slides by pressing `<C-e>`,
the output of your command will be displayed at the end of the current slide.

---

## Pre-process slides

You can add a code block with three tildes (`~`) and write a command to run *before* displaying
the slides, the text inside the code block will be passed as `stdin` to the command
and the code block will be replaced with the `stdout` of the command.

```
~~~graph-easy --as=boxart
[ A ] - to -> [ B ]
~~~
```

The above will be pre-processed to look like:

┌───┐  to   ┌───┐
│ A │ ────> │ B │
└───┘       └───┘

For security reasons, you must pass a file that has execution permissions
for the slides to be pre-processed. You can use `chmod` to add these permissions.

```bash
chmod +x file.md
```

然后,演示,运行:

slides presentation.md

在这里插入图片描述

如果给定文件名,slides将自动查找文件中的更改并实时更新演示文稿。

slides也接受输入stdin

curl http://example.com/slides.md | slides

版权声明:本文为weixin_40425640原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。