Skip to content

Commit

Permalink
Add image and color-image types
Browse files Browse the repository at this point in the history
- Add some animations
  • Loading branch information
onelife committed Aug 22, 2021
1 parent 2e31de7 commit 49ac587
Show file tree
Hide file tree
Showing 10 changed files with 454 additions and 60 deletions.
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TermSlides
Script your slides in YAML file and show it in terminal.
Script your slides in YAML and show it in terminal.

## Install
`pip install termslides`
Expand All @@ -17,6 +17,7 @@ title: TermSlides Example
Diagram:
notes: This is an example
startAnimation: scroll
pageAnimation: stars
endAnimation: matrix
content:
- type: text
Expand All @@ -28,17 +29,18 @@ Diagram:
x: 2
```

At the top level, `title` is reserved keyword. Its value will be set as the title of currnt terminal window. The rest of key-value pairs are treated as slide name-content pairs.
At the top level, `title` is reserved keyword. Its value will be set as the title of current terminal window. The rest of key-value pairs are treated as slide name-content pairs.

The slide content is another key-value pairs. `content` is compulsory. The following are optional.
The slide content is another set of key-value pairs. `content` key is compulsory and the following are optional:
- `notes`: Notes for current slide which is shown in *slides list mode*.
- `duration`: The time in frames before switching to next slide. There are 20 frames per second.
- `duration`: The show time in frames before switching to next slide. The frame rate is 20 frames/second.
- `startAnimation`: Slide starting animation. `scroll` only.
- `endAnimation`: Slide ending animation. `scroll` or `matrix`.
- `star`: A whole screen effect. The value is number of stars.
- `snow`: A whole screen effect. Set value to `true` to enable.
- `endAnimation`: Slide ending animation. `scroll`, `matrix`, `shoot`, `drop` or `wipe`.
- `pageAnimation`: The animation between starting and ending. `stars`, `snow`, `explosion`, `fireworks` or `rain`.

The value of `content` is yet another key-value pairs. `type` and `content` are compulsory. Following are the available `type`s.
The value of `content` is yet another set of key-value pairs. `type` and `content` are common compulsory keys.

### Available `type`s:
- `text`: Text, the most common type.
- Other compulsory attributes:
- None
Expand Down Expand Up @@ -91,6 +93,22 @@ The value of `content` is yet another key-value pairs. `type` and `content` are
- `attr`: Same as `text`.
- `bg`: Same as `text`.

- `image`: Grey scale ascii text image
- Other compulsory attributes:
- None
- Optional attributes:
- `height`: Target image height
- `y`: Same as `text`.
- `x`: Same as `text`.

- `color-image`: Block color image
- Other compulsory attributes:
- None
- Optional attributes:
- `height`: Target image height
- `y`: Same as `text`.
- `x`: Same as `text`.

## Key Binding
- Slides List Mode
- <kbd>↓</kbd>: Next slide
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pyyaml
asciimatics
tabulate
plantuml
six
click
pyyaml == 5.*
asciimatics == 1.*
tabulate == 0.*
plantuml == 0.*
tqdm == 4.*
click == 7.*
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from setuptools import setup, find_packages
from os import path
from sys import platform
import termslides


Expand Down Expand Up @@ -39,6 +40,12 @@
'Topic :: Text Processing :: Markup',
],

package_data={
'termslides': [
'lib/*.jar',
],
},

entry_points={
'console_scripts': [
'termslides = termslides:termslides',
Expand Down
2 changes: 1 addition & 1 deletion termslides/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__author__ = 'onelife'
__license__ = "Apache-2.0"
__version__ = '1.02'
__version__ = '1.10'

__setup = False
__depth = 1
Expand Down
Loading

0 comments on commit 49ac587

Please sign in to comment.