textbringer-presentation 0.1.2 → 0.1.4

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
  SHA256:
3
- metadata.gz: c79839a7bba5c9edf03480908e01d39cf58f25c16682ad405a8b5bc7e6668f5c
4
- data.tar.gz: 5354a10987d944e84480c436d8aa9f736415f995fb5b0d44e02c3dd461e2ea04
3
+ metadata.gz: 41096a246e03179218e303f250ad12339d5852e416282c83b1eb34ae9198ee44
4
+ data.tar.gz: 93e09995e105e45d1f5f63d9c66ca7829659830733ee43953254dfb726120c55
5
5
  SHA512:
6
- metadata.gz: 9064b8dd688e91ba0d862fb7e42df1decf74d2c8fb8a8a5adcf2d3719eb3a1e97d500b46e3b7bef2aaac5f0d290569da8d39165928b966fbef9421d7022af148
7
- data.tar.gz: c9a4a947b982ab3b5b0006bba3708745905e5cf8b4a4ddc78b2266e7e95cd898b1d0d98b69526037d6f06fd53b01031a4eab7a59479c7a67bbf95db26d1b550a
6
+ metadata.gz: 520327450ae05a48456a5f39d2a83818c6f2d22e312e1aa85c33843f69e29a56c43e753dbfb324e10bdf93ef624a6bacbff90470cce131e8a7a7417ec047985f
7
+ data.tar.gz: 58ecb3a5611f94d2ee22d11ca3561b5f6cc1bc4fceb803b24e5d7d97f6d2a1b8d3a16c25056a7055a47518386351488ebfcb6ec53f73d86142514066265f371e
@@ -53,8 +53,9 @@ module Textbringer
53
53
  img = body.slice(img_re, 1)
54
54
  code_re = /^```([a-z]+)?\n(.*?)^```$/m
55
55
  lang, code = body.scan(code_re)[0]
56
- s = body.sub(img_re, "").sub(code_re, "").strip.
57
- gsub(/^/, left_margin)
56
+ s = body.sub(img_re, "").sub(code_re, "").
57
+ gsub(/\[(.*?)\]\(https?:.*?\)/, '\1').
58
+ strip.gsub(/^/, left_margin)
58
59
  @buffer.insert(s)
59
60
  beginning_of_buffer
60
61
  if img
@@ -117,7 +118,7 @@ module Textbringer
117
118
  img_size = "#{img_width}x#{img_height}"
118
119
  img_bg = @buffer[:presentation_image_background]
119
120
  options = CONFIG.fetch(:presentation_img2sixel_options, "")
120
- STDOUT.print(`convert -resize #{img_size} -gravity center -background '#{img_bg}' -extent #{img_size} '#{img}' - | img2sixel #{options}`)
121
+ STDOUT.print(`convert -resize #{img_size} -gravity center -background '#{img_bg}' -extent #{img_size} '#{img}' - | img2sixel #{options} 2> /dev/null`)
121
122
  STDOUT.flush
122
123
  end
123
124
 
@@ -24,17 +24,17 @@ module Textbringer
24
24
  class SlideList
25
25
  def initialize(buffer)
26
26
  @buffer = buffer
27
- doc = CommonMarker.render_doc(buffer.to_s)
27
+ doc = Commonmarker.parse(@buffer.to_s)
28
28
  @list = []
29
29
  slide = nil
30
30
  i = 1
31
31
  @buffer.save_excursion do
32
32
  doc.each do |node|
33
- if node.type == :header
34
- @buffer.goto_line(node.sourcepos[:start_line])
33
+ if node.type == :heading
34
+ @buffer.goto_line(node.source_position[:start_line])
35
35
  slide.end_pos = @buffer.point - 1 if slide
36
- title = node.to_plaintext.strip
37
- slide = Slide.new(buffer, i, title)
36
+ title = node.map { |c| c.string_content }.join.strip
37
+ slide = Slide.new(@buffer, i, title)
38
38
  slide.start_pos = @buffer.point
39
39
  @list.push(slide)
40
40
  i += 1
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Textbringer
4
4
  module Presentation
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
@@ -22,10 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_runtime_dependency "textbringer"
25
- spec.add_runtime_dependency "commonmarker"
25
+ spec.add_runtime_dependency "commonmarker", ">= 2.0.0"
26
26
 
27
- spec.add_development_dependency "bundler", "~> 1.14"
28
- spec.add_development_dependency "rake", "~> 12.0"
27
+ spec.add_development_dependency "bundler"
28
+ spec.add_development_dependency "rake", ">= 12.0"
29
29
  spec.add_development_dependency "test-unit"
30
30
  spec.add_development_dependency "simplecov"
31
31
  spec.add_development_dependency "codecov"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textbringer-presentation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shugo Maeda
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
10
+ date: 2024-12-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: textbringer
@@ -30,40 +29,40 @@ dependencies:
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '0'
32
+ version: 2.0.0
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: '0'
39
+ version: 2.0.0
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: bundler
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - "~>"
44
+ - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: '1.14'
46
+ version: '0'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - "~>"
51
+ - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: '1.14'
53
+ version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: rake
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
- - - "~>"
58
+ - - ">="
60
59
  - !ruby/object:Gem::Version
61
60
  version: '12.0'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
- - - "~>"
65
+ - - ">="
67
66
  - !ruby/object:Gem::Version
68
67
  version: '12.0'
69
68
  - !ruby/object:Gem::Dependency
@@ -189,7 +188,6 @@ homepage: https://github.com/shugo/textbringer
189
188
  licenses:
190
189
  - MIT
191
190
  metadata: {}
192
- post_install_message:
193
191
  rdoc_options: []
194
192
  require_paths:
195
193
  - lib
@@ -204,8 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
202
  - !ruby/object:Gem::Version
205
203
  version: '0'
206
204
  requirements: []
207
- rubygems_version: 3.1.0.pre1
208
- signing_key:
205
+ rubygems_version: 3.6.0.dev
209
206
  specification_version: 4
210
207
  summary: Presentation mode for Textbringer.
211
208
  test_files: []