mint 0.8.1 → 0.10.0

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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -26
  3. data/README.md +117 -37
  4. data/bin/mint +2 -81
  5. data/config/templates/base/navigation.css +136 -0
  6. data/config/templates/base/print.css +152 -0
  7. data/config/templates/{reset.css → base/reset.css} +1 -1
  8. data/config/templates/base/style.css +117 -137
  9. data/config/templates/base/utilities.css +136 -0
  10. data/config/templates/base/variables.css +124 -0
  11. data/config/templates/basic/style.css +151 -0
  12. data/config/templates/default/layout.erb +33 -3
  13. data/config/templates/default/style.css +95 -164
  14. data/config/templates/magazine/style.css +383 -0
  15. data/config/templates/nord/style.css +105 -220
  16. data/config/templates/nord-dark/style.css +82 -263
  17. data/lib/mint/commandline/parse.rb +144 -0
  18. data/lib/mint/commandline/publish.rb +46 -0
  19. data/lib/mint/commandline/run.rb +30 -0
  20. data/lib/mint/config.rb +162 -0
  21. data/lib/mint/{css.rb → css_dsl.rb} +9 -9
  22. data/lib/mint/css_parser.rb +45 -25
  23. data/lib/mint/document.rb +250 -365
  24. data/lib/mint/document_tree.rb +163 -0
  25. data/lib/mint/exceptions.rb +2 -3
  26. data/lib/mint/helpers.rb +23 -180
  27. data/lib/mint/layout.rb +26 -9
  28. data/lib/mint/renderers/css_renderer.rb +32 -0
  29. data/lib/mint/renderers/erb_renderer.rb +11 -0
  30. data/lib/mint/renderers/markdown_renderer.rb +45 -0
  31. data/lib/mint/style.rb +21 -31
  32. data/lib/mint/template.rb +30 -0
  33. data/lib/mint/version.rb +1 -1
  34. data/lib/mint/workspace.rb +171 -0
  35. data/lib/mint.rb +44 -12
  36. data/man/mint.1 +85 -44
  37. data/spec/cli/README.md +2 -2
  38. data/spec/cli/argument_parsing_spec.rb +89 -147
  39. data/spec/cli/bin_integration_spec.rb +23 -243
  40. data/spec/cli/full_workflow_integration_spec.rb +99 -442
  41. data/spec/cli/original_style_integration_spec.rb +58 -0
  42. data/spec/cli/publish_workflow_spec.rb +72 -70
  43. data/spec/commandline_path_integration_spec.rb +230 -0
  44. data/spec/config_file_integration_spec.rb +362 -0
  45. data/spec/{css_spec.rb → css_dsl_spec.rb} +7 -3
  46. data/spec/css_parser_spec.rb +59 -1
  47. data/spec/document_spec.rb +37 -242
  48. data/spec/flattened_path_spec.rb +150 -0
  49. data/spec/layout_spec.rb +42 -3
  50. data/spec/mint_spec.rb +22 -217
  51. data/spec/path_handling_spec.rb +237 -0
  52. data/spec/run_cli_tests.rb +1 -1
  53. data/spec/spec_helper.rb +3 -10
  54. data/spec/style_spec.rb +31 -56
  55. data/spec/support/cli_helpers.rb +7 -10
  56. data/spec/support/matchers.rb +1 -1
  57. data/spec/template_spec.rb +31 -0
  58. data/spec/workspace_spec.rb +177 -0
  59. metadata +75 -89
  60. data/bin/mint-epub +0 -20
  61. data/config/templates/garden/layout.erb +0 -38
  62. data/config/templates/garden/style.css +0 -303
  63. data/config/templates/nord/layout.erb +0 -11
  64. data/config/templates/nord-dark/layout.erb +0 -11
  65. data/config/templates/zen/layout.erb +0 -11
  66. data/config/templates/zen/style.css +0 -114
  67. data/lib/mint/command_line.rb +0 -360
  68. data/lib/mint/css_template.rb +0 -37
  69. data/lib/mint/markdown_template.rb +0 -47
  70. data/lib/mint/mint.rb +0 -313
  71. data/lib/mint/plugin.rb +0 -136
  72. data/lib/mint/plugins/epub.rb +0 -293
  73. data/lib/mint/resource.rb +0 -101
  74. data/plugins/templates/epub/layouts/container.haml +0 -5
  75. data/plugins/templates/epub/layouts/content.haml +0 -35
  76. data/plugins/templates/epub/layouts/layout.haml +0 -6
  77. data/plugins/templates/epub/layouts/title.haml +0 -11
  78. data/plugins/templates/epub/layouts/toc.haml +0 -26
  79. data/spec/cli/configuration_management_spec.rb +0 -363
  80. data/spec/cli/template_management_spec.rb +0 -300
  81. data/spec/helpers_spec.rb +0 -249
  82. data/spec/plugin_spec.rb +0 -449
  83. data/spec/resource_spec.rb +0 -135
@@ -7,7 +7,7 @@ RSpec::Matchers.define :be_path do |name|
7
7
  end
8
8
 
9
9
  RSpec::Matchers.define :be_in_template do |name|
10
- match {|file| file =~ /#{Mint::ROOT}.*#{name}/ }
10
+ match {|file| file =~ /#{Mint::PROJECT_ROOT}.*#{name}/ }
11
11
  end
12
12
 
13
13
  RSpec::Matchers.define :be_a_template do |name|
@@ -0,0 +1,31 @@
1
+ require "spec_helper"
2
+
3
+ describe Mint::Template do
4
+ describe ".valid?" do
5
+ it "determines if a directory is a valid template directory" do
6
+ Dir.mktmpdir do |tmpdir|
7
+ template_dir = Pathname.new(tmpdir) + "test_template"
8
+ template_dir.mkdir
9
+
10
+ # Empty directory should not be valid (returns empty array)
11
+ expect(Mint::Template.valid?(template_dir)).to be_empty
12
+
13
+ # Directory with stylesheet should be valid
14
+ (template_dir + "style.css").write("body { color: black; }")
15
+ expect(Mint::Template.valid?(template_dir)).to be_truthy
16
+ end
17
+ end
18
+ end
19
+
20
+ describe ".find_directory_by_name" do
21
+ it "returns template directory path by name" do
22
+ # This will return nil if template doesn't exist, which is expected
23
+ result = Mint::Template.find_directory_by_name("default")
24
+ if result
25
+ expect(result).to be_a(Pathname)
26
+ else
27
+ expect(result).to be_nil
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,177 @@
1
+ require "spec_helper"
2
+
3
+ module Mint
4
+ describe Workspace do
5
+ around(:each) do |example|
6
+ in_temp_dir do |dir|
7
+ File.write("test.md", "# Test")
8
+ @workspace = begin
9
+ config = Mint::Config.with_defaults(destination_directory: Pathname.new("output"))
10
+ Workspace.new([Pathname.new("test.md")], config)
11
+ end
12
+ example.run
13
+ end
14
+ end
15
+
16
+ describe "#update_path_basename" do
17
+ it "formats basic filename with new extension" do
18
+ result = @workspace.update_path_basename(Pathname.new("document.md"),
19
+ new_extension: "html", format_string: "%{name}.%{ext}")
20
+ expect(result).to eq(Pathname.new("document.html"))
21
+ end
22
+
23
+ it "uses custom format string" do
24
+ result = @workspace.update_path_basename(Pathname.new("document.md"),
25
+ new_extension: "html", format_string: "%{name}_output.%{ext}")
26
+ expect(result).to eq(Pathname.new("document_output.html"))
27
+ end
28
+
29
+ it "provides access to original extension" do
30
+ result = @workspace.update_path_basename(Pathname.new("document.md"),
31
+ new_extension: "html", format_string: "%{name}.%{original_ext}.%{ext}")
32
+ expect(result).to eq(Pathname.new("document.md.html"))
33
+ end
34
+
35
+ it "handles files without extension" do
36
+ result = @workspace.update_path_basename(Pathname.new("README"),
37
+ new_extension: "html", format_string: "%{name}.%{ext}")
38
+ expect(result).to eq(Pathname.new("README.html"))
39
+ end
40
+ end
41
+
42
+ describe "autodrop functionality" do
43
+ around(:each) do |example|
44
+ in_temp_dir do |dir|
45
+ @test_dir = dir
46
+ create_template_directory("default")
47
+ example.run
48
+ end
49
+ end
50
+
51
+ describe "#calculate_autodrop_levels" do
52
+ it "returns 0 for single file" do
53
+ File.write("readme.md", "# README")
54
+ workspace = Workspace.new([Pathname.new("readme.md")], Config.defaults)
55
+ expect(workspace.send(:calculate_autodrop_levels_for, [Pathname.new("readme.md")])).to eq(0)
56
+ end
57
+
58
+ it "calculates common prefix for multiple files" do
59
+ FileUtils.mkdir_p(["common/docs", "common/src"])
60
+ files = [
61
+ Pathname.new("common/docs/api.md"),
62
+ Pathname.new("common/docs/guide.md"),
63
+ Pathname.new("common/src/code.md")
64
+ ]
65
+ files.each {|file| File.write(file, "# Content") }
66
+ workspace = Workspace.new(files, Config.defaults)
67
+ expect(workspace.send(:calculate_autodrop_levels_for, files)).to eq(1)
68
+ end
69
+
70
+ it "handles deeply nested common paths" do
71
+ FileUtils.mkdir_p(["very/deeply/nested/dir1", "very/deeply/nested/dir2"])
72
+ files = [
73
+ Pathname.new("very/deeply/nested/dir1/file1.md"),
74
+ Pathname.new("very/deeply/nested/dir2/file2.md")
75
+ ]
76
+ files.each {|file| File.write(file, "# Content") }
77
+ workspace = Workspace.new(files, Config.defaults)
78
+ expect(workspace.send(:calculate_autodrop_levels_for, files)).to eq(3)
79
+ end
80
+
81
+ it "returns 0 when no common prefix exists" do
82
+ FileUtils.mkdir_p(["docs", "src"])
83
+ files = [
84
+ Pathname.new("docs/guide.md"),
85
+ Pathname.new("src/code.md")
86
+ ]
87
+ files.each {|file| File.write(file, "# Content") }
88
+ workspace = Workspace.new(files, Config.defaults)
89
+ expect(workspace.send(:calculate_autodrop_levels_for, files)).to eq(0)
90
+ end
91
+ end
92
+
93
+ describe "autodrop behavior in publishing" do
94
+ it "drops common levels from destination paths when autodrop is enabled" do
95
+ FileUtils.mkdir_p(["common/docs", "common/src", "output"])
96
+ create_markdown_path("common/docs/api.md", "# API Documentation")
97
+ create_markdown_path("common/docs/guide.md", "# User Guide")
98
+ create_markdown_path("common/src/code.md", "# Code Documentation")
99
+
100
+ files = [
101
+ Pathname.new("common/docs/api.md"),
102
+ Pathname.new("common/docs/guide.md"),
103
+ Pathname.new("common/src/code.md")
104
+ ]
105
+
106
+ config = Config.with_defaults(
107
+ destination_directory: Pathname.new("output"),
108
+ preserve_structure: true,
109
+ autodrop: true
110
+ )
111
+
112
+ workspace = Workspace.new(files, config)
113
+ workspace.publish!
114
+
115
+ # Files should be placed without the "common" prefix
116
+ expect(File.exist?("output/docs/api.html")).to be true
117
+ expect(File.exist?("output/docs/guide.html")).to be true
118
+ expect(File.exist?("output/src/code.html")).to be true
119
+
120
+ # Files should NOT be placed with the full path
121
+ expect(File.exist?("output/common/docs/api.html")).to be false
122
+ end
123
+
124
+ it "preserves full paths when autodrop is disabled" do
125
+ FileUtils.mkdir_p(["common/docs", "common/src", "output"])
126
+ create_markdown_path("common/docs/api.md", "# API Documentation")
127
+ create_markdown_path("common/src/code.md", "# Code Documentation")
128
+
129
+ files = [
130
+ Pathname.new("common/docs/api.md"),
131
+ Pathname.new("common/src/code.md")
132
+ ]
133
+
134
+ config = Config.with_defaults(
135
+ destination_directory: Pathname.new("output"),
136
+ preserve_structure: true,
137
+ autodrop: false
138
+ )
139
+
140
+ workspace = Workspace.new(files, config)
141
+ workspace.publish!
142
+
143
+ # Files should be placed with full path preserved
144
+ expect(File.exist?("output/common/docs/api.html")).to be true
145
+ expect(File.exist?("output/common/src/code.html")).to be true
146
+
147
+ # Files should NOT be placed without the common prefix
148
+ expect(File.exist?("output/docs/api.html")).to be false
149
+ end
150
+
151
+ it "doesn't affect paths when preserve_structure is false" do
152
+ FileUtils.mkdir_p(["common/docs", "output"])
153
+ create_markdown_path("common/docs/api.md", "# API Documentation")
154
+ create_markdown_path("common/docs/guide.md", "# User Guide")
155
+
156
+ files = [
157
+ Pathname.new("common/docs/api.md"),
158
+ Pathname.new("common/docs/guide.md")
159
+ ]
160
+
161
+ config = Config.with_defaults(
162
+ destination_directory: Pathname.new("output"),
163
+ preserve_structure: false,
164
+ autodrop: true
165
+ )
166
+
167
+ workspace = Workspace.new(files, config)
168
+ workspace.publish!
169
+
170
+ # Files should be placed directly in destination without structure
171
+ expect(File.exist?("output/api.html")).to be true
172
+ expect(File.exist?("output/guide.html")).to be true
173
+ end
174
+ end
175
+ end
176
+ end
177
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Jacobs
@@ -9,26 +9,6 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: tilt
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: '2.6'
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 2.6.1
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '2.6'
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 2.6.1
32
12
  - !ruby/object:Gem::Dependency
33
13
  name: redcarpet
34
14
  requirement: !ruby/object:Gem::Requirement
@@ -49,20 +29,6 @@ dependencies:
49
29
  - - ">="
50
30
  - !ruby/object:Gem::Version
51
31
  version: 3.6.1
52
- - !ruby/object:Gem::Dependency
53
- name: haml
54
- requirement: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - "~>"
57
- - !ruby/object:Gem::Version
58
- version: '6.3'
59
- type: :runtime
60
- prerelease: false
61
- version_requirements: !ruby/object:Gem::Requirement
62
- requirements:
63
- - - "~>"
64
- - !ruby/object:Gem::Version
65
- version: '6.3'
66
32
  - !ruby/object:Gem::Dependency
67
33
  name: sass-embedded
68
34
  requirement: !ruby/object:Gem::Requirement
@@ -84,19 +50,19 @@ dependencies:
84
50
  - !ruby/object:Gem::Version
85
51
  version: 1.89.2
86
52
  - !ruby/object:Gem::Dependency
87
- name: erubis
53
+ name: toml
88
54
  requirement: !ruby/object:Gem::Requirement
89
55
  requirements:
90
56
  - - "~>"
91
57
  - !ruby/object:Gem::Version
92
- version: '2.7'
58
+ version: '0.3'
93
59
  type: :runtime
94
60
  prerelease: false
95
61
  version_requirements: !ruby/object:Gem::Requirement
96
62
  requirements:
97
63
  - - "~>"
98
64
  - !ruby/object:Gem::Version
99
- version: '2.7'
65
+ version: '0.3'
100
66
  - !ruby/object:Gem::Dependency
101
67
  name: activesupport
102
68
  requirement: !ruby/object:Gem::Requirement
@@ -118,53 +84,73 @@ dependencies:
118
84
  - !ruby/object:Gem::Version
119
85
  version: 8.0.2.1
120
86
  - !ruby/object:Gem::Dependency
121
- name: nokogiri
87
+ name: byebug
122
88
  requirement: !ruby/object:Gem::Requirement
123
89
  requirements:
124
90
  - - "~>"
125
91
  - !ruby/object:Gem::Version
126
- version: 1.15.0
127
- type: :runtime
92
+ version: '11.1'
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 11.1.3
96
+ type: :development
128
97
  prerelease: false
129
98
  version_requirements: !ruby/object:Gem::Requirement
130
99
  requirements:
131
100
  - - "~>"
132
101
  - !ruby/object:Gem::Version
133
- version: 1.15.0
102
+ version: '11.1'
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: 11.1.3
134
106
  - !ruby/object:Gem::Dependency
135
- name: hashie
107
+ name: rspec
136
108
  requirement: !ruby/object:Gem::Requirement
137
109
  requirements:
138
110
  - - "~>"
139
111
  - !ruby/object:Gem::Version
140
- version: '5.0'
141
- type: :runtime
112
+ version: '3.13'
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: 3.13.1
116
+ type: :development
142
117
  prerelease: false
143
118
  version_requirements: !ruby/object:Gem::Requirement
144
119
  requirements:
145
120
  - - "~>"
146
121
  - !ruby/object:Gem::Version
147
- version: '5.0'
122
+ version: '3.13'
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: 3.13.1
148
126
  - !ruby/object:Gem::Dependency
149
- name: rubyzip
127
+ name: rspec-its
150
128
  requirement: !ruby/object:Gem::Requirement
151
129
  requirements:
152
130
  - - "~>"
153
131
  - !ruby/object:Gem::Version
154
- version: '3.0'
155
- - - ">="
156
- - !ruby/object:Gem::Version
157
- version: 3.0.1
158
- type: :runtime
132
+ version: '1.3'
133
+ type: :development
159
134
  prerelease: false
160
135
  version_requirements: !ruby/object:Gem::Requirement
161
136
  requirements:
162
137
  - - "~>"
163
138
  - !ruby/object:Gem::Version
164
- version: '3.0'
165
- - - ">="
139
+ version: '1.3'
140
+ - !ruby/object:Gem::Dependency
141
+ name: colorize
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '1.1'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
166
152
  - !ruby/object:Gem::Version
167
- version: 3.0.1
153
+ version: '1.1'
168
154
  description: Clean, simple library for maintaining and styling documents without a
169
155
  word processor. Mint aims to bring the best of the Web to desktop publishing, to
170
156
  be completely flexible, and to let the user decide what his workflow is like. A
@@ -172,7 +158,6 @@ description: Clean, simple library for maintaining and styling documents without
172
158
  email: david@wit.io
173
159
  executables:
174
160
  - mint
175
- - mint-epub
176
161
  extensions: []
177
162
  extra_rdoc_files: []
178
163
  files:
@@ -180,56 +165,53 @@ files:
180
165
  - LICENSE
181
166
  - README.md
182
167
  - bin/mint
183
- - bin/mint-epub
168
+ - config/templates/base/navigation.css
169
+ - config/templates/base/print.css
170
+ - config/templates/base/reset.css
184
171
  - config/templates/base/style.css
172
+ - config/templates/base/utilities.css
173
+ - config/templates/base/variables.css
174
+ - config/templates/basic/style.css
185
175
  - config/templates/default/layout.erb
186
176
  - config/templates/default/style.css
187
- - config/templates/garden/layout.erb
188
- - config/templates/garden/style.css
189
- - config/templates/nord-dark/layout.erb
177
+ - config/templates/magazine/style.css
190
178
  - config/templates/nord-dark/style.css
191
- - config/templates/nord/layout.erb
192
179
  - config/templates/nord/style.css
193
- - config/templates/reset.css
194
- - config/templates/zen/layout.erb
195
- - config/templates/zen/style.css
196
180
  - lib/mint.rb
197
- - lib/mint/command_line.rb
198
- - lib/mint/css.rb
181
+ - lib/mint/commandline/parse.rb
182
+ - lib/mint/commandline/publish.rb
183
+ - lib/mint/commandline/run.rb
184
+ - lib/mint/config.rb
185
+ - lib/mint/css_dsl.rb
199
186
  - lib/mint/css_parser.rb
200
- - lib/mint/css_template.rb
201
187
  - lib/mint/document.rb
188
+ - lib/mint/document_tree.rb
202
189
  - lib/mint/exceptions.rb
203
190
  - lib/mint/helpers.rb
204
191
  - lib/mint/layout.rb
205
- - lib/mint/markdown_template.rb
206
- - lib/mint/mint.rb
207
- - lib/mint/plugin.rb
208
- - lib/mint/plugins/epub.rb
209
- - lib/mint/resource.rb
192
+ - lib/mint/renderers/css_renderer.rb
193
+ - lib/mint/renderers/erb_renderer.rb
194
+ - lib/mint/renderers/markdown_renderer.rb
210
195
  - lib/mint/style.rb
196
+ - lib/mint/template.rb
211
197
  - lib/mint/version.rb
198
+ - lib/mint/workspace.rb
212
199
  - man/mint.1
213
- - plugins/templates/epub/layouts/container.haml
214
- - plugins/templates/epub/layouts/content.haml
215
- - plugins/templates/epub/layouts/layout.haml
216
- - plugins/templates/epub/layouts/title.haml
217
- - plugins/templates/epub/layouts/toc.haml
218
200
  - spec/cli/README.md
219
201
  - spec/cli/argument_parsing_spec.rb
220
202
  - spec/cli/bin_integration_spec.rb
221
- - spec/cli/configuration_management_spec.rb
222
203
  - spec/cli/full_workflow_integration_spec.rb
204
+ - spec/cli/original_style_integration_spec.rb
223
205
  - spec/cli/publish_workflow_spec.rb
224
- - spec/cli/template_management_spec.rb
206
+ - spec/commandline_path_integration_spec.rb
207
+ - spec/config_file_integration_spec.rb
208
+ - spec/css_dsl_spec.rb
225
209
  - spec/css_parser_spec.rb
226
- - spec/css_spec.rb
227
210
  - spec/document_spec.rb
228
- - spec/helpers_spec.rb
211
+ - spec/flattened_path_spec.rb
229
212
  - spec/layout_spec.rb
230
213
  - spec/mint_spec.rb
231
- - spec/plugin_spec.rb
232
- - spec/resource_spec.rb
214
+ - spec/path_handling_spec.rb
233
215
  - spec/run_cli_tests.rb
234
216
  - spec/spec_helper.rb
235
217
  - spec/style_spec.rb
@@ -240,6 +222,8 @@ files:
240
222
  - spec/support/fixtures/layout.haml
241
223
  - spec/support/fixtures/static.css
242
224
  - spec/support/matchers.rb
225
+ - spec/template_spec.rb
226
+ - spec/workspace_spec.rb
243
227
  homepage: https://github.com/davejacobs/mint
244
228
  licenses:
245
229
  - MIT
@@ -265,18 +249,18 @@ test_files:
265
249
  - spec/cli/README.md
266
250
  - spec/cli/argument_parsing_spec.rb
267
251
  - spec/cli/bin_integration_spec.rb
268
- - spec/cli/configuration_management_spec.rb
269
252
  - spec/cli/full_workflow_integration_spec.rb
253
+ - spec/cli/original_style_integration_spec.rb
270
254
  - spec/cli/publish_workflow_spec.rb
271
- - spec/cli/template_management_spec.rb
255
+ - spec/commandline_path_integration_spec.rb
256
+ - spec/config_file_integration_spec.rb
257
+ - spec/css_dsl_spec.rb
272
258
  - spec/css_parser_spec.rb
273
- - spec/css_spec.rb
274
259
  - spec/document_spec.rb
275
- - spec/helpers_spec.rb
260
+ - spec/flattened_path_spec.rb
276
261
  - spec/layout_spec.rb
277
262
  - spec/mint_spec.rb
278
- - spec/plugin_spec.rb
279
- - spec/resource_spec.rb
263
+ - spec/path_handling_spec.rb
280
264
  - spec/run_cli_tests.rb
281
265
  - spec/spec_helper.rb
282
266
  - spec/style_spec.rb
@@ -287,3 +271,5 @@ test_files:
287
271
  - spec/support/fixtures/layout.haml
288
272
  - spec/support/fixtures/static.css
289
273
  - spec/support/matchers.rb
274
+ - spec/template_spec.rb
275
+ - spec/workspace_spec.rb
data/bin/mint-epub DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # A script for publishing Mint in the ePub format
4
- # Usage: mint epub [command] [options] [files]
5
-
6
- $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
7
- require "mint"
8
- require "mint/plugins/epub"
9
-
10
- def usage
11
- abort "mint epub publish file"
12
- end
13
-
14
- case ARGV.shift.downcase.to_sym
15
- when :publish
16
- destination = ARGV.first.gsub(/\.[^.]*$/, "")
17
- opts = { destination: destination, style_destination: "OPS" }
18
- document = Mint::Document.new(ARGV.first, opts)
19
- document.publish! :plugins => [Mint::EPub]
20
- end
@@ -1,38 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title><%= (metadata.is_a?(Hash) && metadata['title']) || File.basename(source_file, '.*').tr('_-', ' ').split.map(&:capitalize).join(' ') %></title>
7
- <%= stylesheet_tag %>
8
- <style type="text/css"><%= inline_styles %></style>
9
- </head>
10
- <body>
11
- <div class="garden-container">
12
- <nav class="garden-nav">
13
- <div class="garden-nav-header">
14
- <h3>Garden</h3>
15
- </div>
16
- <div class="garden-nav-content">
17
- <% if files.any? %>
18
- <ul class="garden-toc">
19
- <% files.each do |file| %>
20
- <li class="depth-<%= file[:depth] %>">
21
- <a href="<%= file[:html_path] %>"
22
- class="<%= file[:source_path] == Pathname.new(source_file).relative_path_from(Pathname.new(root_directory)).to_s ? 'current' : '' %>">
23
- <%= file[:title] %>
24
- </a>
25
- </li>
26
- <% end %>
27
- </ul>
28
- <% end %>
29
- </div>
30
- </nav>
31
- <main class="garden-main">
32
- <div class="garden-content">
33
- <%= content %>
34
- </div>
35
- </main>
36
- </div>
37
- </body>
38
- </html>