middleman-asciidoc 1.0.0.rc.3 → 1.0.0.rc.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +8 -5
- data/README.adoc +2 -2
- data/features/asciidoc-blog.feature +122 -0
- data/features/{asciidoc.feature → asciidoc-pages.feature} +105 -91
- data/features/support/env.rb +2 -2
- data/fixtures/asciidoc-blog-app/config-asciidoc-layout.rb +9 -0
- data/fixtures/asciidoc-blog-app/config-date-in-filename.rb +9 -0
- data/fixtures/asciidoc-blog-app/config-published-only.rb +10 -0
- data/fixtures/asciidoc-blog-app/config.rb +9 -0
- data/fixtures/asciidoc-blog-app/source/blog-2/2017-09-01-a-fresh-start.adoc +5 -0
- data/fixtures/asciidoc-blog-app/source/blog/custom-layout.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/ignored.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/joint-effort.adoc +5 -0
- data/fixtures/asciidoc-blog-app/source/blog/more-tags.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/not-published.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/say-my-name.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/tags-tags-tags.adoc +6 -0
- data/fixtures/asciidoc-blog-app/source/blog/welcome.adoc +5 -0
- data/fixtures/asciidoc-blog-app/source/index.html.erb +5 -0
- data/fixtures/asciidoc-blog-app/source/layouts/article.erb +25 -0
- data/fixtures/asciidoc-blog-app/source/layouts/asciidoc_page.erb +9 -0
- data/fixtures/asciidoc-pages-app/config-default-layout.rb +2 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/config.rb +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/_include.adoc +0 -0
- data/fixtures/asciidoc-pages-app/source/backend.adoc +5 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/code.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/custom-attribute.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/custom-imagesdir.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/gallery.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/hello-with-extension.html.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/hello-with-front-matter.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/hello-with-mixed-page-data.adoc +0 -0
- data/fixtures/{asciidoc-app/source/hello-with-title.adoc → asciidoc-pages-app/source/hello-with-title-and-tags.adoc} +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/hello.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/ignored.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/images/tiger.gif +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/inspect-standard-page-data.html.erb +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/layouts/default.erb +0 -0
- data/fixtures/asciidoc-pages-app/source/layouts/inspect-page-data.erb +9 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/layouts/showdate.erb +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/link-to-page.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/manual/_chapters/ch01.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/manual/index.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/master.adoc +0 -0
- data/fixtures/asciidoc-pages-app/source/page-data.adoc +12 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/page-with-date-at-zone.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/page-with-date.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/safe-mode.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/site-information.adoc +0 -0
- data/fixtures/{asciidoc-app → asciidoc-pages-app}/source/standard-page-data.adoc +0 -0
- data/lib/middleman-asciidoc/extension.rb +2 -2
- data/lib/middleman-asciidoc/version.rb +1 -1
- metadata +97 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09404febee1aa7a38d25fbeb16e29c21e1790e3a3eb5f4033d2c19aa1c016467
|
4
|
+
data.tar.gz: cf334b89c66b3415fab2af159461c32f4c292d5907f0dfd1d0f8e92932612387
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c97fc8f19a5531aac959f91332e442b15de33b8834475f2b5f075f6cd2005a3190f9343b10264b43347941f9954e6e8562fee07737901a9f1f2c97ad0d4ea4d6
|
7
|
+
data.tar.gz: 88802a4fe982d3fd841426c56f9ef9738d7a117203b7d80c6af1f02adff690f70efb3359188f6d695e4274d8b4b1d74af60e5455a53d269a8005fd186dfbfbd0
|
data/Gemfile
CHANGED
@@ -3,11 +3,10 @@ source 'https://rubygems.org'
|
|
3
3
|
# Runtime dependencies are defined in middleman-asciidoc.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
6
|
+
# NOTE when running tests on JRuby, use version of middleman-core that does not depend on fast_blank
|
7
|
+
git 'https://github.com/middleman/middleman.git', ref: '1d13e415e27aa1b30d85fecebf8cc0f91d4023c6' do
|
8
|
+
gem 'middleman-core'
|
9
|
+
end if RUBY_ENGINE == 'jruby'
|
11
10
|
|
12
11
|
# Build and doc tools
|
13
12
|
gem 'rake', '~> 10.3', require: false
|
@@ -21,6 +20,10 @@ gem 'capybara', '~> 2.5.0', require: false
|
|
21
20
|
# Code quality tools
|
22
21
|
gem 'cane', platforms: :mri, require: false
|
23
22
|
|
23
|
+
# Additional libraries for testing
|
24
24
|
# Middleman itself (use for testing against development version)
|
25
25
|
#gem 'middleman-core', :github => 'middleman/middleman', :branch => 'master'
|
26
|
+
gem 'middleman-blog', '~> 4.0', require: false
|
27
|
+
# NOTE middleman-cli required by middleman-blog
|
28
|
+
gem 'middleman-cli', '~> 4.0', require: false
|
26
29
|
gem 'listen', '~> 3.0.0', require: false # see https://github.com/middleman/middleman/pull/1891
|
data/README.adoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= AsciiDoc Extension for Middleman (powered by Asciidoctor)
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>
|
3
|
-
v1.0.0.rc.
|
3
|
+
v1.0.0.rc.4, 2017-11-29
|
4
4
|
// Settings:
|
5
5
|
:idprefix:
|
6
6
|
:idseparator: -
|
@@ -211,7 +211,7 @@ Here are the different ways to specify a layout:
|
|
211
211
|
* `:page-layout:`, `:page-layout: _auto_layout`, or _not specified_ -- use the automatic layout (default: layout)
|
212
212
|
* `:page-layout: custom` -- use the page layout named "`custom`" (e.g., [.path]_custom.erb_)
|
213
213
|
* `:!page-layout:` or `:page-layout: false` -- generate a standalone HTML document
|
214
|
-
* `:page-layout:
|
214
|
+
* `:page-layout: ~` or `:page-layout: null` -- generate a page without a layout (don't wrap content in a layout)
|
215
215
|
|
216
216
|
.Layout for blog posts
|
217
217
|
WARNING: If you're using the Middleman Blog extension to write blog posts, the `layout` property on the blog configuration overrides the default layout, but you can still override that setting using the `page-layout` attribute in each post.
|
@@ -0,0 +1,122 @@
|
|
1
|
+
Feature: Blog Integration
|
2
|
+
In order to test blog articles written in AsciiDoc
|
3
|
+
|
4
|
+
Scenario: A blog article is generated from an AsciiDoc document
|
5
|
+
Given the Server is running at "asciidoc-blog-app"
|
6
|
+
When I go to "/blog/welcome.html"
|
7
|
+
Then I should see:
|
8
|
+
"""
|
9
|
+
<!DOCTYPE html>
|
10
|
+
<html>
|
11
|
+
<head>
|
12
|
+
<title>Welcome</title>
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<article>
|
16
|
+
<header>
|
17
|
+
<span>by Blog Author</span>
|
18
|
+
<time datetime="2017-09-01T15:00:00Z">Sep 1, 2017</time>
|
19
|
+
</header>
|
20
|
+
<h1>Welcome</h1>
|
21
|
+
<div class="paragraph">
|
22
|
+
<p>Welcome to my blog.</p>
|
23
|
+
</div>
|
24
|
+
</article>
|
25
|
+
</body>
|
26
|
+
</html>
|
27
|
+
"""
|
28
|
+
|
29
|
+
Scenario: A blog article should accommodate multiple authors
|
30
|
+
Given the Server is running at "asciidoc-blog-app"
|
31
|
+
When I go to "/blog/joint-effort.html"
|
32
|
+
Then I should see "John Smith, Jane Doe, Doc Writer"
|
33
|
+
|
34
|
+
Scenario: A blog article marked as not published should be published when running the local server
|
35
|
+
Given the Server is running at "asciidoc-blog-app"
|
36
|
+
When I go to "/blog/not-published.html"
|
37
|
+
Then I should see:
|
38
|
+
"""
|
39
|
+
This article should only be published when running the local server.
|
40
|
+
"""
|
41
|
+
|
42
|
+
Scenario: A blog article marked as not published should not be listed if filtered out
|
43
|
+
Given a fixture app "asciidoc-blog-app"
|
44
|
+
And app "asciidoc-blog-app" is using config "published-only"
|
45
|
+
And the Server is running
|
46
|
+
When I go to "/index.html"
|
47
|
+
Then I should not see "/blog/not-published.html"
|
48
|
+
|
49
|
+
@nojava
|
50
|
+
Scenario: A blog article marked as not published should not be published when generating the site
|
51
|
+
Given a fixture app "asciidoc-blog-app"
|
52
|
+
And I run `middleman build`
|
53
|
+
And was successfully built
|
54
|
+
When I cd to "build"
|
55
|
+
Then the following files should not exist:
|
56
|
+
| blog/not-published.html |
|
57
|
+
|
58
|
+
Scenario: A blog article marked as ignored should not be published
|
59
|
+
Given the Server is running at "asciidoc-blog-app"
|
60
|
+
When I go to "/blog/ignored.html"
|
61
|
+
Then I should see "Not Found"
|
62
|
+
|
63
|
+
Scenario: The layout defined in blog configuration takes precedence over the layout defined in AsciiDoc configuration
|
64
|
+
Given a fixture app "asciidoc-blog-app"
|
65
|
+
And app "asciidoc-blog-app" is using config "asciidoc-layout"
|
66
|
+
And the Server is running
|
67
|
+
When I go to "/blog/welcome.html"
|
68
|
+
Then I should see:
|
69
|
+
"""
|
70
|
+
<article>
|
71
|
+
"""
|
72
|
+
|
73
|
+
Scenario: Specifying a layout for an article overrides layout defined in blog configuration
|
74
|
+
Given the Server is running at "asciidoc-blog-app"
|
75
|
+
When I go to "/blog/custom-layout.html"
|
76
|
+
Then I should see:
|
77
|
+
"""
|
78
|
+
<title>AsciiDoc Page: Custom Layout</title>
|
79
|
+
"""
|
80
|
+
|
81
|
+
Scenario: Tags can be specified for an article in the AsciiDoc header as comma-separated list
|
82
|
+
Given the Server is running at "asciidoc-blog-app"
|
83
|
+
When I go to "/blog/tags-tags-tags.html"
|
84
|
+
Then I should see:
|
85
|
+
"""
|
86
|
+
<span class="tags">
|
87
|
+
<span class="tag">fee</span>
|
88
|
+
<span class="tag">fi</span>
|
89
|
+
<span class="tag">fo</span>
|
90
|
+
<span class="tag">fum</span>
|
91
|
+
</span>
|
92
|
+
"""
|
93
|
+
|
94
|
+
Scenario: Tags can be specified for an article in the AsciiDoc header as an array
|
95
|
+
Given the Server is running at "asciidoc-blog-app"
|
96
|
+
When I go to "/blog/more-tags.html"
|
97
|
+
Then I should see:
|
98
|
+
"""
|
99
|
+
<span class="tags">
|
100
|
+
<span class="tag">bar</span>
|
101
|
+
<span class="tag">baz</span>
|
102
|
+
<span class="tag">foo</span>
|
103
|
+
</span>
|
104
|
+
"""
|
105
|
+
|
106
|
+
Scenario: A custom slug can be specified for an article in the AsciiDoc header
|
107
|
+
Given the Server is running at "asciidoc-blog-app"
|
108
|
+
When I go to "/blog/heisenberg.html"
|
109
|
+
Then I should see:
|
110
|
+
"""
|
111
|
+
<h1>Say My Name</h1>
|
112
|
+
"""
|
113
|
+
|
114
|
+
Scenario: The date specified in the article overrides the date in the filename
|
115
|
+
Given a fixture app "asciidoc-blog-app"
|
116
|
+
And app "asciidoc-blog-app" is using config "date-in-filename"
|
117
|
+
And the Server is running
|
118
|
+
When I go to "/blog-2/2017/a-fresh-start.html"
|
119
|
+
Then I should see:
|
120
|
+
"""
|
121
|
+
<time datetime="2017-09-01T15:45:00Z">Sep 1, 2017</time>
|
122
|
+
"""
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Feature: AsciiDoc Support
|
2
|
-
In order to test
|
2
|
+
In order to test AsciiDoc support
|
3
3
|
|
4
4
|
Scenario: Rendering html
|
5
|
-
Given the Server is running at "asciidoc-app"
|
5
|
+
Given the Server is running at "asciidoc-pages-app"
|
6
6
|
When I go to "/hello.html"
|
7
7
|
Then I should see:
|
8
8
|
"""
|
@@ -13,7 +13,7 @@ Feature: AsciiDoc Support
|
|
13
13
|
"""
|
14
14
|
|
15
15
|
Scenario: Rendering html with double file extension
|
16
|
-
Given the Server is running at "asciidoc-app"
|
16
|
+
Given the Server is running at "asciidoc-pages-app"
|
17
17
|
When I go to "/hello-with-extension.html"
|
18
18
|
Then I should see:
|
19
19
|
"""
|
@@ -24,13 +24,13 @@ Feature: AsciiDoc Support
|
|
24
24
|
"""
|
25
25
|
|
26
26
|
Scenario: Rendering html with layout defined in extension config
|
27
|
-
Given a fixture app "asciidoc-app"
|
27
|
+
Given a fixture app "asciidoc-pages-app"
|
28
28
|
And a file named "config.rb" with:
|
29
29
|
"""
|
30
30
|
activate :asciidoc, layout: :default
|
31
31
|
set :layout, :global
|
32
32
|
"""
|
33
|
-
|
33
|
+
And the Server is running
|
34
34
|
When I go to "/hello.html"
|
35
35
|
Then I should see:
|
36
36
|
"""
|
@@ -49,17 +49,13 @@ Feature: AsciiDoc Support
|
|
49
49
|
"""
|
50
50
|
|
51
51
|
Scenario: Rendering html with no layout specified
|
52
|
-
Given a fixture app "asciidoc-app"
|
53
|
-
And
|
54
|
-
"""
|
55
|
-
activate :asciidoc
|
56
|
-
set :layout, :default
|
57
|
-
"""
|
52
|
+
Given a fixture app "asciidoc-pages-app"
|
53
|
+
And app "asciidoc-pages-app" is using config "default-layout"
|
58
54
|
And a file named "source/no-layout.adoc" with:
|
59
55
|
"""
|
60
56
|
Hello, AsciiDoc!
|
61
57
|
"""
|
62
|
-
|
58
|
+
And the Server is running
|
63
59
|
When I go to "/no-layout.html"
|
64
60
|
Then I should see:
|
65
61
|
"""
|
@@ -77,19 +73,15 @@ Feature: AsciiDoc Support
|
|
77
73
|
"""
|
78
74
|
|
79
75
|
Scenario: Rendering html with auto layout specified
|
80
|
-
Given a fixture app "asciidoc-app"
|
81
|
-
And
|
82
|
-
"""
|
83
|
-
activate :asciidoc
|
84
|
-
set :layout, :default
|
85
|
-
"""
|
76
|
+
Given a fixture app "asciidoc-pages-app"
|
77
|
+
And app "asciidoc-pages-app" is using config "default-layout"
|
86
78
|
And a file named "source/auto-layout.adoc" with:
|
87
79
|
"""
|
88
80
|
:page-layout: _auto_layout
|
89
81
|
|
90
82
|
Hello, AsciiDoc!
|
91
83
|
"""
|
92
|
-
|
84
|
+
And the Server is running
|
93
85
|
When I go to "/auto-layout.html"
|
94
86
|
Then I should see:
|
95
87
|
"""
|
@@ -107,19 +99,15 @@ Feature: AsciiDoc Support
|
|
107
99
|
"""
|
108
100
|
|
109
101
|
Scenario: Rendering html with blank layout specified
|
110
|
-
Given a fixture app "asciidoc-app"
|
111
|
-
And
|
112
|
-
"""
|
113
|
-
activate :asciidoc
|
114
|
-
set :layout, :default
|
115
|
-
"""
|
102
|
+
Given a fixture app "asciidoc-pages-app"
|
103
|
+
And app "asciidoc-pages-app" is using config "default-layout"
|
116
104
|
And a file named "source/blank-layout.adoc" with:
|
117
105
|
"""
|
118
106
|
:page-layout:
|
119
107
|
|
120
108
|
Hello, AsciiDoc!
|
121
109
|
"""
|
122
|
-
|
110
|
+
And the Server is running
|
123
111
|
When I go to "/blank-layout.html"
|
124
112
|
Then I should see:
|
125
113
|
"""
|
@@ -137,14 +125,14 @@ Feature: AsciiDoc Support
|
|
137
125
|
"""
|
138
126
|
|
139
127
|
Scenario: Rendering html with explicit layout specified
|
140
|
-
Given a fixture app "asciidoc-app"
|
128
|
+
Given a fixture app "asciidoc-pages-app"
|
141
129
|
And a file named "source/explicit-layout.adoc" with:
|
142
130
|
"""
|
143
131
|
:page-layout: default
|
144
132
|
|
145
133
|
Hello, AsciiDoc!
|
146
134
|
"""
|
147
|
-
|
135
|
+
And the Server is running
|
148
136
|
When I go to "/explicit-layout.html"
|
149
137
|
Then I should see:
|
150
138
|
"""
|
@@ -162,20 +150,20 @@ Feature: AsciiDoc Support
|
|
162
150
|
"""
|
163
151
|
|
164
152
|
Scenario: Rendering html with layout unset
|
165
|
-
Given a fixture app "asciidoc-app"
|
153
|
+
Given a fixture app "asciidoc-pages-app"
|
166
154
|
And a file named "source/unset-layout.adoc" with:
|
167
155
|
"""
|
168
156
|
:!page-layout:
|
169
157
|
|
170
158
|
Hello, AsciiDoc!
|
171
159
|
"""
|
172
|
-
|
160
|
+
And the Server is running
|
173
161
|
When I go to "/unset-layout.html"
|
174
162
|
Then I should see:
|
175
163
|
"""
|
176
164
|
<meta name="generator" content="Asciidoctor
|
177
165
|
"""
|
178
|
-
|
166
|
+
And I should see:
|
179
167
|
"""
|
180
168
|
<div class="paragraph">
|
181
169
|
<p>Hello, AsciiDoc!</p>
|
@@ -183,45 +171,45 @@ Feature: AsciiDoc Support
|
|
183
171
|
"""
|
184
172
|
|
185
173
|
Scenario: Rendering html with false layout specified
|
186
|
-
Given a fixture app "asciidoc-app"
|
174
|
+
Given a fixture app "asciidoc-pages-app"
|
187
175
|
And a file named "source/false-layout.adoc" with:
|
188
176
|
"""
|
189
177
|
:page-layout: false
|
190
178
|
|
191
179
|
Hello, AsciiDoc!
|
192
180
|
"""
|
193
|
-
|
181
|
+
And the Server is running
|
194
182
|
When I go to "/false-layout.html"
|
195
183
|
Then I should see:
|
196
184
|
"""
|
197
185
|
<meta name="generator" content="Asciidoctor
|
198
186
|
"""
|
199
|
-
|
187
|
+
And I should see:
|
200
188
|
"""
|
201
189
|
<div class="paragraph">
|
202
190
|
<p>Hello, AsciiDoc!</p>
|
203
191
|
</div>
|
204
192
|
"""
|
205
193
|
|
206
|
-
Scenario: Rendering html with
|
207
|
-
Given a fixture app "asciidoc-app"
|
208
|
-
And a file named "source/
|
194
|
+
Scenario: Rendering html with null layout specified
|
195
|
+
Given a fixture app "asciidoc-pages-app"
|
196
|
+
And a file named "source/null-layout.adoc" with:
|
209
197
|
"""
|
210
|
-
:page-layout:
|
198
|
+
:page-layout: null
|
211
199
|
|
212
200
|
Hello, AsciiDoc!
|
213
201
|
"""
|
214
|
-
|
215
|
-
When I go to "/
|
202
|
+
And the Server is running at "asciidoc-pages-app"
|
203
|
+
When I go to "/null-layout.html"
|
216
204
|
Then I should not see:
|
217
205
|
"""
|
218
206
|
<!DOCTYPE html>
|
219
207
|
"""
|
220
|
-
|
208
|
+
And I should not see:
|
221
209
|
"""
|
222
210
|
<meta name="generator" content="Asciidoctor
|
223
211
|
"""
|
224
|
-
|
212
|
+
And I should see:
|
225
213
|
"""
|
226
214
|
<div class="paragraph">
|
227
215
|
<p>Hello, AsciiDoc!</p>
|
@@ -229,8 +217,8 @@ Feature: AsciiDoc Support
|
|
229
217
|
"""
|
230
218
|
|
231
219
|
Scenario: Rendering html using title and tags from document
|
232
|
-
Given the Server is running at "asciidoc-app"
|
233
|
-
When I go to "/hello-with-title.html"
|
220
|
+
Given the Server is running at "asciidoc-pages-app"
|
221
|
+
When I go to "/hello-with-title-and-tags.html"
|
234
222
|
Then I should see:
|
235
223
|
"""
|
236
224
|
<!DOCTYPE html>
|
@@ -249,13 +237,9 @@ Feature: AsciiDoc Support
|
|
249
237
|
"""
|
250
238
|
|
251
239
|
Scenario: Default safe mode for AsciiDoc processor
|
252
|
-
Given a fixture app "asciidoc-app"
|
253
|
-
And
|
254
|
-
|
255
|
-
activate :asciidoc
|
256
|
-
set :layout, :default
|
257
|
-
"""
|
258
|
-
Given the Server is running at "asciidoc-app"
|
240
|
+
Given a fixture app "asciidoc-pages-app"
|
241
|
+
And app "asciidoc-pages-app" is using config "default-layout"
|
242
|
+
And the Server is running
|
259
243
|
When I go to "/safe-mode.html"
|
260
244
|
Then I should see:
|
261
245
|
"""
|
@@ -273,13 +257,13 @@ Feature: AsciiDoc Support
|
|
273
257
|
"""
|
274
258
|
|
275
259
|
Scenario: Setting safe mode on AsciiDoc processor
|
276
|
-
Given a fixture app "asciidoc-app"
|
260
|
+
Given a fixture app "asciidoc-pages-app"
|
277
261
|
And a file named "config.rb" with:
|
278
262
|
"""
|
279
263
|
activate :asciidoc, safe: :unsafe
|
280
264
|
set :layout, :default
|
281
265
|
"""
|
282
|
-
|
266
|
+
And the Server is running
|
283
267
|
When I go to "/safe-mode.html"
|
284
268
|
Then I should see:
|
285
269
|
"""
|
@@ -296,8 +280,30 @@ Feature: AsciiDoc Support
|
|
296
280
|
</html>
|
297
281
|
"""
|
298
282
|
|
283
|
+
Scenario: Setting backend on AsciiDoc processor
|
284
|
+
Given a fixture app "asciidoc-pages-app"
|
285
|
+
And a file named "config.rb" with:
|
286
|
+
"""
|
287
|
+
activate :asciidoc, backend: 'xhtml'
|
288
|
+
set :layout, :default
|
289
|
+
"""
|
290
|
+
And the Server is running
|
291
|
+
When I go to "/backend.html"
|
292
|
+
Then I should see:
|
293
|
+
"""
|
294
|
+
<div class="paragraph">
|
295
|
+
<p>xml</p>
|
296
|
+
</div>
|
297
|
+
<hr/>
|
298
|
+
<div class="imageblock">
|
299
|
+
<div class="content">
|
300
|
+
<img src="/images/tiger.gif" alt="tiger"/>
|
301
|
+
</div>
|
302
|
+
</div>
|
303
|
+
"""
|
304
|
+
|
299
305
|
Scenario: Rendering html with title and layout from front matter
|
300
|
-
Given the Server is running at "asciidoc-app"
|
306
|
+
Given the Server is running at "asciidoc-pages-app"
|
301
307
|
When I go to "/hello-with-front-matter.html"
|
302
308
|
Then I should see:
|
303
309
|
"""
|
@@ -315,7 +321,7 @@ Feature: AsciiDoc Support
|
|
315
321
|
"""
|
316
322
|
|
317
323
|
Scenario: Ignoring files marked as ignored
|
318
|
-
Given the Server is running at "asciidoc-app"
|
324
|
+
Given the Server is running at "asciidoc-pages-app"
|
319
325
|
When I go to "/ignored.html"
|
320
326
|
Then I should see:
|
321
327
|
"""
|
@@ -323,15 +329,15 @@ Feature: AsciiDoc Support
|
|
323
329
|
"""
|
324
330
|
|
325
331
|
Scenario: Publishing site information as AsciiDoc attributes
|
326
|
-
Given the Server is running at "asciidoc-app"
|
332
|
+
Given the Server is running at "asciidoc-pages-app"
|
327
333
|
When I go to "/site-information.html"
|
328
|
-
Then I should see content matching %r{<p>site-root=.+/tmp/aruba/asciidoc-app</p>}
|
329
|
-
|
330
|
-
|
331
|
-
|
334
|
+
Then I should see content matching %r{<p>site-root=.+/tmp/aruba/asciidoc-pages-app</p>}
|
335
|
+
And I should see content matching %r{<p>site-source=.+/tmp/aruba/asciidoc-pages-app/source</p>}
|
336
|
+
And I should see content matching %r{<p>site-destination=.+/tmp/aruba/asciidoc-pages-app/build</p>}
|
337
|
+
And I should see content matching %r{<p>site-environment=development</p>}
|
332
338
|
|
333
339
|
Scenario: Merging page data in front matter and AsciiDoc header
|
334
|
-
Given the Server is running at "asciidoc-app"
|
340
|
+
Given the Server is running at "asciidoc-pages-app"
|
335
341
|
When I go to "/hello-with-mixed-page-data.html"
|
336
342
|
Then I should see:
|
337
343
|
"""
|
@@ -349,8 +355,16 @@ Feature: AsciiDoc Support
|
|
349
355
|
</html>
|
350
356
|
"""
|
351
357
|
|
358
|
+
Scenario: Parses value of page attribute as YAML data
|
359
|
+
Given the Server is running at "asciidoc-pages-app"
|
360
|
+
When I go to "/page-data.html"
|
361
|
+
Then I should see:
|
362
|
+
"""
|
363
|
+
<pre>{"title"=>"Page Data", "v-chrarray"=>["a", "b", "c"], "v-dblquote"=>"\"", "v-empty"=>"", "v-false"=>false, "v-hash"=>{"a"=>"a", "b"=>"b", "c"=>"c"}, "v-null"=>nil, "v-num"=>1, "v-numarray"=>[1, 2, 3], "v-quote"=>"'", "v-true"=>true}</pre>
|
364
|
+
"""
|
365
|
+
|
352
366
|
Scenario: Promoting standard AsciiDoc attributes to page data
|
353
|
-
Given the Server is running at "asciidoc-app"
|
367
|
+
Given the Server is running at "asciidoc-pages-app"
|
354
368
|
When I go to "/inspect-standard-page-data.html"
|
355
369
|
Then I should see:
|
356
370
|
"""
|
@@ -363,7 +377,7 @@ Feature: AsciiDoc Support
|
|
363
377
|
"""
|
364
378
|
|
365
379
|
Scenario: Honor time zone specified in revdate
|
366
|
-
Given the Server is running at "asciidoc-app"
|
380
|
+
Given the Server is running at "asciidoc-pages-app"
|
367
381
|
When I go to "/page-with-date-at-zone.html"
|
368
382
|
Then I should see:
|
369
383
|
"""
|
@@ -371,13 +385,13 @@ Feature: AsciiDoc Support
|
|
371
385
|
"""
|
372
386
|
|
373
387
|
Scenario: Add application time zone to revdate when none specified
|
374
|
-
Given a fixture app "asciidoc-app"
|
388
|
+
Given a fixture app "asciidoc-pages-app"
|
375
389
|
And a file named "config.rb" with:
|
376
390
|
"""
|
377
391
|
set :time_zone, 'MST'
|
378
392
|
activate :asciidoc
|
379
393
|
"""
|
380
|
-
|
394
|
+
And the Server is running
|
381
395
|
When I go to "/page-with-date.html"
|
382
396
|
Then I should see:
|
383
397
|
"""
|
@@ -385,7 +399,7 @@ Feature: AsciiDoc Support
|
|
385
399
|
"""
|
386
400
|
|
387
401
|
Scenario: Including a file relative to source root
|
388
|
-
Given the Server is running at "asciidoc-app"
|
402
|
+
Given the Server is running at "asciidoc-pages-app"
|
389
403
|
When I go to "/master.html"
|
390
404
|
Then I should see:
|
391
405
|
"""
|
@@ -396,7 +410,7 @@ Feature: AsciiDoc Support
|
|
396
410
|
"""
|
397
411
|
|
398
412
|
Scenario: Including a file relative to document in subdirectory
|
399
|
-
Given the Server is running at "asciidoc-app"
|
413
|
+
Given the Server is running at "asciidoc-pages-app"
|
400
414
|
When I go to "/manual/index.html"
|
401
415
|
Then I should see:
|
402
416
|
"""
|
@@ -412,12 +426,12 @@ Feature: AsciiDoc Support
|
|
412
426
|
"""
|
413
427
|
|
414
428
|
Scenario: Including a file relative to document in subdirectory when base_dir is set to :source
|
415
|
-
Given a fixture app "asciidoc-app"
|
429
|
+
Given a fixture app "asciidoc-pages-app"
|
416
430
|
And a file named "config.rb" with:
|
417
431
|
"""
|
418
432
|
activate :asciidoc, base_dir: :source
|
419
433
|
"""
|
420
|
-
|
434
|
+
And the Server is running
|
421
435
|
When I go to "/manual/index.html"
|
422
436
|
Then I should see:
|
423
437
|
"""
|
@@ -425,12 +439,12 @@ Feature: AsciiDoc Support
|
|
425
439
|
"""
|
426
440
|
|
427
441
|
Scenario: Including a file relative to document in subdirectory when base_dir is set to app.source_dir
|
428
|
-
Given a fixture app "asciidoc-app"
|
442
|
+
Given a fixture app "asciidoc-pages-app"
|
429
443
|
And a file named "config.rb" with:
|
430
444
|
"""
|
431
445
|
activate :asciidoc, base_dir: app.source_dir
|
432
446
|
"""
|
433
|
-
|
447
|
+
And the Server is running
|
434
448
|
When I go to "/manual/index.html"
|
435
449
|
Then I should see:
|
436
450
|
"""
|
@@ -438,13 +452,13 @@ Feature: AsciiDoc Support
|
|
438
452
|
"""
|
439
453
|
|
440
454
|
Scenario: Linking to a sibling page with directory indexes activated
|
441
|
-
Given a fixture app "asciidoc-app"
|
455
|
+
Given a fixture app "asciidoc-pages-app"
|
442
456
|
And a file named "config.rb" with:
|
443
457
|
"""
|
444
458
|
activate :asciidoc
|
445
459
|
activate :directory_indexes
|
446
460
|
"""
|
447
|
-
|
461
|
+
And the Server is running
|
448
462
|
When I go to "/link-to-page/"
|
449
463
|
Then I should see:
|
450
464
|
"""
|
@@ -452,14 +466,14 @@ Feature: AsciiDoc Support
|
|
452
466
|
"""
|
453
467
|
|
454
468
|
Scenario: Linking to a sibling page with directory indexes activated and trailing slash disabled
|
455
|
-
Given a fixture app "asciidoc-app"
|
469
|
+
Given a fixture app "asciidoc-pages-app"
|
456
470
|
And a file named "config.rb" with:
|
457
471
|
"""
|
458
472
|
activate :asciidoc
|
459
473
|
activate :directory_indexes
|
460
474
|
set :trailing_slash, false
|
461
475
|
"""
|
462
|
-
|
476
|
+
And the Server is running
|
463
477
|
When I go to "/link-to-page/"
|
464
478
|
Then I should see:
|
465
479
|
"""
|
@@ -467,14 +481,14 @@ Feature: AsciiDoc Support
|
|
467
481
|
"""
|
468
482
|
|
469
483
|
Scenario: Linking to a sibling page with directory indexes activated and strip index file disabled
|
470
|
-
Given a fixture app "asciidoc-app"
|
484
|
+
Given a fixture app "asciidoc-pages-app"
|
471
485
|
And a file named "config.rb" with:
|
472
486
|
"""
|
473
487
|
activate :asciidoc
|
474
488
|
activate :directory_indexes
|
475
489
|
set :strip_index_file, false
|
476
490
|
"""
|
477
|
-
|
491
|
+
And the Server is running
|
478
492
|
When I go to "/link-to-page/"
|
479
493
|
Then I should see:
|
480
494
|
"""
|
@@ -482,7 +496,7 @@ Feature: AsciiDoc Support
|
|
482
496
|
"""
|
483
497
|
|
484
498
|
Scenario: Linking to an image
|
485
|
-
Given the Server is running at "asciidoc-app"
|
499
|
+
Given the Server is running at "asciidoc-pages-app"
|
486
500
|
When I go to "/gallery.html"
|
487
501
|
Then I should see:
|
488
502
|
"""
|
@@ -493,7 +507,7 @@ Feature: AsciiDoc Support
|
|
493
507
|
"""
|
494
508
|
|
495
509
|
Scenario: Linking to an image with a custom imagesdir
|
496
|
-
Given the Server is running at "asciidoc-app"
|
510
|
+
Given the Server is running at "asciidoc-pages-app"
|
497
511
|
When I go to "/custom-imagesdir.html"
|
498
512
|
Then I should see:
|
499
513
|
"""
|
@@ -504,12 +518,12 @@ Feature: AsciiDoc Support
|
|
504
518
|
"""
|
505
519
|
|
506
520
|
Scenario: Restoring imagesdir to value defined in page
|
507
|
-
Given a fixture app "asciidoc-app"
|
521
|
+
Given a fixture app "asciidoc-pages-app"
|
508
522
|
And a file named "config.rb" with:
|
509
523
|
"""
|
510
524
|
activate :asciidoc, attributes: %w(imagesdir=@)
|
511
525
|
"""
|
512
|
-
|
526
|
+
And the Server is running
|
513
527
|
When I go to "/custom-imagesdir.html"
|
514
528
|
Then I should see:
|
515
529
|
"""
|
@@ -520,12 +534,12 @@ Feature: AsciiDoc Support
|
|
520
534
|
"""
|
521
535
|
|
522
536
|
Scenario: Restoring imagesdir to default value
|
523
|
-
Given a fixture app "asciidoc-app"
|
537
|
+
Given a fixture app "asciidoc-pages-app"
|
524
538
|
And a file named "config.rb" with:
|
525
539
|
"""
|
526
540
|
activate :asciidoc, attributes: %w(imagesdir!)
|
527
541
|
"""
|
528
|
-
|
542
|
+
And the Server is running
|
529
543
|
When I go to "/custom-imagesdir.html"
|
530
544
|
Then I should see:
|
531
545
|
"""
|
@@ -536,12 +550,12 @@ Feature: AsciiDoc Support
|
|
536
550
|
"""
|
537
551
|
|
538
552
|
Scenario: Overriding imagesdir attribute in page with imagesdir configuration
|
539
|
-
Given a fixture app "asciidoc-app"
|
553
|
+
Given a fixture app "asciidoc-pages-app"
|
540
554
|
And a file named "config.rb" with:
|
541
555
|
"""
|
542
556
|
activate :asciidoc, attributes: %w(imagesdir=/img)
|
543
557
|
"""
|
544
|
-
|
558
|
+
And the Server is running
|
545
559
|
When I go to "/custom-imagesdir.html"
|
546
560
|
Then I should see:
|
547
561
|
"""
|
@@ -552,32 +566,32 @@ Feature: AsciiDoc Support
|
|
552
566
|
"""
|
553
567
|
|
554
568
|
Scenario: Configuring custom AsciiDoc attributes as Array
|
555
|
-
Given a fixture app "asciidoc-app"
|
569
|
+
Given a fixture app "asciidoc-pages-app"
|
556
570
|
And a file named "config.rb" with:
|
557
571
|
"""
|
558
572
|
activate :asciidoc, attributes: %w(bar=bar@ foo={bar}{baz})
|
559
573
|
"""
|
560
|
-
|
574
|
+
And the Server is running
|
561
575
|
When I go to "/custom-attribute.html"
|
562
576
|
Then I should see "bar{baz}"
|
563
577
|
|
564
578
|
Scenario: Configuring custom AsciiDoc attributes as Hash
|
565
|
-
Given a fixture app "asciidoc-app"
|
579
|
+
Given a fixture app "asciidoc-pages-app"
|
566
580
|
And a file named "config.rb" with:
|
567
581
|
"""
|
568
582
|
activate :asciidoc, attributes: { 'bar' => 'bar@', 'foo' => '{bar}{baz}' }
|
569
583
|
"""
|
570
|
-
|
584
|
+
And the Server is running
|
571
585
|
When I go to "/custom-attribute.html"
|
572
586
|
Then I should see "bar{baz}"
|
573
587
|
|
574
588
|
Scenario: Highlighting source code
|
575
|
-
Given a fixture app "asciidoc-app"
|
589
|
+
Given a fixture app "asciidoc-pages-app"
|
576
590
|
And a file named "config.rb" with:
|
577
591
|
"""
|
578
592
|
activate :asciidoc, attributes: %w(source-highlighter=html-pipeline)
|
579
593
|
"""
|
580
|
-
|
594
|
+
And the Server is running
|
581
595
|
When I go to "/code.html"
|
582
596
|
Then I should see:
|
583
597
|
"""
|