Giter VIP home page Giter VIP logo

present's Introduction

present

Documentation Status image image image Run on Repl.it

A terminal-based presentation tool with colors and effects.

You can also play a codio (pre-recorded code block) on a slide.

present is built on asciimatics, and it works with Python>=3.7.

Check out the gallery to see what everyone is making with present! You can add your slides by simply opening an issue.

Installation

You can simply use pip to install present:

$ pip install present

Usage

$ present sample.md

Some controls:

  • Quit: q
  • Previous slide: b, Left arrow, Page Up
  • Next slide: n, Space bar, Right arrow, Page Down

At the end, you can press r to restart the presentation.

Syntax

Slides follow Markdown syntax. You can check out the sample slides for reference.

Note: Some things aren't supported yet:

  • Effects and colors on the same slide.
  • Effects and code on the same slide.

Separator

Each slide can be separated with a ---.

Slide 1

---

Slide 2

Headers

Level 1 headings become figlets, level 2 headings get underlined with -, and level 3 headings become bold.

# Heading 1

## Heading 2

### Heading 3

Text

This is normal text

This is **bold text**

This is `inline code`

This is a [link](www.google.com)

As Kanye West said:

> We're living the future so
> the present is our past.

Lists

Ordered lists become unordered lists automatically.

- Item 1
    - Item 1a
    - Item 1b
    - Item 1c
- Item 2
    - Item 2a

Images

Image paths are relative to the directory where your slides are kept, and where you invoke present.

![RC](images/recurse.png)

Note: You can use high resolution images and tweak the terminal font size to get the best results.

Code blocks

```
import os

os.getcwd()
```

Codios

Codios are pre-recorded playable code blocks which can be useful for live demos. You can find out how to write one in the codio section of the documentation.

![codio](codio.yml)

Style

Each slide can be styled with foreground / background colors and effects. By default, slides are black on white with no effects. You can add style to a slide by adding a comment at the beginning of the slide (after the slide separator):

Slide 1

---
<!-- fg=black bg=yellow -->

Slide 2

---
<!-- effect=explosions -->

Slide 3

Colors: black, red, green, yellow, blue, magenta, cyan, white.

Effects: fireworks, explosions, stars, matrix, plasma. More coming soon!

Contributing

The Contributor's Guide has detailed information about contributing issues, documentation, code, and tests.

Versioning

present uses Semantic Versioning. For the available versions, see the tags on the GitHub repository.

License

This project is licensed under the Apache License, see the LICENSE file for details.

present's People

Contributors

amasad avatar clint-lawrence avatar farisachugthai avatar gitsquared avatar tmroyal avatar tymekdev avatar vinayak-mehta 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

present's Issues

Big mode!

This rocks!

I use big for all of my presentations. I'd love a big mode for this! I think you could do it with resizing figlet fonts.

Tries to use python3.7 when python3.8 is installed

I have python 3.8.5 installed on macOS Mojave, it looks like present is trying to use the python 3.7 interpreter even though it isn't present.

➜  python --version
Python 3.8.5
➜  pip3 install present
Collecting present
  Using cached present-0.5.0-py3-none-any.whl (15 kB)
Requirement already satisfied: pyfiglet>=0.8.post1 in /usr/local/lib/python3.8/site-packages (from present) (0.8.post1)
Requirement already satisfied: PyYAML>=5.3.1 in /usr/local/lib/python3.7/site-packages (from present) (5.3.1)
Requirement already satisfied: asciimatics>=1.11.0 in /usr/local/lib/python3.8/site-packages (from present) (1.11.0)
Requirement already satisfied: Click>=7.0 in /usr/local/lib/python3.7/site-packages (from present) (7.1.1)
Requirement already satisfied: mistune>=2.0.0a4 in /usr/local/lib/python3.8/site-packages (from present) (2.0.0a4)
Requirement already satisfied: future in /usr/local/lib/python3.7/site-packages (from asciimatics>=1.11.0->present) (0.18.2)
Requirement already satisfied: Pillow>=2.7.0 in /usr/local/lib/python3.7/site-packages (from asciimatics>=1.11.0->present) (7.0.0)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/site-packages (from asciimatics>=1.11.0->present) (0.1.8)
Installing collected packages: present
Successfully installed present-0.5.0
➜  present sample.md
zsh: /usr/local/bin/present: bad interpreter: /usr/local/opt/python/bin/python3.7: no such file or directory
➜  ls /usr/local/opt/python/bin | grep python3
python3
python3-config
python3.8
python3.8-config

Add a FAQ for images

Better resolution images and tweaking the terminal font size can be used to get the best image rendering results.

`asciinema` to `codeio` converter

Hi @vinayak-mehta ,

Thanks for this nice tool/experiment!

One of the parts that look like legitimate improvements over the state of the art is the codio part. It's quite nice once you have it, but it takes ages to put together.

I was therefore wondering what your thoughts would be on some sort of a conversion mechanism between asciinema's format (https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md), which seems to be kind of the standard for terminal recording. Or better yet, do you think it would be possible to read in and render the asciicast fileformat the same way the codeio file format is rendered?

Thanks again!

How to reduce empty space at top of slides?

Hi, I was using version 0.3. When I upgraded to the latest version 0.5.1, I would have to re-do my slides since there is a lot more empty space at the top, causing my slide contents at the bottom to no longer be visible. Is there a way I can reduce the amount of empty space at the top?

Don't raise an error for unsupported markdown elements

Emphasis, inline code, links, blockquotes, tables and strikethroughs are not supported right now. If present finds them in a slide, it fails, which is not ideal. It should instead print a warning and ignore the element. For some elements like inline code, it should just convert them to normal text (till they are unsupported).

Add support for transparent backgrounds

Although the available choices for background color are great, it does not appear there is a way to explicitly specify a transparent background--that is, the terminal's native background.

Windows Support

>present sample.md
Traceback (most recent call last):
  File "c:\python38\lib\runpy.py", line 194, in _run_module_as_main      
    return _run_code(code, main_globals, None,
  File "c:\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python38\Scripts\present.exe\__main__.py", line 4, in <module>
  File "c:\python38\lib\site-packages\present\cli.py", line 6, in <module>
    from .slideshow import Slideshow
  File "c:\python38\lib\site-packages\present\slideshow.py", line 8, in <module>
    from asciimatics.screen import Screen, _CursesScreen
ImportError: cannot import name '_CursesScreen' from 'asciimatics.screen' (c:\python38\lib\site-packages\asciimatics\screen.py)

_CursesScreen is only UNIX-compatible.
asciimatics also provides the use of _WindowsScreen class can be used instead for Windows-based systems.

Python's native curses doesn't directly support Windows.
We can use this port instead https://pypi.org/project/windows-curses/ for Windows-based systems.

This allows present to run on Windows!

Add speaker notes view

A speaker notes view with the notes for the current slide, along with the current and next slide views. Looks similar to bpython. Can be opened in a second terminal with the present-notes command (connects to the already running present server and is able to control slides on the first terminal).

Add support for double height/double width

VT-100 compatible terminals support line-based attributes double-height (DECDHL) and double-width (DECDWL). It'd be useful to support those for headers, perhaps with a command-line switch (since terminal support is spotty and doesn't work at all under tmux/screen).

On xterm:
xterm

With Apple's Terminal.App:
Apple Terminal.App

pip3 install present should install all dependencies

first issue - ModuleNotFoundError: No module named 'dataclasses'

$ pip3 install present 
$ present sample.md 
Traceback (most recent call last):
  File "/home/user/.local/bin/present", line 7, in <module>
    from present.cli import cli
  File "/home/user/.local/lib/python3.6/site-packages/present/cli.py", line 7, in <module>
    from .markdown import Markdown
  File "/home/user/.local/lib/python3.6/site-packages/present/markdown.py", line 6, in <module>
    from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

resolved, obviously with: pip3 install dataclasses, however shouldn't this be listed in the README as a dependency or automatically installed with requirements.txt or some such?

second issue - ValueError: (Slide 4) BlockQuote is not supported

$ present sample.md 
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/present/markdown.py", line 251, in parse
    Element = eval(element_name)
  File "<string>", line 1, in <module>
NameError: name 'BlockQuote' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/.local/bin/present", line 11, in <module>
    sys.exit(cli())
  File "/home/user/.local/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/.local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.local/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/present/cli.py", line 18, in cli
    slides = markdown.parse(f.read())
  File "/home/user/.local/lib/python3.6/site-packages/present/markdown.py", line 254, in parse
    f"(Slide {sliden + 1}) {element_name} is not supported"
ValueError: (Slide 4) BlockQuote is not supported

Error with code blocks

Thank you for this fun and interesting project.

I'm hitting an error when using inline code:

Hello `World`

leads to

Traceback (most recent call last):
  File "/home/clemisch/.local/lib/python3.6/site-packages/present/markdown.py", line 242, in parse
    Element = eval(element_name)
  File "<string>", line 1, in <module>
NameError: name 'Codespan' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/clemisch/.local/bin/present", line 8, in <module>
    sys.exit(cli())
  File "/home/clemisch/.local/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/clemisch/.local/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/clemisch/.local/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/clemisch/.local/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/clemisch/.local/lib/python3.6/site-packages/present/cli.py", line 18, in cli
    slides = markdown.parse(f.read())
  File "/home/clemisch/.local/lib/python3.6/site-packages/present/markdown.py", line 245, in parse
    f"(Slide {sliden + 1}) {element_name} is not supported"
ValueError: (Slide 1) Codespan is not supported

Add codio support

#20 implements this, opening this issue for some discussion.

Demo:

Peek 2020-08-22 06-15

Color:

Peek 2020-08-23 17-45

Progress bar:

codio

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.