Git Product home page Git Product logo

slides's Introduction

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:

  • g g

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 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
---
  • theme: Path to json file containing a glamour theme, can also be a link to a remote json file which slides will fetch before presenting.
  • author: A string to display on the bottom-left corner of the presentation view. Defaults to the OS current user's full name. Can be empty to hide the author.
  • date: A string that is used to format today's date in the YYYY-MM-DD format. If the date is not a valid format, the string will be displayed. Defaults to YYYY-MM-DD.
  • paging: A string that contains 0 or more %d directives. The first %d will be replaced with the current slide number and the second %d will be replaced with the total slides count. Defaults to Slide %d / %d. You will need to surround the paging value with quotes if it starts with %.

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's People

Contributors

angristan avatar brittonhayes avatar chenrui333 avatar cuducos avatar darmiel avatar delta456 avatar dependabot[bot] avatar gsol10 avatar itmecho avatar kerdokurs avatar kjellkvinge avatar kz6fittycent avatar leedsjohn avatar linw1995 avatar lommelun avatar maaslalani avatar meowgorithm avatar mfathi91 avatar mfontanini avatar mpas avatar natecross avatar ocelotsloth avatar paranlee avatar rahji avatar raidancampbell avatar sibprogrammer avatar stoovon avatar suzaku avatar u0nel avatar uziam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slides's Issues

Why j shotcut goes up?

A small comment/question regarding keyboard shortcuts j and k.

Maybe I am mistaken, but to me, those two shortcuts became well-known thanks to vim. In vim, j means going to the next line, while k is to go back up.

Why this choice of saying that j goes to the previous slide and k to the next one? It seems odd to me. In most presentation applications, the opposite is implemented.

Thanks

Allow theme customization

We should allow users to customize their theme through the theme.json.

Ideally, we would offer preset themes that users can choose from and also allow for full customization of the theme.json.

Metadata does not display when set.

Describe the bug
Metadata does not display in the bar

To Reproduce
Steps to reproduce the behavior:
1.

brew install slide
  1. Copy and paste the example metadata file
  2. Nothing changes

Expected behavior
Metadata should be displayed

Desktop (please complete the following information):

  • OS: OS11 - Big Sur
  • iTerm2

Error: could not parse code block

Describe the bug
It is not possible to execute a code-block

To Reproduce
Steps to reproduce the behavior:

  1. Create a slide with one page and a simple code-block
  2. Start the slide and browse to the page with the code-block
  3. Execute (Ctrl+e) the code-block
  4. See error: Error: could not parse code block
---

## Bash

~~~bash
ls -al
~~~

Expected behavior
The code-block is executed

Desktop (please complete the following information):
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Software version
snap-id: iVzf6DoBLkUj1lmBkm6cKA545qHx42nK
tracking: latest/stable
refresh-date: today at 10:12 CEST
channels:
latest/stable: 0.3.0 2021-06-24 (11) 6MB -
latest/candidate: ↑
latest/beta: ↑
latest/edge: 0.3.0 2021-06-24 (11) 6MB -
installed: 0.3.0 (11) 6MB -

Additional context
I found a fixed issue which mentioned the need of an empty-line after the code. I tried that without any change

Incorrect date is shown

Describe the bug
The incorrect date is shown in the bottom left corner.

To Reproduce
Steps to reproduce the behavior:

  1. Create a presentation.md file (today is the 8th of June)
  2. Run slides presentation.md
  3. Check the date at the bottom left corner.

Actual result
2021-06-09

Expected behavior
2021-06-08

Pre release 0.4.0 fails tests

Describe the bug
Tests on the pre-release 0.4.0 tag fail.

~/Projects/aur/slides-git/src/slides main
❯ go test ./...
?   	github.com/maaslalani/slides	[no test files]
?   	github.com/maaslalani/slides/cmd	[no test files]
ok  	github.com/maaslalani/slides/internal/code	(cached)
ok  	github.com/maaslalani/slides/internal/file	(cached)
ok  	github.com/maaslalani/slides/internal/meta	(cached)
?   	github.com/maaslalani/slides/internal/model	[no test files]
--- FAIL: TestExecute (0.00s)
    --- FAIL: TestExecute/Replace (0.00s)
        execute_test.go:34: Invalid execution, want Replace, got 
FAIL
FAIL	github.com/maaslalani/slides/internal/process	0.001s
ok  	github.com/maaslalani/slides/styles	(cached)
FAIL

To Reproduce
Steps to reproduce the behavior:

git clone https://github.com/maaslalani/slides.git
cd slides
git checkout main
git pull
go test ./...

Alternatively, on Arch Linux:

git clone https://aur.archlinux.org/slides-git.git
cd slides-git
makepkg

Yields:

~/Projects/aur/slides-git master*
❯ makepkg
==> Making package: slides-git 0.4.0.r0.g742251d-1 (Sun 27 Jun 2021 09:40:40 PM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating slides git repo...
Fetching origin
From https://github.com/maaslalani/slides
 - [deleted]         (none)     -> node
 - [deleted]         (none)     -> preprocess
 - [deleted]         (none)     -> preprocessing
==> Validating source files with sha256sums...
    slides ... Skipped
==> Extracting sources...
  -> Creating working copy of slides git repo...
Switched to and reset branch 'makepkg'
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
==> Starting check()...
?   	github.com/maaslalani/slides	[no test files]
?   	github.com/maaslalani/slides/cmd	[no test files]
ok  	github.com/maaslalani/slides/internal/code	(cached)
ok  	github.com/maaslalani/slides/internal/file	0.002s
ok  	github.com/maaslalani/slides/internal/meta	(cached)
?   	github.com/maaslalani/slides/internal/model	[no test files]
--- FAIL: TestExecute (0.00s)
    --- FAIL: TestExecute/Replace (0.00s)
        execute_test.go:34: Invalid execution, want Replace, got 
FAIL
FAIL	github.com/maaslalani/slides/internal/process	0.001s
ok  	github.com/maaslalani/slides/styles	(cached)
FAIL
==> ERROR: A failure occurred in check().
    Aborting...

Expected behavior
Tests pass.

Desktop (please complete the following information):

  • OS: Arch Linux 5.12.12-arch1-1
  • Golang: go version go1.16.5 linux/amd64

pre-processing the whole document (discussion)

Hi, it's me again 😅
Sorry, but your tool is too cool.

Background Story
Currently I'm creating a presentation and I thought "maybe I should add an agenda/'table of content" at the beginning of my presentation". My first thought was to ask for such a feature, but it felt stupid at the same time, so that's not what I'm going to do. I wanted a solution that has little effort on author side, but gives big flexibility on user side.

Proposal for discussion
I'm not in the position to make any request, so instead I just want to start a discussion with you and your slides users, mainly because I don't know if it is a good idea or not.

What if it would be possible to use the 3 tilde pre-processing feature to send the whole document thru an external tool.
For example the syntax could be

~~~createtoc
~~~

so an empty block or maybe ...

~~~createtoc

to send the whole markdown file to an external document, in this example a self-written tool named "createtoc", but could be any.

The users could then write their own scripts/tools that parse the markdown text and create content that would be then replaced at that location. So just extending the pre-processing feature by the capability of sending the whole document.

In my particular use case I could search for headings of maybe a given maximum level of 2 createtoc -l2, I can parse the lines starting with hashes and so on and create my own Table of Content.

I don't know what other ideas the users will have, but I'm very curious to find out.

We could go one little step further and allow creating the slide separators ( the 3 dashes), so that the inserted text can potentially create more slides. I don't know if you do the processing per slide or before starting the presentation. So this might be affected.

If you think this is not a good idea, no problem, simply close this ticket. I'm happy either way, with or without this feature, cause slides is awesome. Thank you very much. Have great day.

marco

index out of range [0] with length 0

Describe the bug
When I try execute command as bellow, then occurs panic.

MacbookPro13% echo "# hello" | slides
Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack(0x5b, 0x0, 0x0)
        /Users/skanehira/.goenv/versions/1.16.0/src/runtime/debug/stack.go:24 +0x88
runtime/debug.PrintStack()
        /Users/skanehira/.goenv/versions/1.16.0/src/runtime/debug/stack.go:16 +0x20
github.com/charmbracelet/bubbletea.(*Program).Start.func2(0x14000794120)
        /Users/skanehira/dev/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:447 +0xb4
panic(0x1014959a0, 0x14000248b88)
        /Users/skanehira/.goenv/versions/1.16.0/src/runtime/panic.go:965 +0x14c
github.com/maaslalani/slides/internal/model.Model.View(0x140002dda20, 0x0, 0x0, 0x0, 0x140001fae40, 0x9, 0x140001faeb0, 0xa, 0x140005564a0, 0x0, ...)
        /Users/skanehira/dev/go/pkg/mod/github.com/maaslalani/[email protected]/internal/model/model.go:138 +0x410
github.com/charmbracelet/bubbletea.(*Program).Start(0x14000794120, 0x0, 0x0)
        /Users/skanehira/dev/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:491 +0x274
github.com/maaslalani/slides/cmd.glob..func1(0x10179a5c0, 0x1017e1490, 0x0, 0x0, 0x0, 0x0)
        /Users/skanehira/dev/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:44 +0x16c
github.com/spf13/cobra.(*Command).execute(0x10179a5c0, 0x1400011a1f0, 0x0, 0x0, 0x10179a5c0, 0x1400011a1f0)
        /Users/skanehira/dev/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x320
github.com/spf13/cobra.(*Command).ExecuteC(0x10179a5c0, 0x200000003, 0x14000000180, 0x14000000180)
        /Users/skanehira/dev/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x258
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/skanehira/dev/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/maaslalani/slides/cmd.Execute()
        /Users/skanehira/dev/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:50 +0x30
main.main()
        /Users/skanehira/dev/go/pkg/mod/github.com/maaslalani/[email protected]/main.go:8 +0x20
MacbookPro13%

To Reproduce

  1. echo "# hello" | slides

Expected behavior
Can execute slides

Screenshots
Refer Describe section

Additional context

Two column layout

Thank you for this great program!

When bullet points are short but many, it makes sense to not display one long list, but two next to each other. If images will be implemented, showing images next to text might be very appealing.

Maybe this could this be done via theming. Not sure whether images shown in terminals allow text next to it.

[feature]Code execution with Node.

Is your feature request related to a problem? Please describe.
As Python, Ruby is supported, why not Node for javascript?

Describe the solution you'd like
For those frontend developers, probably they do not set the python or ruby environment, but Node.js is definitely set!
So, why not Node.js?
And also, javascript is an easy script program, for demo, you know.

Describe alternatives you've considered
Nothing.

Additional context
Let's say:

### Node

``javascript
console.log('hello');
``

Date metadata seems to print binary representation of number

Describe the bug
The date is not well rendering and it seems that the output is in fact the binary representation of the number or something related.

To Reproduce
Steps to reproduce the behavior:

  1. Fill metadata in your markdown:
--- 
author: toto
date: October 3, 2021
paging: Page %d / %d
--- 
  1. Launch your slide

Expected behavior
The date will appears as: October 10, 10110

Desktop (please complete the following information):

  • OS: Linux kali 5.4.0-kali3-amd64

"slides: command not found"

Describe the bug
I can't use the CLI command, my system can't find it.

To Reproduce
Steps to reproduce the behavior:

  1. Install or upgrade Go on a Mac using homebrew.
  2. go get github.com/maaslalani/slides
  3. make a basic .md file.
  4. slides basic.md

Expected behavior
I expected the presentation to launch.

Desktop (please complete the following information):

  • OS: MacOS
  • Version: 11.2.3

Additional context
I'm using go version go1.16.4 darwin/amd64

Lua support for code block execution

I think the title is pretty self-explanatory.
slides has this wonderful feature of being able to execute code by pressing Ctrl-e (and syntax highlighting).
And I tried it with Lua and I got the message "unsupported language" and so I thought I could ask if adding Lua support would be possible.
Thank you very much for considering it.
all the best to you

marco

feature request: less metadata on the bottom

Is your feature request related to a problem? Please describe.
I would like to have less text shown on the slides in a presentation: I don't need my name on every slide, and the people watching the presentation are (hopefully) aware of today's date.

Describe the solution you'd like
Ideally I would like to have the option to pass a --no-author, --no-date, or --no-page flag on startup.

Describe alternatives you've considered
Adding additional support in the metadata portion would suffice. This approach would keep the CLI invocation clean at the cost of coupling the preferences of a presentation with the presentation itself.

Additional context
I don't plan on needing these features for another month. If you have an appetite for the feature, I'd be happy to make the change myself

Template slides

Add some useful slide templates like:

  • Thank you for listening slide
  • Title slide
  • etc...

Accept `slides.md` from stdin

This would open up a lot of flexibility to load slides in from.

For example:

  • Regular slide loading
slides < presentation.md
  • Input from another program
cat slides/*.md | slides
  • Slides directly from the internet
curl https://example.com/file.md | slides

Better strategy to parse metadata

Is your feature request related to a problem? Please describe.

We have this TODO:

// FIXME: This only works because we currently only have one option (theme),

Describe the solution you'd like

And I think that using *string instead of string would help us differentiate something not set in the header from things set to an empty string.

I added new, better examples below, so collapsed this block ; )

package main

import (
	"encoding/json"
	"fmt"
)

type Meta struct {
	Theme *string `json:"theme"`
}

var meta Meta

func printTheme(t Meta) {
	if meta.Theme == nil {
		fmt.Println("Theme not set")
	} else {
		fmt.Printf("Theme is %s", *meta.Theme)
	}
}

func main() {
	json.Unmarshal([]byte("{}"), &meta)
	printTheme(meta)

	json.Unmarshal([]byte(`{"theme": "dark"}`), &meta)
	printTheme(meta)
}

This outputs:

Theme not set
Theme is dark

Slides Feature Tutorial

If a user runs slides (without options) we should probably open up a slide show that teaches people how to use slides and all the additional features (like a very simplified vimtutor)

hiding slides in presentation mode and toggle visibility

if not already present as feature, what do you think of a hiding/skipping possibility?

let's say there are slides you don't want to show for whatever reason

  • topic adaptation due to different audience
  • adaptation to shorter presentation times
  • slide not fully ready
---
hide: true
... content here ...
---

hide: false is also possible and of course the default, as I don't want to provide that for all slides.
or instead of this extra command. Maybe simply doing some trickery with the dashes. For example if the 3 dashes are 4 or 2 dashes then the slide gets hidden. Or maybe ---h for hiding a slide. Whatever feels good to you as a solution.

And maybe a keybinding to toggle visibility of all hidden slides during presentation, which is why I didn't went with commenting out the slides, because this wouldn't be possible then, and also if you are right before a presentation and you have only few minutes left, and you want to hide some slides then the proposed ways are better.

does this sound useful?

Current slide and total slides numbers are incorrect

Describe the bug
Right conner with slides number and total provides incorrect information.

To Reproduce

  1. Open the presentation from the examples directory
  2. Check the status bar

Actual result
"Slides 0 / 3" is shown.

Expected behavior
"Slides 1 / 4" is shown

slides crash due to index out of range

Describe the bug

input md file:

# example complicate cargo workspace hierarchy.

## [link1](https://i.imgur.com/npGGJBQ.png)

## [link2](https://learning-rust.github.io/docs/a4.cargo,crates_and_basic_project_structure.html)

To Reproduce
Steps to reproduce the behavior:

  1. create a md file with the above content.
  2. run slides foo.md
  3. See the crash.

Expected behavior
the program shouldn't crash.

Desktop (please complete the following information):

  • OS: [e.g. iOS] macOS 11.4
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22] slides 0.40

Additional context
Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack(0x5b, 0x0, 0x0)
runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
runtime/debug/stack.go:16 +0x25
github.com/charmbracelet/bubbletea.(*Program).Start.func2(0xc0004fc120)
github.com/charmbracelet/[email protected]/tea.go:447 +0xd6
panic(0x15e1700, 0xc000016d38)
runtime/panic.go:965 +0x1b9
github.com/maaslalani/slides/internal/model.Model.View(0xc00034f290, 0x0, 0x0, 0x0, 0xc0000162a0, 0x11, 0xc0006d0a16, 0xa, 0xc00030a0e0, 0x7ffeefbfbdb7, ...)
github.com/maaslalani/slides/internal/model/model.go:138 +0x51e
github.com/charmbracelet/bubbletea.(*Program).Start(0xc0004fc120, 0x0, 0x0)
github.com/charmbracelet/[email protected]/tea.go:491 +0x331
github.com/maaslalani/slides/cmd.glob..func1(0x1d6f640, 0xc00034f100, 0x1, 0x1, 0x0, 0x0)
github.com/maaslalani/slides/cmd/root.go:44 +0x209
github.com/spf13/cobra.(*Command).execute(0x1d6f640, 0xc0001ac010, 0x1, 0x1, 0x1d6f640, 0xc0001ac010)
github.com/spf13/[email protected]/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0x1d6f640, 0xc000000180, 0x200000003, 0xc000000180)
github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:897
github.com/maaslalani/slides/cmd.Execute()
github.com/maaslalani/slides/cmd/root.go:50 +0x31
main.main()
github.com/maaslalani/slides/main.go:8 +0x25

Rust support

Quite straight forward. I think that adding Inline rust execution would be amazing and should not be too difficult.

Markdown block in example is rendered incorrectly

Describe the bug
The markdown block at the end of examples/slides.md should be on one slide. Instead it is split at the --- inside the block.

To Reproduce
Check out
Steps to reproduce the behavior:

  1. Clone this repository
  2. Run slides examples/slides.md inside of it
  3. Go to the end of the presentation
  4. On page 8 the second half of the code block is rendered as a new page

Additional context
If slides has a --version argument, I can't find it.

Vim-like navigation

Add key bindings to navigate around the presentation with additonal vim bindings:

  • G go to last slide
  • gg go to first slide

Next slide by timer

You know, pass optional timer or smth to switch slides automatically (PowerPoint has it, I want it here too😄)

Light theme terminals not supported without specifying theme:"light"

Describe the bug

If the user's terminal is light theme, the current default fallback is hard to read.

To Reproduce

  1. Open a slideshow without specifying theme:"light"

The fix

Detect the user's terminal mode if it's dark or light and if it's light, change the default to not use glamours light ansii style config.

Automatic new page after code-block

Describe the bug
After inserting a code-block it is not possible to add more text. A code-block adds automatically a new page (---). If you add --- after a code-block this will add an empty page.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file with the example from the Readme: https://github.com/maaslalani/slides#readme
  2. Start the slide
  3. browse to the code-block
  4. See issue

Example from screenshot

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

---

## Execute code blocks
Press `ctrl+e` on a slide with a code block to execute it
Slides with display the output at the end of the slide.

~~~go
package main

import "fmt"

func main() {
  fmt.Println("Hello, world!")
}
~~~

Text after Code-Block

---

## Bash

~~~bash
ls -al
~~~
---

Expected behavior
A code-block will not automatically add a new page

Screenshots
image

image

Desktop (please complete the following information):
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Software version
snap-id: iVzf6DoBLkUj1lmBkm6cKA545qHx42nK
tracking: latest/stable
refresh-date: today at 10:12 CEST
channels:
latest/stable: 0.3.0 2021-06-24 (11) 6MB -
latest/candidate: ↑
latest/beta: ↑
latest/edge: 0.3.0 2021-06-24 (11) 6MB -
installed: 0.3.0 (11) 6MB -

preprocessing slides using figlet and boxes does not work

Not sure if it's a bug or if I'm doing something wrong.

Describe the bug
The slides README shows an example of pre-processing slides with graph-easy. According to the description the text is send to the given command as stdin and then replaced in the slide. For figlet and boxes I was not able to get this to work. I don't know if there are more tools where it doesn't work.

To Reproduce
create a slide with the following code block

~~~figlet
foobar
~~~

or use boxes instead of figlet.

Expected behavior
I would expect that the text gets replaced with the figlet or boxes output,
like this ...
image

but the text stays as it is ... (left side the slide in presentation mode)
figlet fail

Desktop (please complete the following information):

  • OS: macOS 10.14

Live reload

Is your feature request related to a problem? Please describe.
During the preparation of the presentation, I need to restart the program many times.

Describe the solution you'd like
Live reload helps to keep one terminal on a separate monitor running the presentation (and refresh it automatically), while editing the Markdown file on another monitor.

Slides doesn't support scrolling large markdown files

Describe the bug
When a large markdown file is opened in slides, it just jumps to the last line.

To Reproduce
Steps to reproduce the behavior:

  1. Install latest slides
  2. Open a markdown file larger than ROWS

Expected behavior
slides should support scroll

Screenshots
No need easily reproducible

Custom themes aren't loaded

Describe the bug
Setting

---
theme: ./theme.json
---

results in the theme not being loaded and instead the default theme is used.

To Reproduce
Steps to reproduce the behavior:

  1. Create presentation.md with the following content
---
theme: ./theme.json
---

# Heading 1
## Heading 2
  1. wget https://github.com/maaslalani/slides/raw/main/styles/theme.json
  2. Change the h1.prefix to >>
  3. Run slides presentation.md and see that the modified theme isn't loaded

Expected behavior
The specified theme file should be loaded

Additional context
Looks like the code doesn't handle this case? I feel like this function is missing any logic to handle a custom theme file?

Option to customize name in the footer

Is your feature request related to a problem?

Not a problem, just a new use case. Usually I don't use my (full) name in presentations, I tend to use my social network user handle instead — in my case, @cuducos instead of Eduardo Cuducos.

Describe the solution you'd like

I can open a PR to add a flag to overwrite the user name when used, e.g.:

# slides exmaple.md --name "@cuducos"

This would use @cuducos in the “footer” instead of the full name of the logged user. This logic can be wrapped in cmd/root.cmd using Cobra.

Describe alternatives you've considered

Maybe we could use another naming, such as --footer — what do you think?

Support Inline HTML

Since Markdown doesn't support color, you go with inline HTML as an alternative. I've tried to write inline HTML in the slide file as the below snapshot.

code

but the output shows the text with no color. Please see the output in the below snapshot.

output

Code block without trailing new line can't be executed

Describe the bug

Code block without trailing new line can't be executed.
When I click CTRL + e, I see the error Error: could not parse code block.

To Reproduce

Add a code block to the end of the last slide without adding a trailing new line.

Expected behavior

Since Markdown doesn't have a problem to parse this kind of code block, I would expect the code block to be runnable.

Allow specifying custom themes from any source

Themes are not all that dangerous to load in, they are simply JSON files with some configuration to change how presentations look, we should allow users to specify custom themes with https:// and load those from the internet.

I.e.

---
theme: https://github.com/maaslalani/slides/raw/main/styles/theme.json
---

# Slides

Content

This way the user doesn't need to transport their theme along with their slides and can even curl their slides already so they don't need to keep any files on disk to present.

Support Images

Some terminals support image viewing like ITerm2 and Kitty. We could support viewing images in slides. If a terminal doesn't support images we could fallback to converting the image to ASCII and displaying that.

Number lists don't respect starting number

Describe the bug
First number in numbered lists isn't respected and always defaults to 1.

To Reproduce
Steps to reproduce the behavior:
The following markdown block will print a numbered list on slide two beginning with the number 1

# number values in list ignored
1. one
2. two
4. four (`3.` is expected with most/all markdown processors)

---
# A Continuation
5. five
6. six

Expected behavior
The second slide's number list in slides should match the word beside it

Screenshots
image
image

This may be a problem with goldmark, but they swear they're complaint with commonmark, and commonmark's reference implementation respects it

Executable Code Blocks

It would be neat to have live code demos where someone can write a markdown code block and execute it on the slide (by hitting a shortcut) and we can display the result and how long it took to execute.

Is there a wrap around terminal feature?

Problem:
Since my markdown file has LONG lines, a word wrap would enable me see lines. I see lines going out of screen now.

Solution : Possible Word wrap around 80 characters or width of terminal

May be this feature is already present and I could not figure it out, if so, Let me know! :)

`---` at the beginning/end causes a crash

Describe the bug
--- at the beginning causes a crash. Overall, low prio bug.

To Reproduce
Steps to reproduce the behavior:
1.

---

# second slide
---
  1. slides slides.md
  2. Crash

Expected behavior
One empty slide

Logs
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x151c7c5]

goroutine 1 [running]:
github.com/maaslalani/slides/internal/model.(*Model).Load(0xc00089fc18, 0x1355c71, 0x1d86440)
github.com/maaslalani/slides/internal/model/model.go:83 +0x165
github.com/maaslalani/slides/cmd.glob..func1(0x1d6f640, 0xc00042baf0, 0x1, 0x1, 0x0, 0x0)
github.com/maaslalani/slides/cmd/root.go:38 +0x125
github.com/spf13/cobra.(*Command).execute(0x1d6f640, 0xc0000be010, 0x1, 0x1, 0x1d6f640, 0xc0000be010)
github.com/spf13/[email protected]/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0x1d6f640, 0xc000000180, 0x200000003, 0xc000000180)
github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:897
github.com/maaslalani/slides/cmd.Execute()
github.com/maaslalani/slides/cmd/root.go:50 +0x31
main.main()
github.com/maaslalani/slides/main.go:8 +0x25

Example markdown slide render issue around `~~~`

Describe the bug
When testing with the example markdown slide provided in readme, there is a render issue with the box art slide.

To Reproduce
run slides file.md where file.md contains the example markdown slide.

Expected behavior
Should render correctly

Screenshots

Desktop (please complete the following information):

  • OS: [Linux]
  • Version [Latest github on commit 982bc2725a50307d0adc2b215b986154368e028a]

Side note

The readme still have j moving to previous and k moving to next.

Generic pre-processing of Slides

Add generic preprocessing of slides that allows an arbitrary command to be run to transform text into output.

This will allow slides to:

  • Process images -> ASCII
  • GraphViz + GraphEasy support
  • PlantUML Diagrams
  • Math support?
  • Generic text -> output

Considerations:

  • Live edit support
  • Security (We should sandbox the execution)

Go Vet: JoinVertical already declared through dot-import of package lipgloss

Describe the bug

I went ahead and made an AUR package for this (I'll set some notifications up so that I can maintain the package as you release new versions).

I know you don't have any tests yet--but I wasn't able to include go test in the package build because of a vet issue:

vet: styles/styles.go:31:6: JoinVertical already declared through dot-import of package lipgloss ("github.com/charmbracelet/lipgloss")

Probably not super high on your priority list--but thought I'd bring it to your attention.

Thanks for the cool tool!

To Reproduce

~/Projects/slides main
❯ go test ./...
# github.com/maaslalani/slides/styles
vet: styles/styles.go:22:6: JoinHorizontal already declared through dot-import of package lipgloss ("github.com/charmbracelet/lipgloss")
?   	github.com/maaslalani/slides	[no test files]
?   	github.com/maaslalani/slides/cmd	[no test files]
?   	github.com/maaslalani/slides/internal/model	[no test files]

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version: main

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.