nora_mark 0.2beta16 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/dependabot.yml +8 -0
  4. data/.github/workflows/test.yml +19 -0
  5. data/.gitignore +1 -0
  6. data/.rubocop.yml +3 -0
  7. data/.travis.yml +2 -2
  8. data/CHANGELOG.md +5 -0
  9. data/Gemfile +0 -1
  10. data/README.md +1 -2
  11. data/Rakefile +1 -4
  12. data/lib/nora_mark/document.rb +14 -14
  13. data/lib/nora_mark/extensions.rb +6 -6
  14. data/lib/nora_mark/html/abstract_node_writer.rb +2 -1
  15. data/lib/nora_mark/html/context.rb +18 -16
  16. data/lib/nora_mark/html/default_transformer.rb +41 -38
  17. data/lib/nora_mark/html/frontmatter_writer.rb +2 -2
  18. data/lib/nora_mark/html/generator.rb +22 -22
  19. data/lib/nora_mark/html/pages.rb +13 -14
  20. data/lib/nora_mark/html/paragraph_writer.rb +24 -26
  21. data/lib/nora_mark/html/raw_text_block_writer.rb +13 -0
  22. data/lib/nora_mark/html/tag_writer.rb +14 -13
  23. data/lib/nora_mark/html/util.rb +5 -5
  24. data/lib/nora_mark/node.rb +46 -56
  25. data/lib/nora_mark/node_set.rb +1 -1
  26. data/lib/nora_mark/node_util.rb +7 -8
  27. data/lib/nora_mark/parser.kpeg.rb +16 -16
  28. data/lib/nora_mark/parser.rb +1 -3
  29. data/lib/nora_mark/rake_task.rb +23 -23
  30. data/lib/nora_mark/transformer.rb +13 -15
  31. data/lib/nora_mark/version.rb +1 -1
  32. data/lib/nora_mark.rb +0 -4
  33. data/lib/tilt/nora_mark.rb +1 -1
  34. data/nora_mark.gemspec +7 -6
  35. data/spec/extensions_spec.rb +1 -2
  36. data/spec/fixtures/test-plugins/nora_mark_tester.rb +3 -1
  37. data/spec/node_spec.rb +69 -49
  38. data/spec/nokogiri_test_helper.rb +9 -7
  39. data/spec/nora_mark_spec.rb +467 -491
  40. data/spec/spec_helper.rb +2 -6
  41. data/spec/tilt_spec.rb +1 -1
  42. data/spec/transformer_spec.rb +16 -18
  43. metadata +39 -29
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,4 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
-
4
- require 'byebug'
1
+ require 'debug'
5
2
 
6
3
  begin
7
4
  require 'rspec'
@@ -13,7 +10,7 @@ end
13
10
 
14
11
  RSpec.configure do |config|
15
12
  # Use color in STDOUT
16
- config.color_enabled = true
13
+ config.color = true
17
14
  # Use color not only in STDOUT but also in pagers and files
18
15
  config.tty = true
19
16
  # Use the specified formatter
@@ -30,7 +27,6 @@ RSpec.configure do |config|
30
27
  end
31
28
  result
32
29
  end
33
-
34
30
  end
35
31
 
36
32
  require 'rspec/core/formatters/base_text_formatter'
data/spec/tilt_spec.rb CHANGED
@@ -11,6 +11,6 @@ describe Tilt::NoraMarkTemplate do
11
11
  end
12
12
 
13
13
  it "should convert '.nora' files to HTML" do
14
- expect(subject.render).to eq (fixtures_dir + 'html/sample.html').read
14
+ expect(subject.render).to eq((fixtures_dir + 'html/sample.html').read)
15
15
  end
16
16
  end
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
+
2
3
  require File.dirname(__FILE__) + '/spec_helper.rb'
3
4
  require File.dirname(__FILE__) + '/../lib/nora_mark'
4
5
  require 'nokogiri'
@@ -36,9 +37,9 @@ EOF
36
37
  body = Nokogiri::XML::Document.parse(@parsed.html[0]).root.at_xpath('xmlns:body')
37
38
  expect(body.element_children[0].selector_and_children())
38
39
  .to eq(
39
- ['section', ['h1', 'section 1'],
40
- ['div.custom1', ['div.pgroup', ['p', 'text is here']]]]
41
- )
40
+ ['section', ['h1', 'section 1'],
41
+ ['div.custom1', ['div.pgroup', ['p', 'text is here']]]]
42
+ )
42
43
  end
43
44
  it 'can split page' do
44
45
  @parsed.add_transformer(generator: :html) do
@@ -73,16 +74,16 @@ EOF
73
74
  body = Nokogiri::XML::Document.parse(@parsed.html[0]).root.at_xpath('xmlns:body')
74
75
  expect(body.element_children[0].selector_and_children())
75
76
  .to eq(
76
- ['section', ['h1', 'section 1'],
77
- ['div.class-1', ['div.pgroup', ['p', 'text is here']]]]
78
- )
77
+ ['section', ['h1', 'section 1'],
78
+ ['div.class-1', ['div.pgroup', ['p', 'text is here']]]]
79
+ )
79
80
 
80
81
  body = Nokogiri::XML::Document.parse(@parsed.html[1]).root.at_xpath('xmlns:body')
81
82
  expect(body.element_children[0].selector_and_children())
82
83
  .to eq(
83
- ["section", ["h1", "section 2"],
84
- ["div.pgroup", ["p", "next text."]]]
85
- )
84
+ ["section", ["h1", "section 2"],
85
+ ["div.pgroup", ["p", "next text."]]]
86
+ )
86
87
  end
87
88
 
88
89
  it 'can add frontmatter' do
@@ -114,26 +115,23 @@ EOF
114
115
  @node.assign_pageno
115
116
  end
116
117
  end
117
-
118
118
  end
119
119
  end
120
120
  html = @parsed.html
121
121
  body1 = Nokogiri::XML::Document.parse(html[0]).root.at_xpath('xmlns:body')
122
122
  expect(body1.element_children[0].selector_and_children())
123
123
  .to eq(
124
- ['section', ['h1', 'section 1'],
125
- ['div.class-1', ['div.pgroup', ['p', 'text is here']]]]
126
- )
124
+ ['section', ['h1', 'section 1'],
125
+ ['div.class-1', ['div.pgroup', ['p', 'text is here']]]]
126
+ )
127
127
  head2 = Nokogiri::XML::Document.parse(html[1]).root.at_xpath('xmlns:head')
128
128
  expect(head2.element_children[1].a).to eq ["link[rel='stylesheet'][type='text/css'][href='new_stylesheet.css']", '']
129
129
 
130
130
  body2 = Nokogiri::XML::Document.parse(@parsed.html[1]).root.at_xpath('xmlns:body')
131
131
  expect(body2.element_children[0].selector_and_children())
132
132
  .to eq(
133
- ["section", ["h1", "section 2"],
134
- ["div.pgroup", ["p", "next text."]]]
135
- )
136
-
137
-
133
+ ["section", ["h1", "section 2"],
134
+ ["div.pgroup", ["p", "next text."]]]
135
+ )
138
136
  end
139
137
  end
metadata CHANGED
@@ -1,23 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nora_mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2beta16
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOJIMA Satoshi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2022-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kpeg
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: debug
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
33
  version: '0'
20
- type: :runtime
34
+ type: :development
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
@@ -42,14 +56,14 @@ dependencies:
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
61
  version: '2.14'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '2.14'
55
69
  - !ruby/object:Gem::Dependency
@@ -67,33 +81,25 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: byebug
84
+ name: nokogiri
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '0'
89
+ version: 1.13.6
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '2.0'
76
93
  type: :development
77
94
  prerelease: false
78
95
  version_requirements: !ruby/object:Gem::Requirement
79
96
  requirements:
80
97
  - - ">="
81
98
  - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: nokogiri
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 1.6.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
99
+ version: 1.13.6
100
+ - - "<"
95
101
  - !ruby/object:Gem::Version
96
- version: 1.6.0
102
+ version: '2.0'
97
103
  description: Simple and customizable text markup language for EPUB/XHTML
98
104
  email:
99
105
  - skoji@mac.com
@@ -102,7 +108,11 @@ executables:
102
108
  extensions: []
103
109
  extra_rdoc_files: []
104
110
  files:
111
+ - ".github/FUNDING.yml"
112
+ - ".github/dependabot.yml"
113
+ - ".github/workflows/test.yml"
105
114
  - ".gitignore"
115
+ - ".rubocop.yml"
106
116
  - ".travis.yml"
107
117
  - CHANGELOG.md
108
118
  - Gemfile
@@ -126,6 +136,7 @@ files:
126
136
  - lib/nora_mark/html/generator.rb
127
137
  - lib/nora_mark/html/pages.rb
128
138
  - lib/nora_mark/html/paragraph_writer.rb
139
+ - lib/nora_mark/html/raw_text_block_writer.rb
129
140
  - lib/nora_mark/html/tag_writer.rb
130
141
  - lib/nora_mark/html/util.rb
131
142
  - lib/nora_mark/node.rb
@@ -231,7 +242,7 @@ files:
231
242
  homepage: ''
232
243
  licenses: []
233
244
  metadata: {}
234
- post_install_message:
245
+ post_install_message:
235
246
  rdoc_options: []
236
247
  require_paths:
237
248
  - lib
@@ -239,16 +250,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
250
  requirements:
240
251
  - - ">="
241
252
  - !ruby/object:Gem::Version
242
- version: 2.0.0
253
+ version: 3.0.0
243
254
  required_rubygems_version: !ruby/object:Gem::Requirement
244
255
  requirements:
245
- - - ">"
256
+ - - ">="
246
257
  - !ruby/object:Gem::Version
247
- version: 1.3.1
258
+ version: '0'
248
259
  requirements: []
249
- rubyforge_project:
250
- rubygems_version: 2.2.0
251
- signing_key:
260
+ rubygems_version: 3.3.3
261
+ signing_key:
252
262
  specification_version: 4
253
263
  summary: Simple and customizable text markup language for EPUB/XHTML
254
264
  test_files: