md2key 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -30
- data/lib/md2key/converter.rb +14 -5
- data/lib/md2key/keynote.rb +11 -8
- 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: 5bf3372d25640ed9712e7448a44282d821a19ca4
|
4
|
+
data.tar.gz: 7c0def31d4368cb7ce5c4e937079fbc0b77869f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f008ec28023e80ab3911b591850422f8a8fe01ff966c13e95da32e641544c468ca24f99aa3aff7e4da93e266939f3aeb7ee2df02fc012dd6b745e507e6ffab5a
|
7
|
+
data.tar.gz: 406465a82cef73f131d84ef61030c143753d0cd653e0926f9ff7ba27777552df19e253bb2ee9d490f79fad5479dabf3e07b1b67273d2f57f95abd098dcea6863
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,37 +9,12 @@ Convert your markdown to keynote.
|
|
9
9
|
- 3. Create a second slide to choose a slide layout
|
10
10
|
- 4. Then execute `gem install md2key && md2key markdown.md`
|
11
11
|
|
12
|
-
### Example
|
13
|
-
|
14
12
|
![](https://i.gyazo.com/9d4d00164683f516d44b3e536b3dd3e9.gif)
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
```markdown
|
19
|
-
# The presentation
|
20
|
-
|
21
|
-
@k0kubun
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
# Hello world
|
26
|
-
|
27
|
-
- I'm takashi kokubun
|
28
|
-
- This is a pen
|
29
|
-
|
30
|
-
---
|
31
|
-
|
32
|
-
# How are you?
|
33
|
-
|
34
|
-
- I'm fine thank you
|
35
|
-
```
|
36
|
-
|
37
|
-
This is designed to be compatible with [Deckset](http://www.decksetapp.com/).
|
38
|
-
|
39
|
-
### No horizontal lines
|
14
|
+
### Basic example
|
40
15
|
|
41
|
-
|
42
|
-
|
16
|
+
The slides in the movie can be generated with following markdown.
|
17
|
+
You can separate slides with `---` just for readability.
|
43
18
|
|
44
19
|
```markdown
|
45
20
|
# The presentation
|
@@ -53,9 +28,9 @@ Headers always create a new slide.
|
|
53
28
|
- I'm fine thank you
|
54
29
|
```
|
55
30
|
|
56
|
-
###
|
31
|
+
### Insert image
|
57
32
|
|
58
|
-
|
33
|
+
<img src='https://i.gyazo.com/c9870e72ddf35a9dbd487fad4e6968bd.png' width='60%'>
|
59
34
|
|
60
35
|
```markdown
|
61
36
|
# image slide
|
data/lib/md2key/converter.rb
CHANGED
@@ -11,17 +11,26 @@ module Md2key
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def generate_keynote!
|
14
|
-
|
15
|
-
|
14
|
+
prepare_document_base
|
15
|
+
generate_contents
|
16
|
+
ensure
|
17
|
+
Keynote.delete_template_slide
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
16
21
|
|
22
|
+
def prepare_document_base
|
23
|
+
Keynote.activate
|
24
|
+
Keynote.ensure_template_slide_availability
|
17
25
|
Keynote.delete_extra_slides
|
18
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
def generate_contents
|
29
|
+
Keynote.update_cover(@markdown.cover.title, @markdown.cover.lines.join('\n'))
|
19
30
|
@markdown.slides.each_with_index do |slide, index|
|
20
31
|
Keynote.create_slide(slide.title, slide.lines.join('\n'))
|
21
32
|
Keynote.insert_image(slide.image) if slide.image
|
22
33
|
end
|
23
|
-
|
24
|
-
Keynote.delete_template_slide
|
25
34
|
end
|
26
35
|
end
|
27
36
|
end
|
data/lib/md2key/keynote.rb
CHANGED
@@ -24,14 +24,13 @@ module Md2key
|
|
24
24
|
APPLE
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
# will be used.
|
31
|
-
def show_template_slide
|
32
|
-
create_slide('', '') if slides_count < 2
|
27
|
+
def ensure_template_slide_availability
|
28
|
+
return if slides_count >= 2
|
29
|
+
|
33
30
|
tell_keynote(<<-APPLE.unindent)
|
34
|
-
|
31
|
+
tell document 1
|
32
|
+
make new slide
|
33
|
+
end
|
35
34
|
APPLE
|
36
35
|
end
|
37
36
|
|
@@ -62,8 +61,12 @@ module Md2key
|
|
62
61
|
def create_slide(title, content)
|
63
62
|
tell_keynote(<<-APPLE.unindent)
|
64
63
|
tell document 1
|
65
|
-
|
64
|
+
-- Workaround to select correct master slide. In spite of master slide can be selected by name,
|
65
|
+
-- name property is not limited to be unique.
|
66
|
+
-- So move the focus to second slide and force "make new slide" to use the exact master slide.
|
67
|
+
move slide #{TEMPLATE_SLIDE_INDEX} to before slide #{TEMPLATE_SLIDE_INDEX}
|
66
68
|
|
69
|
+
set newSlide to make new slide
|
67
70
|
tell newSlide
|
68
71
|
set object text of default title item to "#{title}"
|
69
72
|
set object text of default body item to "#{content}"
|
data/lib/md2key/version.rb
CHANGED