present 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +41 -1
  2. data/lib/present.rb +1 -1
  3. data/lib/present/page.rb +10 -3
  4. metadata +1 -1
data/README CHANGED
@@ -6,7 +6,7 @@ Presentation tool for terminal.
6
6
  == Description
7
7
 
8
8
  This program is for terminal addicts.
9
- You can present your slide by using your favorite terminal.
9
+ You can make a presentation by using your favorite terminal.
10
10
 
11
11
  == Installation
12
12
 
@@ -21,6 +21,12 @@ You can present your slide by using your favorite terminal.
21
21
 
22
22
  == Features/Problems
23
23
 
24
+ - You can make a presentation by using your favorite terminal.
25
+ - You need to configure font size of terminal by yourself.
26
+ - You can't use pictures, yet.
27
+ Making pictures into ASCII art is a future work ;-)
28
+ - You must encode presentation files as EUC-JP if you want to use Japanese.
29
+ This limitation comes from ruby-ncurses.
24
30
 
25
31
  == Synopsis
26
32
 
@@ -34,6 +40,40 @@ You can present your slide by using your favorite terminal.
34
40
  `page` specifies the page number which will be started from. This is
35
41
  optional. The default value is 1.
36
42
 
43
+ == File Format
44
+
45
+ The presentation file is a text file which includes series of pages of which
46
+ you will present.
47
+
48
+ The pages are separated by blank lines. The page itself consists of lines.
49
+ Each line has a command at the beginning and text follows it. The command and
50
+ the text are separated by white spaces. The available commands are as follows.
51
+
52
+ = Title. The text follows will be rendered at the center of screen with larger
53
+ font.
54
+ - Explanation. The text will follow the previous text. The text is right
55
+ alignment.
56
+ * Header. The text will appear at the top of the page with bold style.
57
+ + Bullet. The text will follow the previous text with bullet mark at the
58
+ beginning. The text is left alignment. Bullets can be nested by doubling or
59
+ tripling the symbol.
60
+ You can avoid margin between the line and the previous line by appending `-`
61
+ symbol, like this `+-`.
62
+ < Left alignment text.
63
+ > Right aligment text.
64
+ % Color. You can change color of texts which appears after the line.
65
+ The color specified by the name of basic colors, such as red, blue, white,
66
+ black, and so on. If the text is `0`, the color is reset.
67
+ , Wait. Wait for your hitting keys if the text is `-`. Wait for specified
68
+ interval if the text is a number in sec
69
+ : Execute command. The text will be executed as a internal command.
70
+ # Message. The text will be displayed with large font in the middle.
71
+ . Final message.
72
+
73
+ The command can be empty, it means that the line starts with white spaces. The
74
+ texts of these lines are simply added to the texts of previous lines
75
+ respectively.
76
+
37
77
  == Copyright
38
78
 
39
79
  Author:: Genki Takiuchi <genki@s21g.com>
@@ -6,7 +6,7 @@ require 'nkf'
6
6
  require 'present/page'
7
7
 
8
8
  class Present
9
- VERSION = '0.0.3'
9
+ VERSION = '0.1.0'
10
10
  TIOCGWINSZ = 0x5413
11
11
 
12
12
  def initialize(path, timer = 5, page = 1)
@@ -15,11 +15,13 @@ class Present
15
15
  end
16
16
  @lines.each do |line|
17
17
  text, command = line.split(/\s+/, 2).reverse
18
- if command
18
+ if command.nil?
19
+ next
20
+ elsif command.empty?
21
+ stack.last[1] += "\n#{text}"
22
+ else
19
23
  execute_command.call
20
24
  stack.push [command, text]
21
- else
22
- stack.last[1] += "\n#{text}"
23
25
  end
24
26
  end
25
27
  execute_command.call
@@ -49,6 +51,11 @@ class Present
49
51
  @screen.color *text.split(/\s+/)
50
52
  when ','
51
53
  @screen.wait text.to_f
54
+ when ':'
55
+ command, *args = text.split(/\s+/)
56
+ @screen.send "do_#{command}", *args rescue nil
57
+ when '`'
58
+ # do nothing
52
59
  end
53
60
  end
54
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: present
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Takiuchi