md2key 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efa4d3efc0863de76d19919aac701aad63c74c46
4
- data.tar.gz: e815643322bd2208cd170327ec11960ef4909653
3
+ metadata.gz: a90dab5ae69737096db830c13aeed095a899cd73
4
+ data.tar.gz: 521966838c68de48467e6d556f46156ebeb11f65
5
5
  SHA512:
6
- metadata.gz: 07f933c45cf47dc98c57d1582872c368f8f99698a6dcc91e2829add256b2aaa54f07e023677ff0f8b14ead0bdfbddfd61f9acfa1221f9b2330c43932f8412b35
7
- data.tar.gz: bea355914ebb893f337a55f279d8f35c6baaf6eca3c5cc6ab1e2aeab447aee087a47622d22b26d73cc6f8b1fcc35ed3bcec2bcc4be202f08e5aacf991d1cc696
6
+ metadata.gz: cb9ad56eaf3c265b54d65e860593ec7f4884ee722fcc8504d0a0021ebd2ec81227772a072d832c06ea748dcb0668ac993fd501166347e4717fd433baf9f26d2c
7
+ data.tar.gz: 527cf4e72ece5bc34f7e4bd5eb3597022b74427cc4ccb16a6972e6a40539b80bd026729d412bfbef56d9ac101dba3e6274a6bf25100aee22769157d32465547f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.2
2
+
3
+ - Activate a template slide automatically
4
+
1
5
  # v0.2.1
2
6
 
3
7
  - Don't skip a nested list
@@ -7,6 +11,7 @@
7
11
 
8
12
  - Use redcarpet as markdown parser
9
13
  - Support list starting with `*`
14
+ - Regard `#`, `##` and `###` as the same
10
15
 
11
16
  # v0.1.2
12
17
 
data/README.md CHANGED
@@ -5,8 +5,8 @@ Convert your markdown to keynote.
5
5
  ## Usage
6
6
 
7
7
  - 1. Create a keynote document
8
- - 2. Create a first slide as master slide
9
- - 3. Create a second slide as template slide and activate it
8
+ - 2. Create a first slide as a cover slide
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
12
  ### Example
@@ -34,6 +34,25 @@ The slides in the movie are generated from following markdown.
34
34
  - I'm fine thank you
35
35
  ```
36
36
 
37
+ This is designed to be compatible with [Deckset](http://www.decksetapp.com/).
38
+
39
+ ### No horizontal lines
40
+
41
+ Currently md2key supports a short format that does not need `---`.
42
+ Headers always create a new slide.
43
+
44
+ ```markdown
45
+ # The presentation
46
+ @k0kubun
47
+
48
+ ## Hello world
49
+ - I'm takashi kokubun
50
+ - This is a pen
51
+
52
+ ## How are you?
53
+ - I'm fine thank you
54
+ ```
55
+
37
56
  ## License
38
57
 
39
58
  MIT License
@@ -12,11 +12,10 @@ module Md2key
12
12
 
13
13
  def generate_keynote!
14
14
  Keynote.activate
15
+ Keynote.show_template_slide # to select a layout of slide
16
+
17
+ Keynote.update_cover(@markdown.cover.title, @markdown.cover.lines.join('\n'))
15
18
  @markdown.slides.each_with_index do |slide, index|
16
- if index == 0
17
- Keynote.update_master(slide.title, slide.lines.join('\n'))
18
- next
19
- end
20
19
  Keynote.create_slide(slide.title, slide.lines.join('\n'))
21
20
  end
22
21
  Keynote.delete_template_slide
@@ -2,6 +2,9 @@ require 'unindent'
2
2
 
3
3
  module Md2key
4
4
  class Keynote
5
+ COVER_SLIDE_INDEX = 1
6
+ TEMPLATE_SLIDE_INDEX = 2
7
+
5
8
  class << self
6
9
  def activate
7
10
  tell_keynote(<<-APPLE.unindent)
@@ -9,11 +12,11 @@ module Md2key
9
12
  APPLE
10
13
  end
11
14
 
12
- # You must provide a first slide as a master slide.
13
- def update_master(title, sub)
15
+ # You must provide a first slide as a cover slide.
16
+ def update_cover(title, sub)
14
17
  tell_keynote(<<-APPLE.unindent)
15
18
  tell document 1
16
- tell slide 1
19
+ tell slide #{COVER_SLIDE_INDEX}
17
20
  set object text of default title item to "#{title}"
18
21
  set object text of default body item to "#{sub}"
19
22
  end tell
@@ -22,11 +25,19 @@ module Md2key
22
25
  end
23
26
 
24
27
  # You must provide a second slide as a template slide.
25
- # It will be deleted.
28
+ # This is just a workaround to select a layout of slides.
29
+ # If you tell `make new slide`, your current slide's theme
30
+ # will be used.
31
+ def show_template_slide
32
+ tell_keynote(<<-APPLE.unindent)
33
+ show slide #{TEMPLATE_SLIDE_INDEX}
34
+ APPLE
35
+ end
36
+
26
37
  def delete_template_slide
27
38
  tell_keynote(<<-APPLE.unindent)
28
39
  tell document 1
29
- delete slide 2
40
+ delete slide #{TEMPLATE_SLIDE_INDEX}
30
41
  end tell
31
42
  APPLE
32
43
  end
@@ -12,12 +12,20 @@ module Md2key
12
12
  @ast = Oga.parse_xml(xhtml)
13
13
  end
14
14
 
15
+ def cover
16
+ cached_slides.first
17
+ end
18
+
15
19
  def slides
16
- @slides ||= generate_slides
20
+ cached_slides[1..-1]
17
21
  end
18
22
 
19
23
  private
20
24
 
25
+ def cached_slides
26
+ @cached_slides ||= generate_slides
27
+ end
28
+
21
29
  def generate_slides
22
30
  slides = []
23
31
  slide = Slide.new
@@ -1,3 +1,3 @@
1
1
  module Md2key
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: md2key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun