md2key 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/md2key/converter.rb +0 -1
- data/lib/md2key/keynote.rb +8 -14
- data/lib/md2key/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd515b14ad74d002e0ae91bc868149359f04dc5b
|
4
|
+
data.tar.gz: c45239e78b4c18217d2b7214508f91f04016de7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 092762b159e56c5019b328119be0d1536bbbf525f8d95b7aa4567a916b6099728cf111820ab22e496b9612ab7414184bdc2dd58f898879f9a0aa5404918c0dd7
|
7
|
+
data.tar.gz: 879b241ded9e1b00a3e6aa985675ca7ed0416e57e3d7d182c8601bcca8509cc59f1d2a53451a7a07dae1fd23e94e2cc750b039f15cb19803a840d58489873708
|
data/CHANGELOG.md
CHANGED
data/lib/md2key/converter.rb
CHANGED
data/lib/md2key/keynote.rb
CHANGED
@@ -6,16 +6,10 @@ module Md2key
|
|
6
6
|
TEMPLATE_SLIDE_INDEX = 2
|
7
7
|
|
8
8
|
class << self
|
9
|
-
def activate
|
10
|
-
tell_keynote(<<-APPLE.unindent)
|
11
|
-
activate
|
12
|
-
APPLE
|
13
|
-
end
|
14
|
-
|
15
9
|
# You must provide a first slide as a cover slide.
|
16
10
|
def update_cover(title, sub)
|
17
11
|
tell_keynote(<<-APPLE.unindent)
|
18
|
-
tell document
|
12
|
+
tell the front document
|
19
13
|
tell slide #{COVER_SLIDE_INDEX}
|
20
14
|
set object text of default title item to "#{title}"
|
21
15
|
set object text of default body item to "#{sub}"
|
@@ -28,7 +22,7 @@ module Md2key
|
|
28
22
|
return if slides_count >= 2
|
29
23
|
|
30
24
|
tell_keynote(<<-APPLE.unindent)
|
31
|
-
tell document
|
25
|
+
tell the front document
|
32
26
|
make new slide
|
33
27
|
end
|
34
28
|
APPLE
|
@@ -37,12 +31,12 @@ module Md2key
|
|
37
31
|
# All slides after a second slide are unnecessary and deleted.
|
38
32
|
def delete_extra_slides
|
39
33
|
tell_keynote(<<-APPLE.unindent)
|
40
|
-
set theSlides to slides of document
|
34
|
+
set theSlides to slides of the front document
|
41
35
|
set n to #{slides_count}
|
42
36
|
|
43
37
|
repeat with theSlide in theSlides
|
44
38
|
if n > 2 then
|
45
|
-
delete slide n of document
|
39
|
+
delete slide n of the front document
|
46
40
|
end if
|
47
41
|
|
48
42
|
set n to n - 1
|
@@ -52,7 +46,7 @@ module Md2key
|
|
52
46
|
|
53
47
|
def delete_template_slide
|
54
48
|
tell_keynote(<<-APPLE.unindent)
|
55
|
-
tell document
|
49
|
+
tell the front document
|
56
50
|
delete slide #{TEMPLATE_SLIDE_INDEX}
|
57
51
|
end tell
|
58
52
|
APPLE
|
@@ -60,7 +54,7 @@ module Md2key
|
|
60
54
|
|
61
55
|
def create_slide(title, content)
|
62
56
|
tell_keynote(<<-APPLE.unindent)
|
63
|
-
tell document
|
57
|
+
tell the front document
|
64
58
|
-- Workaround to select correct master slide. In spite of master slide can be selected by name,
|
65
59
|
-- name property is not limited to be unique.
|
66
60
|
-- So move the focus to second slide and force "make new slide" to use the exact master slide.
|
@@ -78,7 +72,7 @@ module Md2key
|
|
78
72
|
# Insert image to the last slide
|
79
73
|
def insert_image(path)
|
80
74
|
tell_keynote(<<-APPLE.unindent)
|
81
|
-
tell document
|
75
|
+
tell the front document
|
82
76
|
set theSlide to slide #{slides_count}
|
83
77
|
set theImage to POSIX file "#{path}"
|
84
78
|
set docWidth to its width
|
@@ -104,7 +98,7 @@ module Md2key
|
|
104
98
|
def slides_count
|
105
99
|
tell_keynote(<<-APPLE.unindent).to_i
|
106
100
|
set n to 0
|
107
|
-
set theSlides to slides of document
|
101
|
+
set theSlides to slides of the front document
|
108
102
|
repeat with theSlide in theSlides
|
109
103
|
set n to n + 1
|
110
104
|
end repeat
|
data/lib/md2key/version.rb
CHANGED