rspec-documentation 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +25 -2
  6. data/Makefile +9 -0
  7. data/README.md +18 -22
  8. data/Rakefile +1 -0
  9. data/exe/rspec-documentation +17 -0
  10. data/lib/rspec/documentation/version.rb +2 -2
  11. data/lib/rspec/documentation.rb +15 -2
  12. data/lib/rspec_documentation/configuration.rb +28 -0
  13. data/lib/rspec_documentation/document.rb +75 -0
  14. data/lib/rspec_documentation/documentation.rb +85 -0
  15. data/lib/rspec_documentation/formatters/ansi.rb +44 -0
  16. data/lib/rspec_documentation/formatters/html.rb +31 -0
  17. data/lib/rspec_documentation/formatters/json.rb +32 -0
  18. data/lib/rspec_documentation/formatters/ruby.rb +31 -0
  19. data/lib/rspec_documentation/formatters/yaml.rb +36 -0
  20. data/lib/rspec_documentation/formatters.rb +20 -0
  21. data/lib/rspec_documentation/html_element.rb +58 -0
  22. data/lib/rspec_documentation/javascript_bundle.rb +17 -0
  23. data/lib/rspec_documentation/markdown_renderer.rb +7 -0
  24. data/lib/rspec_documentation/page_collection.rb +64 -0
  25. data/lib/rspec_documentation/page_tree.rb +81 -0
  26. data/lib/rspec_documentation/page_tree_element.rb +78 -0
  27. data/lib/rspec_documentation/parsed_document.rb +72 -0
  28. data/lib/rspec_documentation/project_initialization.rb +52 -0
  29. data/lib/rspec_documentation/rspec/failure.rb +52 -0
  30. data/lib/rspec_documentation/rspec.rb +12 -0
  31. data/lib/rspec_documentation/spec.rb +108 -0
  32. data/lib/rspec_documentation/stylesheet_bundle.rb +17 -0
  33. data/lib/rspec_documentation/summary.rb +87 -0
  34. data/lib/rspec_documentation/util.rb +58 -0
  35. data/lib/rspec_documentation.rb +71 -0
  36. data/lib/tasks/rspec/documentation/generate.rake +10 -0
  37. data/lib/templates/000-Introduction.md.erb +35 -0
  38. data/lib/templates/010-Usage.md.erb +3 -0
  39. data/lib/templates/500-License.md.erb +3 -0
  40. data/lib/templates/bootstrap.js.erb +7 -0
  41. data/lib/templates/footer.html.erb +6 -0
  42. data/lib/templates/header.html.erb +20 -0
  43. data/lib/templates/layout.css.erb +418 -0
  44. data/lib/templates/layout.html.erb +31 -0
  45. data/lib/templates/layout.js.erb +67 -0
  46. data/lib/templates/modal_spec.html.erb +51 -0
  47. data/lib/templates/moon.svg.erb +1 -0
  48. data/lib/templates/script_tags.html.erb +1 -0
  49. data/lib/templates/stylesheet_links.html.erb +1 -0
  50. data/lib/templates/sun.svg.erb +1 -0
  51. data/lib/templates/tabbed_spec.html.erb +82 -0
  52. data/lib/templates/themes/bootstrap.min.css +11 -0
  53. data/lib/templates/themes/cerulean.css +11 -0
  54. data/lib/templates/themes/cosmo.css +11 -0
  55. data/lib/templates/themes/cyborg.css +11 -0
  56. data/lib/templates/themes/darkly.css +11 -0
  57. data/lib/templates/themes/flatly.css +11 -0
  58. data/lib/templates/themes/journal.css +11 -0
  59. data/lib/templates/themes/litera.css +11 -0
  60. data/lib/templates/themes/lumen.css +11 -0
  61. data/lib/templates/themes/lux.css +11 -0
  62. data/lib/templates/themes/materia.css +11 -0
  63. data/lib/templates/themes/minty.css +11 -0
  64. data/lib/templates/themes/morph.css +11 -0
  65. data/lib/templates/themes/pulse.css +11 -0
  66. data/lib/templates/themes/quartz.css +11 -0
  67. data/lib/templates/themes/sandstone.css +11 -0
  68. data/lib/templates/themes/simplex.css +11 -0
  69. data/lib/templates/themes/sketchy.css +11 -0
  70. data/lib/templates/themes/slate.css +11 -0
  71. data/lib/templates/themes/solar.css +11 -0
  72. data/lib/templates/themes/spacelab.css +11 -0
  73. data/lib/templates/themes/superhero.css +11 -0
  74. data/lib/templates/themes/united.css +11 -0
  75. data/lib/templates/themes/vapor.css +11 -0
  76. data/lib/templates/themes/yeti.css +11 -0
  77. data/lib/templates/themes/zephyr.css +11 -0
  78. data/rspec-documentation/pages/000-Introduction/000-Quickstart.md +17 -0
  79. data/rspec-documentation/pages/000-Introduction.md +23 -0
  80. data/rspec-documentation/pages/010-File System/000-Ordering.md +14 -0
  81. data/rspec-documentation/pages/010-File System/010-Documentation Bundle.md +9 -0
  82. data/rspec-documentation/pages/010-File System.md +26 -0
  83. data/rspec-documentation/pages/020-Running Tests.md +41 -0
  84. data/rspec-documentation/pages/030-Examples/010-Basic.md +51 -0
  85. data/rspec-documentation/pages/030-Examples/020-HTML.md +45 -0
  86. data/rspec-documentation/pages/030-Examples/030-ANSI.md +33 -0
  87. data/rspec-documentation/pages/030-Examples/040-JSON.md +39 -0
  88. data/rspec-documentation/pages/030-Examples/050-YAML.md +40 -0
  89. data/rspec-documentation/pages/030-Examples.md +7 -0
  90. data/rspec-documentation/pages/040-Spec Helper.md +11 -0
  91. data/rspec-documentation/pages/050-Linking.md +20 -0
  92. data/rspec-documentation/pages/060-Configuration/010-Context.md +26 -0
  93. data/rspec-documentation/pages/060-Configuration/020-Build Paths.md +33 -0
  94. data/rspec-documentation/pages/060-Configuration/030-Attribution.md +23 -0
  95. data/rspec-documentation/pages/060-Configuration.md +13 -0
  96. data/rspec-documentation/pages/070-Publishing.md +13 -0
  97. data/rspec-documentation/pages/500-License.md +11 -0
  98. data/rspec-documentation/spec_helper.rb +8 -0
  99. data/rspec-documentation.gemspec +10 -1
  100. data/sig/rspec/documentation.rbs +1 -1
  101. metadata +193 -5
@@ -0,0 +1,418 @@
1
+ /* cerulean, cosmo, cyborg, darkly, flatly, journal, litera, lumen, lux, materia, minty, morph,
2
+ pulse, quartz, sandstone, simplex, sketchy, slate, solar, spacelab, superhero, united, vapor,
3
+ yeti, zephyr */
4
+ <%= RSpecDocumentation.theme(:materia) %>
5
+
6
+ /* Base16, BlackWhiteTheme, Colorful, Github, Gruvbox, IgorPro, Magritte, Molokai, Monokai,
7
+ MonokaiSublime, Pastie, ThankfulEyes, Tulip */
8
+ <%= Rouge::Theme.find('molokai').render(scope: '.highlight') %>
9
+
10
+ /* https://stackoverflow.com/a/61587938 */
11
+ .consistent-height .tab-content {
12
+ display: flex;
13
+ }
14
+
15
+ .consistent-height .tab-content > .tab-pane {
16
+ display: block; /* undo "display: none;" */
17
+ visibility: hidden;
18
+ margin-right: -100%;
19
+ width: 100%;
20
+ }
21
+
22
+ .consistent-height .tab-content > .active {
23
+ visibility: visible;
24
+ }
25
+
26
+ @keyframes fade-in {
27
+ from {
28
+ opacity: 0;
29
+ }
30
+
31
+ to {
32
+ opacity: 1;
33
+ }
34
+ }
35
+
36
+ body {
37
+ opacity: 0;
38
+ animation: fade-in ease-in 1;
39
+ animation-fill-mode: forwards;
40
+ animation-duration: 0.15s;
41
+ animation-delay: .1s
42
+ }
43
+
44
+ .header-wrapper {
45
+ background-color: #fff;
46
+ }
47
+
48
+ [data-bs-theme="dark"] .header-wrapper {
49
+ background-color: #212121;
50
+ }
51
+
52
+ .theme-switcher {
53
+ display: inline-block;
54
+ vertical-align: middle;
55
+ margin-bottom: 1rem;
56
+ cursor: pointer;
57
+ }
58
+
59
+ .theme-icon {
60
+ width: 1.5rem;
61
+ height: 1.5rem;
62
+ }
63
+
64
+ .theme-light-icon path {
65
+ fill: #fcdb33;
66
+ }
67
+
68
+ .theme-dark-icon path {
69
+ fill: #63afc9;
70
+ }
71
+
72
+ .content h1 {
73
+ padding-top: 1rem;
74
+ }
75
+
76
+ h1.title a {
77
+ text-decoration: none;
78
+ }
79
+
80
+ .code {
81
+ font-family: monospace;
82
+ max-height: 30rem;
83
+ overflow-y: auto;
84
+ }
85
+
86
+ pre {
87
+ padding: 1rem;
88
+ border-radius: 10px;
89
+ }
90
+
91
+ div.language-console {
92
+ margin: 1rem;
93
+ }
94
+
95
+ div.branding {
96
+ text-align: right;
97
+ }
98
+
99
+ h1.title {
100
+ display: inline;
101
+ }
102
+
103
+ .hidden {
104
+ visibility: hidden;
105
+ }
106
+
107
+ .modal-body .row .col {
108
+ padding-top: 1rem;
109
+ }
110
+
111
+ .page-tree ol, ol.page-tree {
112
+ margin: 0;
113
+ list-style-type: none;
114
+ padding-left: 1rem;
115
+ }
116
+
117
+ ol.page-tree {
118
+ padding-left: 0;
119
+ }
120
+
121
+ .page-tree li {
122
+ line-height: 1.8rem;
123
+ white-space: nowrap;
124
+ }
125
+
126
+ .page-tree li.active {
127
+ list-style-type: square;
128
+ }
129
+
130
+ .page-tree li a {
131
+ text-decoration: none;
132
+ }
133
+
134
+ .page-tree li a.active {
135
+ font-weight: bold;
136
+ }
137
+
138
+ .header .separator {
139
+ display: inline-block;
140
+ height: 2.5rem;
141
+ }
142
+
143
+ .version {
144
+ font-size: 2rem;
145
+ }
146
+
147
+ div.highlight {
148
+ padding: 1rem;
149
+ padding-bottom: 0.05rem;
150
+ border-radius: 10px;
151
+ margin-bottom: 2rem;
152
+ }
153
+
154
+ .highlight .go {
155
+ color: #706d6d;
156
+ }
157
+
158
+ .ansi-html {
159
+ display: inline-block;
160
+ background-color: #2e2e2e;
161
+ border: 5px solid #2e2e2e;
162
+ border-radius: 10px;
163
+ }
164
+
165
+ .ansi-html .ansi-color-0 { color: #555555; }
166
+ .ansi-html .ansi-color-1 { color: #ff0000; }
167
+ .ansi-html .ansi-color-2 { color: #47ff47; }
168
+ .ansi-html .ansi-color-3 { color: #e9e947; }
169
+ .ansi-html .ansi-color-4 { color: #49a0dd; }
170
+ .ansi-html .ansi-color-5 { color: #8d7eeb; }
171
+ .ansi-html .ansi-color-6 { color: #2eecff; }
172
+ .ansi-html .ansi-color-7 { color: #ffffff; }
173
+ .ansi-html .ansi-color-9 { color: #606060; }
174
+ .ansi-html .ansi-color-reset { color: #dddddd; }
175
+ .ansi-html .ansi-bright {
176
+ filter: brightness(1.3);
177
+ }
178
+
179
+ .ansi-html .ansi-color-16 { color: #000000; }
180
+ .ansi-html .ansi-color-17 { color: #00005f; }
181
+ .ansi-html .ansi-color-18 { color: #000087; }
182
+ .ansi-html .ansi-color-19 { color: #0000af; }
183
+ .ansi-html .ansi-color-20 { color: #0000d7; }
184
+ .ansi-html .ansi-color-21 { color: #0000ff; }
185
+ .ansi-html .ansi-color-22 { color: #005f00; }
186
+ .ansi-html .ansi-color-23 { color: #005f5f; }
187
+ .ansi-html .ansi-color-24 { color: #005f87; }
188
+ .ansi-html .ansi-color-25 { color: #005faf; }
189
+ .ansi-html .ansi-color-26 { color: #005fd7; }
190
+ .ansi-html .ansi-color-27 { color: #005fff; }
191
+ .ansi-html .ansi-color-28 { color: #008700; }
192
+ .ansi-html .ansi-color-29 { color: #00875f; }
193
+ .ansi-html .ansi-color-30 { color: #008787; }
194
+ .ansi-html .ansi-color-31 { color: #0087af; }
195
+ .ansi-html .ansi-color-32 { color: #0087d7; }
196
+ .ansi-html .ansi-color-33 { color: #0087ff; }
197
+ .ansi-html .ansi-color-34 { color: #00af00; }
198
+ .ansi-html .ansi-color-35 { color: #00af5f; }
199
+ .ansi-html .ansi-color-36 { color: #00af87; }
200
+ .ansi-html .ansi-color-37 { color: #00afaf; }
201
+ .ansi-html .ansi-color-38 { color: #00afd7; }
202
+ .ansi-html .ansi-color-39 { color: #00afff; }
203
+ .ansi-html .ansi-color-40 { color: #00d700; }
204
+ .ansi-html .ansi-color-41 { color: #00d75f; }
205
+ .ansi-html .ansi-color-42 { color: #00d787; }
206
+ .ansi-html .ansi-color-43 { color: #00d7af; }
207
+ .ansi-html .ansi-color-44 { color: #00d7d7; }
208
+ .ansi-html .ansi-color-45 { color: #00d7ff; }
209
+ .ansi-html .ansi-color-46 { color: #00ff00; }
210
+ .ansi-html .ansi-color-47 { color: #00ff5f; }
211
+ .ansi-html .ansi-color-48 { color: #00ff87; }
212
+ .ansi-html .ansi-color-49 { color: #00ffaf; }
213
+ .ansi-html .ansi-color-50 { color: #00ffd7; }
214
+ .ansi-html .ansi-color-51 { color: #00ffff; }
215
+ .ansi-html .ansi-color-52 { color: #5f0000; }
216
+ .ansi-html .ansi-color-53 { color: #5f005f; }
217
+ .ansi-html .ansi-color-54 { color: #5f0087; }
218
+ .ansi-html .ansi-color-55 { color: #5f00af; }
219
+ .ansi-html .ansi-color-56 { color: #5f00d7; }
220
+ .ansi-html .ansi-color-57 { color: #5f00ff; }
221
+ .ansi-html .ansi-color-58 { color: #5f5f00; }
222
+ .ansi-html .ansi-color-59 { color: #5f5f5f; }
223
+ .ansi-html .ansi-color-60 { color: #5f5f87; }
224
+ .ansi-html .ansi-color-61 { color: #5f5faf; }
225
+ .ansi-html .ansi-color-62 { color: #5f5fd7; }
226
+ .ansi-html .ansi-color-63 { color: #5f5fff; }
227
+ .ansi-html .ansi-color-64 { color: #5f8700; }
228
+ .ansi-html .ansi-color-65 { color: #5f875f; }
229
+ .ansi-html .ansi-color-66 { color: #5f8787; }
230
+ .ansi-html .ansi-color-67 { color: #5f87af; }
231
+ .ansi-html .ansi-color-68 { color: #5f87d7; }
232
+ .ansi-html .ansi-color-69 { color: #5f87ff; }
233
+ .ansi-html .ansi-color-70 { color: #5faf00; }
234
+ .ansi-html .ansi-color-71 { color: #5faf5f; }
235
+ .ansi-html .ansi-color-72 { color: #5faf87; }
236
+ .ansi-html .ansi-color-73 { color: #5fafaf; }
237
+ .ansi-html .ansi-color-74 { color: #5fafd7; }
238
+ .ansi-html .ansi-color-75 { color: #5fafff; }
239
+ .ansi-html .ansi-color-76 { color: #5fd700; }
240
+ .ansi-html .ansi-color-77 { color: #5fd75f; }
241
+ .ansi-html .ansi-color-78 { color: #5fd787; }
242
+ .ansi-html .ansi-color-79 { color: #5fd7af; }
243
+ .ansi-html .ansi-color-80 { color: #5fd7d7; }
244
+ .ansi-html .ansi-color-81 { color: #5fd7ff; }
245
+ .ansi-html .ansi-color-82 { color: #5fff00; }
246
+ .ansi-html .ansi-color-83 { color: #5fff5f; }
247
+ .ansi-html .ansi-color-84 { color: #5fff87; }
248
+ .ansi-html .ansi-color-85 { color: #5fffaf; }
249
+ .ansi-html .ansi-color-86 { color: #5fffd7; }
250
+ .ansi-html .ansi-color-87 { color: #5fffff; }
251
+ .ansi-html .ansi-color-88 { color: #870000; }
252
+ .ansi-html .ansi-color-89 { color: #87005f; }
253
+ .ansi-html .ansi-color-90 { color: #870087; }
254
+ .ansi-html .ansi-color-91 { color: #8700af; }
255
+ .ansi-html .ansi-color-92 { color: #8700d7; }
256
+ .ansi-html .ansi-color-93 { color: #8700ff; }
257
+ .ansi-html .ansi-color-94 { color: #875f00; }
258
+ .ansi-html .ansi-color-95 { color: #875f5f; }
259
+ .ansi-html .ansi-color-96 { color: #875f87; }
260
+ .ansi-html .ansi-color-97 { color: #875faf; }
261
+ .ansi-html .ansi-color-98 { color: #875fd7; }
262
+ .ansi-html .ansi-color-99 { color: #875fff; }
263
+ .ansi-html .ansi-color-100 { color: #878700; }
264
+ .ansi-html .ansi-color-101 { color: #87875f; }
265
+ .ansi-html .ansi-color-102 { color: #878787; }
266
+ .ansi-html .ansi-color-103 { color: #8787af; }
267
+ .ansi-html .ansi-color-104 { color: #8787d7; }
268
+ .ansi-html .ansi-color-105 { color: #8787ff; }
269
+ .ansi-html .ansi-color-106 { color: #87af00; }
270
+ .ansi-html .ansi-color-107 { color: #87af5f; }
271
+ .ansi-html .ansi-color-108 { color: #87af87; }
272
+ .ansi-html .ansi-color-109 { color: #87afaf; }
273
+ .ansi-html .ansi-color-110 { color: #87afd7; }
274
+ .ansi-html .ansi-color-111 { color: #87afff; }
275
+ .ansi-html .ansi-color-112 { color: #87d700; }
276
+ .ansi-html .ansi-color-113 { color: #87d75f; }
277
+ .ansi-html .ansi-color-114 { color: #87d787; }
278
+ .ansi-html .ansi-color-115 { color: #87d7af; }
279
+ .ansi-html .ansi-color-116 { color: #87d7d7; }
280
+ .ansi-html .ansi-color-117 { color: #87d7ff; }
281
+ .ansi-html .ansi-color-118 { color: #87ff00; }
282
+ .ansi-html .ansi-color-119 { color: #87ff5f; }
283
+ .ansi-html .ansi-color-120 { color: #87ff87; }
284
+ .ansi-html .ansi-color-121 { color: #87ffaf; }
285
+ .ansi-html .ansi-color-122 { color: #87ffd7; }
286
+ .ansi-html .ansi-color-123 { color: #87ffff; }
287
+ .ansi-html .ansi-color-124 { color: #af0000; }
288
+ .ansi-html .ansi-color-125 { color: #af005f; }
289
+ .ansi-html .ansi-color-126 { color: #af0087; }
290
+ .ansi-html .ansi-color-127 { color: #af00af; }
291
+ .ansi-html .ansi-color-128 { color: #af00d7; }
292
+ .ansi-html .ansi-color-129 { color: #af00ff; }
293
+ .ansi-html .ansi-color-130 { color: #af5f00; }
294
+ .ansi-html .ansi-color-131 { color: #af5f5f; }
295
+ .ansi-html .ansi-color-132 { color: #af5f87; }
296
+ .ansi-html .ansi-color-133 { color: #af5faf; }
297
+ .ansi-html .ansi-color-134 { color: #af5fd7; }
298
+ .ansi-html .ansi-color-135 { color: #af5fff; }
299
+ .ansi-html .ansi-color-136 { color: #af8700; }
300
+ .ansi-html .ansi-color-137 { color: #af875f; }
301
+ .ansi-html .ansi-color-138 { color: #af8787; }
302
+ .ansi-html .ansi-color-139 { color: #af87af; }
303
+ .ansi-html .ansi-color-140 { color: #af87d7; }
304
+ .ansi-html .ansi-color-141 { color: #af87ff; }
305
+ .ansi-html .ansi-color-142 { color: #afaf00; }
306
+ .ansi-html .ansi-color-143 { color: #afaf5f; }
307
+ .ansi-html .ansi-color-144 { color: #afaf87; }
308
+ .ansi-html .ansi-color-145 { color: #afafaf; }
309
+ .ansi-html .ansi-color-146 { color: #afafd7; }
310
+ .ansi-html .ansi-color-147 { color: #afafff; }
311
+ .ansi-html .ansi-color-148 { color: #afd700; }
312
+ .ansi-html .ansi-color-149 { color: #afd75f; }
313
+ .ansi-html .ansi-color-150 { color: #afd787; }
314
+ .ansi-html .ansi-color-151 { color: #afd7af; }
315
+ .ansi-html .ansi-color-152 { color: #afd7d7; }
316
+ .ansi-html .ansi-color-153 { color: #afd7ff; }
317
+ .ansi-html .ansi-color-154 { color: #afff00; }
318
+ .ansi-html .ansi-color-155 { color: #afff5f; }
319
+ .ansi-html .ansi-color-156 { color: #afff87; }
320
+ .ansi-html .ansi-color-157 { color: #afffaf; }
321
+ .ansi-html .ansi-color-158 { color: #afffd7; }
322
+ .ansi-html .ansi-color-159 { color: #afffff; }
323
+ .ansi-html .ansi-color-160 { color: #d70000; }
324
+ .ansi-html .ansi-color-161 { color: #d7005f; }
325
+ .ansi-html .ansi-color-162 { color: #d70087; }
326
+ .ansi-html .ansi-color-163 { color: #d700af; }
327
+ .ansi-html .ansi-color-164 { color: #d700d7; }
328
+ .ansi-html .ansi-color-165 { color: #d700ff; }
329
+ .ansi-html .ansi-color-166 { color: #d75f00; }
330
+ .ansi-html .ansi-color-167 { color: #d75f5f; }
331
+ .ansi-html .ansi-color-168 { color: #d75f87; }
332
+ .ansi-html .ansi-color-169 { color: #d75faf; }
333
+ .ansi-html .ansi-color-170 { color: #d75fd7; }
334
+ .ansi-html .ansi-color-171 { color: #d75fff; }
335
+ .ansi-html .ansi-color-172 { color: #d78700; }
336
+ .ansi-html .ansi-color-173 { color: #d7875f; }
337
+ .ansi-html .ansi-color-174 { color: #d78787; }
338
+ .ansi-html .ansi-color-175 { color: #d787af; }
339
+ .ansi-html .ansi-color-176 { color: #d787d7; }
340
+ .ansi-html .ansi-color-177 { color: #d787ff; }
341
+ .ansi-html .ansi-color-178 { color: #d7af00; }
342
+ .ansi-html .ansi-color-179 { color: #d7af5f; }
343
+ .ansi-html .ansi-color-180 { color: #d7af87; }
344
+ .ansi-html .ansi-color-181 { color: #d7afaf; }
345
+ .ansi-html .ansi-color-182 { color: #d7afd7; }
346
+ .ansi-html .ansi-color-183 { color: #d7afff; }
347
+ .ansi-html .ansi-color-184 { color: #d7d700; }
348
+ .ansi-html .ansi-color-185 { color: #d7d75f; }
349
+ .ansi-html .ansi-color-186 { color: #d7d787; }
350
+ .ansi-html .ansi-color-187 { color: #d7d7af; }
351
+ .ansi-html .ansi-color-188 { color: #d7d7d7; }
352
+ .ansi-html .ansi-color-189 { color: #d7d7ff; }
353
+ .ansi-html .ansi-color-190 { color: #d7ff00; }
354
+ .ansi-html .ansi-color-191 { color: #d7ff5f; }
355
+ .ansi-html .ansi-color-192 { color: #d7ff87; }
356
+ .ansi-html .ansi-color-193 { color: #d7ffaf; }
357
+ .ansi-html .ansi-color-194 { color: #d7ffd7; }
358
+ .ansi-html .ansi-color-195 { color: #d7ffff; }
359
+ .ansi-html .ansi-color-196 { color: #ff0000; }
360
+ .ansi-html .ansi-color-197 { color: #ff005f; }
361
+ .ansi-html .ansi-color-198 { color: #ff0087; }
362
+ .ansi-html .ansi-color-199 { color: #ff00af; }
363
+ .ansi-html .ansi-color-200 { color: #ff00d7; }
364
+ .ansi-html .ansi-color-201 { color: #ff00ff; }
365
+ .ansi-html .ansi-color-202 { color: #ff5f00; }
366
+ .ansi-html .ansi-color-203 { color: #ff5f5f; }
367
+ .ansi-html .ansi-color-204 { color: #ff5f87; }
368
+ .ansi-html .ansi-color-205 { color: #ff5faf; }
369
+ .ansi-html .ansi-color-206 { color: #ff5fd7; }
370
+ .ansi-html .ansi-color-207 { color: #ff5fff; }
371
+ .ansi-html .ansi-color-208 { color: #ff8700; }
372
+ .ansi-html .ansi-color-209 { color: #ff875f; }
373
+ .ansi-html .ansi-color-210 { color: #ff8787; }
374
+ .ansi-html .ansi-color-211 { color: #ff87af; }
375
+ .ansi-html .ansi-color-212 { color: #ff87d7; }
376
+ .ansi-html .ansi-color-213 { color: #ff87ff; }
377
+ .ansi-html .ansi-color-214 { color: #ffaf00; }
378
+ .ansi-html .ansi-color-215 { color: #ffaf5f; }
379
+ .ansi-html .ansi-color-216 { color: #ffaf87; }
380
+ .ansi-html .ansi-color-217 { color: #ffafaf; }
381
+ .ansi-html .ansi-color-218 { color: #ffafd7; }
382
+ .ansi-html .ansi-color-219 { color: #ffafff; }
383
+ .ansi-html .ansi-color-220 { color: #ffd700; }
384
+ .ansi-html .ansi-color-221 { color: #ffd75f; }
385
+ .ansi-html .ansi-color-222 { color: #ffd787; }
386
+ .ansi-html .ansi-color-223 { color: #ffd7af; }
387
+ .ansi-html .ansi-color-224 { color: #ffd7d7; }
388
+ .ansi-html .ansi-color-225 { color: #ffd7ff; }
389
+ .ansi-html .ansi-color-226 { color: #ffff00; }
390
+ .ansi-html .ansi-color-227 { color: #ffff5f; }
391
+ .ansi-html .ansi-color-228 { color: #ffff87; }
392
+ .ansi-html .ansi-color-229 { color: #ffffaf; }
393
+ .ansi-html .ansi-color-230 { color: #ffffd7; }
394
+ .ansi-html .ansi-color-231 { color: #ffffff; }
395
+ .ansi-html .ansi-color-232 { color: #080808; }
396
+ .ansi-html .ansi-color-233 { color: #121212; }
397
+ .ansi-html .ansi-color-234 { color: #1c1c1c; }
398
+ .ansi-html .ansi-color-235 { color: #262626; }
399
+ .ansi-html .ansi-color-236 { color: #303030; }
400
+ .ansi-html .ansi-color-237 { color: #3a3a3a; }
401
+ .ansi-html .ansi-color-238 { color: #444444; }
402
+ .ansi-html .ansi-color-239 { color: #4e4e4e; }
403
+ .ansi-html .ansi-color-240 { color: #585858; }
404
+ .ansi-html .ansi-color-241 { color: #626262; }
405
+ .ansi-html .ansi-color-242 { color: #6c6c6c; }
406
+ .ansi-html .ansi-color-243 { color: #767676; }
407
+ .ansi-html .ansi-color-244 { color: #808080; }
408
+ .ansi-html .ansi-color-245 { color: #8a8a8a; }
409
+ .ansi-html .ansi-color-246 { color: #949494; }
410
+ .ansi-html .ansi-color-247 { color: #9e9e9e; }
411
+ .ansi-html .ansi-color-248 { color: #a8a8a8; }
412
+ .ansi-html .ansi-color-249 { color: #b2b2b2; }
413
+ .ansi-html .ansi-color-250 { color: #bcbcbc; }
414
+ .ansi-html .ansi-color-251 { color: #c6c6c6; }
415
+ .ansi-html .ansi-color-252 { color: #d0d0d0; }
416
+ .ansi-html .ansi-color-253 { color: #dadada; }
417
+ .ansi-html .ansi-color-254 { color: #e4e4e4; }
418
+ .ansi-html .ansi-color-255 { color: #eeeeee; }
@@ -0,0 +1,31 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="utf-8" />
4
+ <%= RSpecDocumentation.template(:stylesheet_links).result(binding) %>
5
+ </head>
6
+
7
+ <body>
8
+ <div class="container m-3 p-3">
9
+ <div class="header-wrapper sticky-top">
10
+ <%= header %>
11
+ </div>
12
+
13
+ <div class="row flex-nowrap">
14
+ <div class="col-sm-2 fs-6 mt-1 ms-3 me-3">
15
+ <ol class="page-tree hidden position-fixed">
16
+ <% page_tree.elements.each do |element| %>
17
+ <%= element %>
18
+ <% end %>
19
+ </ol>
20
+ </div>
21
+
22
+ <div class="col content" style="max-width: 80%">
23
+ <%= html %>
24
+ <%= footer %>
25
+ </div>
26
+ </div>
27
+ </div>
28
+
29
+ <%= RSpecDocumentation.template(:script_tags).result(binding) %>
30
+ </body>
31
+ </html>
@@ -0,0 +1,67 @@
1
+ <%= RSpecDocumentation.template('bootstrap', :js).result %>
2
+
3
+ (() => {
4
+ const initPageTree = () => {
5
+ const pageTree = document.querySelector('.page-tree');
6
+
7
+ const getParentElement = (element) => document.querySelector(element.dataset.parentId);
8
+ const isRootElement = (element) => !getParentElement(element);
9
+ const isChildActive = (element) => !!element.querySelectorAll('.active').length;
10
+ const isSiblingActive = (element) => !!getParentElement(element).querySelectorAll('.active').length;
11
+ const isActive = (element) => element && element.classList.contains('active');
12
+ const isSelfOrParentActive = (element) => {
13
+ const listItemSelector = `[data-list-item-id="#${element.id}"]`;
14
+ const item = document.querySelector(listItemSelector);
15
+
16
+ if (isActive(item)) return true;
17
+ if (isActive(getParentElement(element))) return true;
18
+
19
+ return false;
20
+ };
21
+
22
+ const visibilityCriteria = [isRootElement, isSelfOrParentActive, isChildActive, isSiblingActive];
23
+
24
+ pageTree.querySelectorAll('li').forEach((element) => {
25
+ if (!visibilityCriteria.some((criterion) => criterion(element))) element.classList.add('d-none');
26
+ });
27
+ pageTree.classList.remove('hidden');
28
+ };
29
+
30
+ const initThemeSwitcher = () => {
31
+ const lightButton = document.querySelector('.theme-switcher .theme-light-icon');
32
+ const darkButton = document.querySelector('.theme-switcher .theme-dark-icon');
33
+ const html = document.querySelector('html');
34
+ const initialTheme = localStorage.getItem('rspec-documentation-theme') || 'light';
35
+
36
+ lightButton.addEventListener('click', () => {
37
+ lightButton.classList.add('d-none');
38
+ darkButton.classList.remove('d-none');
39
+ html.dataset.bsTheme = 'dark';
40
+ localStorage.setItem('rspec-documentation-theme', 'dark');
41
+ });
42
+
43
+ darkButton.addEventListener('click', () => {
44
+ darkButton.classList.add('d-none');
45
+ lightButton.classList.remove('d-none');
46
+ html.dataset.bsTheme = 'light';
47
+ localStorage.setItem('rspec-documentation-theme', 'light');
48
+ });
49
+
50
+ html.dataset.bsTheme = initialTheme;
51
+
52
+ if (initialTheme === 'light') {
53
+ lightButton.classList.remove('d-none');
54
+ } else {
55
+ darkButton.classList.remove('d-none');
56
+ }
57
+ };
58
+
59
+ document.querySelectorAll('button.modal-dialog-maximize').forEach((element) => {
60
+ element.addEventListener('click', () => {
61
+ document.querySelector(element.dataset.modalDialogId).classList.toggle('modal-fullscreen');
62
+ });
63
+ });
64
+
65
+ initPageTree();
66
+ initThemeSwitcher();
67
+ })();
@@ -0,0 +1,51 @@
1
+ <div class="modal fade" id="modal-<%= element_id %>-side-by-side" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
2
+ <div class="modal-dialog modal-xl" id="modal-dialog-<%= element_id %>">
3
+ <div class="modal-content">
4
+ <div class="modal-header">
5
+ <h5 class="modal-title" id="modal-<%= element_id %>-side-by-side-label">Side-by-side view</h5>
6
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
7
+ </div>
8
+ <div class="modal-body">
9
+ <div class="container p-3">
10
+ <div class="row border">
11
+ <div class="col border">
12
+ <h5>Spec</h5>
13
+ <hr/>
14
+ <div class="p-3 mb-5 code highlight">
15
+ <%= code_source %>
16
+ </div>
17
+ </div>
18
+
19
+ <% unless prettified_output.nil? %>
20
+ <div class="col border">
21
+ <h5>Output</h5>
22
+ <hr/>
23
+ <div class="p-3 mb-5 code highlight">
24
+ <%= prettified_output %>
25
+ </div>
26
+ </div>
27
+ <% end %>
28
+
29
+ <div class="col border">
30
+ <% if prettified_output.nil? %>
31
+ <h5>Output</h5>
32
+ <% else %>
33
+ <h5>Rendered Output</h5>
34
+ <% end %>
35
+ <hr/>
36
+ <div class="p-3 mb-5 <%= render_raw? ? nil : 'code highlight' %>">
37
+ <%= rendered_output %>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div class="modal-footer">
44
+ <button type="button"
45
+ class="btn btn-primary modal-dialog-maximize"
46
+ data-modal-dialog-id="#modal-dialog-<%= element_id %>">Full Screen</button>
47
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
@@ -0,0 +1 @@
1
+ <svg class="d-none theme-icon theme-dark-icon" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.56 122.88"><defs><style>.cls-1{fill-rule:evenodd;}</style></defs><title>Dark Mode</title><path class="cls-1" d="M121.85,87.3A64.31,64.31,0,1,1,36.88.4c2.94-1.37,5.92.91,4.47,4.47a56.29,56.29,0,0,0,75.75,77.4l.49-.27a3.41,3.41,0,0,1,4.61,4.61l-.35.69ZM92.46,74.67H92A16.11,16.11,0,0,0,76.2,58.93v-.52a15.08,15.08,0,0,0,11-4.72,15.19,15.19,0,0,0,4.72-11h.51a15.12,15.12,0,0,0,4.72,11,15.12,15.12,0,0,0,11,4.72v.51A16.13,16.13,0,0,0,92.46,74.67Zm10.09-46.59h-.27a7.94,7.94,0,0,0-2.49-5.81A7.94,7.94,0,0,0,94,19.78v-.27A7.94,7.94,0,0,0,99.79,17a8,8,0,0,0,2.49-5.8h.27A8,8,0,0,0,105,17a8,8,0,0,0,5.81,2.49v.27A8,8,0,0,0,105,22.27a7.94,7.94,0,0,0-2.49,5.81Zm-41.5,8h-.41a12.06,12.06,0,0,0-3.78-8.82A12.06,12.06,0,0,0,48,23.5v-.41a12.07,12.07,0,0,0,8.82-3.78,12.09,12.09,0,0,0,3.78-8.82h.41a12.08,12.08,0,0,0,3.77,8.82,12.09,12.09,0,0,0,8.83,3.78v.41a12.09,12.09,0,0,0-8.83,3.78,12.08,12.08,0,0,0-3.77,8.82Z"/></svg>
@@ -0,0 +1 @@
1
+ <script src="<%= javascript_bundle_src %>"></script>
@@ -0,0 +1 @@
1
+ <link rel="stylesheet" href="<%= stylesheet_bundle_href %>" />
@@ -0,0 +1 @@
1
+ <svg class="d-none theme-icon theme-light-icon" id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><defs><style>.cls-1{fill:#fcdb33;}</style></defs><title>Light Mode</title><path class="cls-1" d="M30,13.21A3.93,3.93,0,1,1,36.8,9.27L41.86,18A3.94,3.94,0,1,1,35.05,22L30,13.21Zm31.45,13A35.23,35.23,0,1,1,36.52,36.52,35.13,35.13,0,0,1,61.44,26.2ZM58.31,4A3.95,3.95,0,1,1,66.2,4V14.06a3.95,3.95,0,1,1-7.89,0V4ZM87.49,10.1A3.93,3.93,0,1,1,94.3,14l-5.06,8.76a3.93,3.93,0,1,1-6.81-3.92l5.06-8.75ZM109.67,30a3.93,3.93,0,1,1,3.94,6.81l-8.75,5.06a3.94,3.94,0,1,1-4-6.81L109.67,30Zm9.26,28.32a3.95,3.95,0,1,1,0,7.89H108.82a3.95,3.95,0,1,1,0-7.89Zm-6.15,29.18a3.93,3.93,0,1,1-3.91,6.81l-8.76-5.06A3.93,3.93,0,1,1,104,82.43l8.75,5.06ZM92.89,109.67a3.93,3.93,0,1,1-6.81,3.94L81,104.86a3.94,3.94,0,0,1,6.81-4l5.06,8.76Zm-28.32,9.26a3.95,3.95,0,1,1-7.89,0V108.82a3.95,3.95,0,1,1,7.89,0v10.11Zm-29.18-6.15a3.93,3.93,0,0,1-6.81-3.91l5.06-8.76A3.93,3.93,0,1,1,40.45,104l-5.06,8.75ZM13.21,92.89a3.93,3.93,0,1,1-3.94-6.81L18,81A3.94,3.94,0,1,1,22,87.83l-8.76,5.06ZM4,64.57a3.95,3.95,0,1,1,0-7.89H14.06a3.95,3.95,0,1,1,0,7.89ZM10.1,35.39A3.93,3.93,0,1,1,14,28.58l8.76,5.06a3.93,3.93,0,1,1-3.92,6.81L10.1,35.39Z"/></svg>
@@ -0,0 +1,82 @@
1
+ <%= RSpecDocumentation.template('modal_spec').result(binding) %>
2
+
3
+ <div class="consistent-height">
4
+
5
+ <ul class="nav nav-tabs" id="html-tabs-<%= element_id %>" role="tablist">
6
+
7
+ <li class="nav-item" role="presentation">
8
+ <button class="nav-link active"
9
+ id="code-source-<%= element_id %>-tab"
10
+ data-bs-toggle="tab"
11
+ data-bs-target="#code-source-<%= element_id %>"
12
+ type="button"
13
+ role="tab"
14
+ aria-controls="code-source"
15
+ aria-selected="true">Spec</button>
16
+ </li>
17
+
18
+ <% unless prettified_output.nil? %>
19
+ <li class="nav-item" role="presentation">
20
+ <button class="nav-link"
21
+ id="html-source-<%= element_id %>-tab"
22
+ data-bs-toggle="tab"
23
+ data-bs-target="#html-source-<%= element_id %>"
24
+ type="button"
25
+ role="tab"
26
+ aria-controls="html-source"
27
+ aria-selected="true">Output</button>
28
+ </li>
29
+ <% end %>
30
+
31
+ <li class="nav-item" role="presentation">
32
+ <button class="nav-link"
33
+ id="rendered-<%= element_id %>-tab"
34
+ data-bs-toggle="tab"
35
+ data-bs-target="#rendered-<%= element_id %>"
36
+ type="button"
37
+ role="tab"
38
+ aria-controls="rendered"
39
+ aria-selected="false"><%= prettified_output.nil? ? 'Output' : 'Rendered Output' %></button>
40
+ </li>
41
+
42
+ <li class="nav-item bs-auto ms-auto mb-2">
43
+ <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modal-<%= element_id %>-side-by-side">
44
+ View Side-by-side
45
+ </button>
46
+ </li>
47
+
48
+ </ul>
49
+
50
+ <div class="tab-content" id="html-tab-content-<%= element_id %>">
51
+
52
+ <div class="tab-pane fade show active"
53
+ id="code-source-<%= element_id %>"
54
+ role="tabpanel"
55
+ aria-labelledby="code-source-<%= element_id %>-tab">
56
+ <div class="p-3 mb-5 mt-3 code highlight">
57
+ <%= code_source %>
58
+ </div>
59
+ </div>
60
+
61
+ <% unless prettified_output.nil? %>
62
+ <div class="tab-pane fade"
63
+ id="html-source-<%= element_id %>"
64
+ role="tabpanel"
65
+ aria-labelledby="html-source-<%= element_id %>-tab">
66
+ <div class="p-3 mb-5 mt-3 code highlight">
67
+ <%= prettified_output %>
68
+ </div>
69
+ </div>
70
+ <% end %>
71
+
72
+ <div class="tab-pane fade"
73
+ id="rendered-<%= element_id %>"
74
+ role="tabpanel"
75
+ aria-labelledby="rendered-<%= element_id %>-tab">
76
+ <div class="p-3 mb-5 mt-3 <%= render_raw? ? nil : 'code highlight' %>">
77
+ <%= rendered_output %>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+