Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Terminal based presentation tool

License

NotificationsYou must be signed in to change notification settings

maaslalani/slides

Repository files navigation

Slides in your terminal.

Slides Presentation

Installation

HomebrewSnapcraftAUR

Instructions

MacOS

brew install slides

Arch

yay -S slides

Nixpkgs (unstable)

nix-env -iA nixpkgs.slides

Any Linux Distro runningsnapd

sudo snap install slides

Go

go install github.com/maaslalani/slides@latest

From source:

git clone https://github.com/maaslalani/slides.gitcd slidesgo install

You can also download a binary from thereleases page.

Usage

Create a simple markdown file that contains your slides:

#Welcome to SlidesA terminal based presentation tool---##Everything is markdownIn fact, this entire presentation is a markdown file.---##Everything happens in your terminalCreate slides and present them without ever leaving your terminal.---##Code execution```gopackage mainimport"fmt"funcmain() {  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 slidesYou can add a code block with three tildes (`~`) and write a command to run*before* displayingthe slides, the text inside the code block will be passed as`stdin` to the commandand 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 permissionsfor the slides to be pre-processed. You can use`chmod` to add these permissions.```bashchmod +x file.md```

Checkout theexample 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 throughstdin:

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

Go to the first slide with the following key sequence:

  • gg

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

  • space
  • right
  • down
  • enter
  • n
  • j
  • l
  • Page Down
  • number + any of the above (go forward n slides)

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

  • left
  • up
  • p
  • h
  • k
  • N
  • Page Up
  • number + any of the above (go back n slides)

Go to a specific slide with the following key sequence:

  • number +G

Go to the last slide with the following key:

  • G

Search

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

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

Pressctrl+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 texton the screen.

Pressctrl+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 runbefore displaying the slides, the text inside the code block will be passedasstdin to the command and the code block will be replaced with thestdoutof the command. Wrap the pre-processed block in three backticks to keepproper 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 permissionsfor the slides to be pre-processed. You can usechmod 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 yourslides.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.jsonauthor:Gopherdate:MMMM dd, YYYYpaging:Slide %d / %d---
  • theme: Path tojson file containing aglamourtheme, can alsobe a link to a remotejson file which slides will fetch before presenting.
  • author: Astring to display on the bottom-left corner of the presentationview. Defaults to the OS current user's full name. Can be empty to hide the author.
  • date: Astring that is used to format today's date in theYYYY-MM-DD format. If the date is not a validformat, the string will be displayed. Defaults toYYYY-MM-DD.
  • paging: Astring that contains 0 or more%d directives. The first%dwill be replaced with the current slide number and the second%d will bereplaced with the total slides count. Defaults toSlide %d / %d.You will need to surround the paging value with quotes if it starts with%.

Date format

Given the dateJanuary 02, 2006:

ValueTranslates to
YYYY2006
YY06
MMMMJanuary
MMMJan
MM01
mm1
DD02
dd2

SSH

Slides is accessible overssh if hosted on a machine through theslides serve [file] command.

On a machine, run:

slides serve [file]

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

ssh 127.0.0.1 -p 53531

You will be able to access the presentation hosted over SSH! You can use thisto present withslides from a computer that doesn't haveslides installed,but does havessh. Or, let your viewers have access to the slides on theirown computer without needing to downloadslides and the presentation file.

Alternatives

Credits: This project was heavily inspired bylookatme.

Development

See thedevelopment documentation


[8]ページ先頭

©2009-2025 Movatter.jp