slides README

The project's README from github.com/maaslalani/slides. As one markdown file: README.md.

Slides

Slides in your terminal.

Slides Presentation

Installation

Homebrew Snapcraft AUR

Instructions

MacOS

brew install slides

Arch

yay -S slides

Nixpkgs (unstable)

nix-env -iA nixpkgs.slides

Any Linux Distro running snapd

sudo snap install slides

Go

go install github.com/maaslalani/slides@latest

From source:

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

You can also download a binary from the releases page.

Usage

Create a simple markdown file that contains your slides:

# 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
```

Checkout the example slides.

Then, to present, run:

slides presentation.md

If given a file name, slides will automatically look for changes in the file and update the presentation live.

slides also accepts input through stdin:

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

Go to the first slide with the following key sequence:

Go to the next slide with any of the following key sequences:

Go to the previous slide with any of the following key sequences:

Go to a specific slide with the following key sequence:

Go to the last slide with the following key:

To quickly jump to the right slide, you can use the search function.

Press /, enter your search term and press Enter
(The search term is interpreted as a regular expression. The /i flag causes case-insensitivity.).

Press ctrl+n after a search to go to the next search result.

Code Execution

If slides finds a code block on the current slides it can execute the code block and display the result as virtual text on the screen.

Press ctrl+e on a slide with a code block to execute it and display the result.

Pre-processing

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. Wrap the pre-processed block in three backticks to keep proper formatting and new lines.

```
~~~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.

chmod +x file.md

Configuration

slides allows you to customize your presentation's look and feel with metadata at the top of your slides.md.

This section is entirely optional, slides will use sensible defaults if this section or any field in the section is omitted.

---
theme: ./path/to/theme.json
author: Gopher
date: MMMM dd, YYYY
paging: Slide %d / %d
---

Date format

Given the date January 02, 2006:

Value Translates to
YYYY 2006
YY 06
MMMM January
MMM Jan
MM 01
mm 1
DD 02
dd 2

SSH

Slides is accessible over ssh if hosted on a machine through the slides serve [file] command.

On a machine, run:

slides serve [file]

Then, on another machine (or same machine), ssh into the port specified by the slides serve [file] command:

ssh 127.0.0.1 -p 53531

You will be able to access the presentation hosted over SSH! You can use this to present with slides from a computer that doesn't have slides installed, but does have ssh. Or, let your viewers have access to the slides on their own computer without needing to download slides and the presentation file.

Alternatives

Credits: This project was heavily inspired by lookatme.

Development

See the development documentation

slides (maaslalani/slides)

Searching Database…

11.7K ·GitHub
这是什么?Slides 是一个在终端里创建和演示 Markdown 幻灯片的工具,无需离开终端即可完成演示。
这是一个在终端里运行的命令行应用吗,还是需要图形界面?它是纯命令行(CLI)/终端界面(TUI)工具:你写一个 Markdown 文件,然后运行 'slides file.md',就能直接在终端中显示,无需图形界面。
我该如何创建并运行演示文稿?编写一个包含幻灯片内容的 Markdown 文件,然后运行 'slides file.md'。文件变化时会自动实时刷新,也可以通过标准输入(stdin)接收内容。
除了 Markdown 文件本身,我还需要什么?不需要其他东西。可以通过 Homebrew、Arch 或 Nix 软件包、snap、'go install' 安装,也可以直接从 Releases 页面下载预编译的二进制文件。
预处理或代码执行功能会不加检查地运行任意命令吗?代码块可以用 ctrl+e 实时执行,预处理命令会在显示前运行。但出于安全考虑,被预处理的文件必须通过 chmod 显式设置执行权限,否则 slides 不会运行它。
我能否在观众的电脑上不安装 slides 的情况下,通过 SSH 进行演示?可以。在主机上运行 'slides serve [file]',观众就能通过 SSH 连接到指定端口,无需自行安装 slides 即可观看实时演示。
演示时能在演示文稿中搜索内容吗?可以。按 '/' 键并输入正则表达式,即可跳转到匹配的幻灯片;然后按 ctrl+n 切换到下一个搜索结果。
我能自定义演示文稿的外观吗?可以。slides.md 顶部的元数据可以设置 glamour 主题、作者姓名、日期格式以及翻页字符串;所有字段都是可选的,并有合理的默认值。
这个项目的灵感来自哪里?作者提到 lookatme、sli.dev 和 presenterm 启发了他开发这个基于 Go 的终端演示工具。
What are similar projects?micro, lazygit, sampler, gh-dash, fx, oh-my-posh, veet, qrcp
Creator
maaslalani
Size
4.3 MB
Stars
11.7K
Age
5y
Commits · 90 Days