maaslalani-slides基于終端的演示工具
maaslalani-slides 是一個基于終端的演示工具。
安裝
macOS
brew install slides
Arch
yay -S slides
Nixpkgs (unstable)
nix-env -iA nixpkgs.slides
Linux
sudo snap install slides
Go
go install github.com/maaslalani/slides@latest
從源代碼
git clone https://github.com/maaslalani/slides.git
cd slides
go install
用法
創(chuàng)建一個包含幻燈片的簡單 Markdown 文件:
# 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 ```
然后,為了呈現(xiàn),運行:
slides presentation.md
如果給定文件名,slides將自動查找文件中的更改并實時更新演示文稿。
slides還通過stdin接受輸入:
curl http://example.com/slides.md | slides
配置
slides允許你在slides.md的頂部使用元數(shù)據(jù)定義演示文稿的外觀。
此部分完全是可選的,slides如果省略此部分或該部分中的任何字段,將使用默認值。
--- theme: ./path/to/theme.json author: Gopher date: January 2, 2006 paging: Slide %d / %d ---
評論
圖片
表情
