html-proofer 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html/proofer/checks/links.rb +1 -1
  3. metadata +5 -168
  4. data/.gitignore +0 -26
  5. data/.travis.yml +0 -6
  6. data/Gemfile +0 -3
  7. data/LICENSE.txt +0 -22
  8. data/README.md +0 -177
  9. data/Rakefile +0 -8
  10. data/html-proofer.gemspec +0 -28
  11. data/spec/html/proofer/favicon_spec.rb +0 -46
  12. data/spec/html/proofer/fixtures/favicon/favicon_absent.html +0 -4
  13. data/spec/html/proofer/fixtures/favicon/favicon_absent_apple.html +0 -7
  14. data/spec/html/proofer/fixtures/favicon/favicon_broken.html +0 -7
  15. data/spec/html/proofer/fixtures/favicon/favicon_broken_but_ignored.html +0 -7
  16. data/spec/html/proofer/fixtures/favicon/favicon_present.html +0 -7
  17. data/spec/html/proofer/fixtures/favicon/favicon_present_shortcut.html +0 -7
  18. data/spec/html/proofer/fixtures/images/existingImageExternal.html +0 -9
  19. data/spec/html/proofer/fixtures/images/gpl.png +0 -0
  20. data/spec/html/proofer/fixtures/images/ignorableAltViaOptions.html +0 -13
  21. data/spec/html/proofer/fixtures/images/ignorableImages.html +0 -10
  22. data/spec/html/proofer/fixtures/images/ignoreAltButNotLink.html +0 -13
  23. data/spec/html/proofer/fixtures/images/image_missing_protocol_invalid.html +0 -9
  24. data/spec/html/proofer/fixtures/images/image_missing_protocol_valid.html +0 -9
  25. data/spec/html/proofer/fixtures/images/missingImageAlt.html +0 -9
  26. data/spec/html/proofer/fixtures/images/missingImageAltText.html +0 -9
  27. data/spec/html/proofer/fixtures/images/missingImageExternal.html +0 -9
  28. data/spec/html/proofer/fixtures/images/missingImageInternal.html +0 -9
  29. data/spec/html/proofer/fixtures/images/missingImageSrc.html +0 -9
  30. data/spec/html/proofer/fixtures/images/relativeToSelf.html +0 -2
  31. data/spec/html/proofer/fixtures/images/rootRelativeImages.html +0 -2
  32. data/spec/html/proofer/fixtures/images/terribleImageName.html +0 -9
  33. data/spec/html/proofer/fixtures/images/workingDataURIImage.html +0 -3
  34. data/spec/html/proofer/fixtures/links/anchors_in_pre.html +0 -12
  35. data/spec/html/proofer/fixtures/links/blank_mailto_link.html +0 -9
  36. data/spec/html/proofer/fixtures/links/blank_tel_link.html +0 -9
  37. data/spec/html/proofer/fixtures/links/brokenHashExternal.html +0 -11
  38. data/spec/html/proofer/fixtures/links/brokenHashInternal.html +0 -14
  39. data/spec/html/proofer/fixtures/links/brokenInternalLink.html +0 -0
  40. data/spec/html/proofer/fixtures/links/brokenLinkExternal.html +0 -11
  41. data/spec/html/proofer/fixtures/links/brokenLinkInternal.html +0 -10
  42. data/spec/html/proofer/fixtures/links/brokenLinkWithNumber.html +0 -8
  43. data/spec/html/proofer/fixtures/links/checkSSLLinks.html +0 -1
  44. data/spec/html/proofer/fixtures/links/folder/anchorLink.html +0 -0
  45. data/spec/html/proofer/fixtures/links/folder/assets/barrel.png +0 -0
  46. data/spec/html/proofer/fixtures/links/folder/index.html +0 -0
  47. data/spec/html/proofer/fixtures/links/folder/relativeImage.html +0 -2
  48. data/spec/html/proofer/fixtures/links/gpl.png +0 -0
  49. data/spec/html/proofer/fixtures/links/head_link_href.html +0 -7
  50. data/spec/html/proofer/fixtures/links/head_link_href_absent.html +0 -7
  51. data/spec/html/proofer/fixtures/links/head_link_href_empty.html +0 -7
  52. data/spec/html/proofer/fixtures/links/ignorableLinks.html +0 -13
  53. data/spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html +0 -13
  54. data/spec/html/proofer/fixtures/links/index.html +0 -1
  55. data/spec/html/proofer/fixtures/links/javascript_link.html +0 -9
  56. data/spec/html/proofer/fixtures/links/linkToFolder.html +0 -9
  57. data/spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html +0 -9
  58. data/spec/html/proofer/fixtures/links/linkWithHttps.html +0 -9
  59. data/spec/html/proofer/fixtures/links/linkWithRedirect.html +0 -12
  60. data/spec/html/proofer/fixtures/links/link_directory_without_slash.html +0 -1
  61. data/spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html +0 -9
  62. data/spec/html/proofer/fixtures/links/link_missing_protocol_valid.html +0 -9
  63. data/spec/html/proofer/fixtures/links/links_in_pre.html +0 -13
  64. data/spec/html/proofer/fixtures/links/mailto_link.html +0 -9
  65. data/spec/html/proofer/fixtures/links/missingLinkHref.html +0 -9
  66. data/spec/html/proofer/fixtures/links/multipleProblems.html +0 -11
  67. data/spec/html/proofer/fixtures/links/notarealhash.html +0 -0
  68. data/spec/html/proofer/fixtures/links/relativeLinks.html +0 -4
  69. data/spec/html/proofer/fixtures/links/rootLink.html +0 -10
  70. data/spec/html/proofer/fixtures/links/tel_link.html +0 -9
  71. data/spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png +0 -0
  72. data/spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg +0 -0
  73. data/spec/html/proofer/fixtures/resources/books/assets/pro-git.jpg +0 -0
  74. data/spec/html/proofer/fixtures/resources/books/assets/version-control-with-git.jpg +0 -0
  75. data/spec/html/proofer/fixtures/resources/books/nestedRelativeImages.html +0 -5
  76. data/spec/html/proofer/fixtures/resources/gpl.png +0 -0
  77. data/spec/html/proofer/fixtures/scripts/script.js +0 -1
  78. data/spec/html/proofer/fixtures/scripts/script_broken_external.html +0 -9
  79. data/spec/html/proofer/fixtures/scripts/script_content.html +0 -9
  80. data/spec/html/proofer/fixtures/scripts/script_content_absent.html +0 -9
  81. data/spec/html/proofer/fixtures/scripts/script_in_pre.html +0 -5
  82. data/spec/html/proofer/fixtures/scripts/script_missing_internal.html +0 -9
  83. data/spec/html/proofer/fixtures/scripts/script_valid_internal.html +0 -9
  84. data/spec/html/proofer/images_spec.rb +0 -98
  85. data/spec/html/proofer/links_spec.rb +0 -192
  86. data/spec/html/proofer/scripts_spec.rb +0 -41
  87. data/spec/html/proofer_spec.rb +0 -12
  88. data/spec/spec_helper.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4077b1e7e65c5e6051a6be8f04eb7559a34924f6
4
- data.tar.gz: 603ea3af05b2c946cfe9754026bb77f3ca2c4ef2
3
+ metadata.gz: a20862d9eea9bea34c7c588fc12d7c24e8d986bf
4
+ data.tar.gz: bc596894692c2bfac98f8c01dec07f58abf6e1ea
5
5
  SHA512:
6
- metadata.gz: 9b5b02acf24b0b9594e721b646214de7065f84e4751a33eddcb8771b6bd99909f0b610724fa8637bb8f9ac6b3c42c96cf76bf8f60531b76665421d64c4289ab3
7
- data.tar.gz: 773db8da60a145eaca7b70068d48a41bf885193d9825fb9e23f0e2000754992f1d1f551572222777e35b96fe007708266907b2de66cdec4ad70b2aaa2a292359
6
+ metadata.gz: 661dd0af5bb80b2bcd233dabce2eddc4fa66b5fc488c0941c86edb6416324731fd56fc1d02fbc1d8e1eca77c2badbe1d6d53d6e3861c4bb10924065e0f6db642
7
+ data.tar.gz: 86c96ac6f0c6a43a65084a4bdd261685b296c4c181cfe5d2bf6966e1be58a9b3466e9d2a1593e5514a55a9d8b07057eeb763180664943d81389738f8827393a7
@@ -33,7 +33,7 @@ class Links < ::HTML::Proofer::Checks::Check
33
33
 
34
34
  # is there even a href?
35
35
  if link.missing_href?
36
- self.add_issue("link has no href attribute")
36
+ self.add_issue("anchor has no href attribute")
37
37
  next
38
38
  end
39
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html-proofer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-29 00:00:00.000000000 Z
11
+ date: 2014-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mercenary
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.0
33
+ version: '1.5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.0
40
+ version: '1.5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: colored
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -144,14 +144,7 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - ".gitignore"
148
- - ".travis.yml"
149
- - Gemfile
150
- - LICENSE.txt
151
- - README.md
152
- - Rakefile
153
147
  - bin/htmlproof
154
- - html-proofer.gemspec
155
148
  - lib/html/proofer.rb
156
149
  - lib/html/proofer/check.rb
157
150
  - lib/html/proofer/checkable.rb
@@ -160,84 +153,6 @@ files:
160
153
  - lib/html/proofer/checks/images.rb
161
154
  - lib/html/proofer/checks/links.rb
162
155
  - lib/html/proofer/checks/scripts.rb
163
- - spec/html/proofer/favicon_spec.rb
164
- - spec/html/proofer/fixtures/favicon/favicon_absent.html
165
- - spec/html/proofer/fixtures/favicon/favicon_absent_apple.html
166
- - spec/html/proofer/fixtures/favicon/favicon_broken.html
167
- - spec/html/proofer/fixtures/favicon/favicon_broken_but_ignored.html
168
- - spec/html/proofer/fixtures/favicon/favicon_present.html
169
- - spec/html/proofer/fixtures/favicon/favicon_present_shortcut.html
170
- - spec/html/proofer/fixtures/images/existingImageExternal.html
171
- - spec/html/proofer/fixtures/images/gpl.png
172
- - spec/html/proofer/fixtures/images/ignorableAltViaOptions.html
173
- - spec/html/proofer/fixtures/images/ignorableImages.html
174
- - spec/html/proofer/fixtures/images/ignoreAltButNotLink.html
175
- - spec/html/proofer/fixtures/images/image_missing_protocol_invalid.html
176
- - spec/html/proofer/fixtures/images/image_missing_protocol_valid.html
177
- - spec/html/proofer/fixtures/images/missingImageAlt.html
178
- - spec/html/proofer/fixtures/images/missingImageAltText.html
179
- - spec/html/proofer/fixtures/images/missingImageExternal.html
180
- - spec/html/proofer/fixtures/images/missingImageInternal.html
181
- - spec/html/proofer/fixtures/images/missingImageSrc.html
182
- - spec/html/proofer/fixtures/images/relativeToSelf.html
183
- - spec/html/proofer/fixtures/images/rootRelativeImages.html
184
- - spec/html/proofer/fixtures/images/terribleImageName.html
185
- - spec/html/proofer/fixtures/images/workingDataURIImage.html
186
- - spec/html/proofer/fixtures/links/anchors_in_pre.html
187
- - spec/html/proofer/fixtures/links/blank_mailto_link.html
188
- - spec/html/proofer/fixtures/links/blank_tel_link.html
189
- - spec/html/proofer/fixtures/links/brokenHashExternal.html
190
- - spec/html/proofer/fixtures/links/brokenHashInternal.html
191
- - spec/html/proofer/fixtures/links/brokenInternalLink.html
192
- - spec/html/proofer/fixtures/links/brokenLinkExternal.html
193
- - spec/html/proofer/fixtures/links/brokenLinkInternal.html
194
- - spec/html/proofer/fixtures/links/brokenLinkWithNumber.html
195
- - spec/html/proofer/fixtures/links/checkSSLLinks.html
196
- - spec/html/proofer/fixtures/links/folder/anchorLink.html
197
- - spec/html/proofer/fixtures/links/folder/assets/barrel.png
198
- - spec/html/proofer/fixtures/links/folder/index.html
199
- - spec/html/proofer/fixtures/links/folder/relativeImage.html
200
- - spec/html/proofer/fixtures/links/gpl.png
201
- - spec/html/proofer/fixtures/links/head_link_href.html
202
- - spec/html/proofer/fixtures/links/head_link_href_absent.html
203
- - spec/html/proofer/fixtures/links/head_link_href_empty.html
204
- - spec/html/proofer/fixtures/links/ignorableLinks.html
205
- - spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html
206
- - spec/html/proofer/fixtures/links/index.html
207
- - spec/html/proofer/fixtures/links/javascript_link.html
208
- - spec/html/proofer/fixtures/links/linkToFolder.html
209
- - spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html
210
- - spec/html/proofer/fixtures/links/linkWithHttps.html
211
- - spec/html/proofer/fixtures/links/linkWithRedirect.html
212
- - spec/html/proofer/fixtures/links/link_directory_without_slash.html
213
- - spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html
214
- - spec/html/proofer/fixtures/links/link_missing_protocol_valid.html
215
- - spec/html/proofer/fixtures/links/links_in_pre.html
216
- - spec/html/proofer/fixtures/links/mailto_link.html
217
- - spec/html/proofer/fixtures/links/missingLinkHref.html
218
- - spec/html/proofer/fixtures/links/multipleProblems.html
219
- - spec/html/proofer/fixtures/links/notarealhash.html
220
- - spec/html/proofer/fixtures/links/relativeLinks.html
221
- - spec/html/proofer/fixtures/links/rootLink.html
222
- - spec/html/proofer/fixtures/links/tel_link.html
223
- - spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png
224
- - spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
225
- - spec/html/proofer/fixtures/resources/books/assets/pro-git.jpg
226
- - spec/html/proofer/fixtures/resources/books/assets/version-control-with-git.jpg
227
- - spec/html/proofer/fixtures/resources/books/nestedRelativeImages.html
228
- - spec/html/proofer/fixtures/resources/gpl.png
229
- - spec/html/proofer/fixtures/scripts/script.js
230
- - spec/html/proofer/fixtures/scripts/script_broken_external.html
231
- - spec/html/proofer/fixtures/scripts/script_content.html
232
- - spec/html/proofer/fixtures/scripts/script_content_absent.html
233
- - spec/html/proofer/fixtures/scripts/script_in_pre.html
234
- - spec/html/proofer/fixtures/scripts/script_missing_internal.html
235
- - spec/html/proofer/fixtures/scripts/script_valid_internal.html
236
- - spec/html/proofer/images_spec.rb
237
- - spec/html/proofer/links_spec.rb
238
- - spec/html/proofer/scripts_spec.rb
239
- - spec/html/proofer_spec.rb
240
- - spec/spec_helper.rb
241
156
  homepage: https://github.com/gjtorikian/html-proofer
242
157
  licenses:
243
158
  - MIT
@@ -264,82 +179,4 @@ specification_version: 4
264
179
  summary: A set of tests to validate your HTML output. These tests check if your image
265
180
  references are legitimate, if they have alt tags, if your internal links are working,
266
181
  and so on. It's intended to be an all-in-one checker for your documentation output.
267
- test_files:
268
- - spec/html/proofer/favicon_spec.rb
269
- - spec/html/proofer/fixtures/favicon/favicon_absent.html
270
- - spec/html/proofer/fixtures/favicon/favicon_absent_apple.html
271
- - spec/html/proofer/fixtures/favicon/favicon_broken.html
272
- - spec/html/proofer/fixtures/favicon/favicon_broken_but_ignored.html
273
- - spec/html/proofer/fixtures/favicon/favicon_present.html
274
- - spec/html/proofer/fixtures/favicon/favicon_present_shortcut.html
275
- - spec/html/proofer/fixtures/images/existingImageExternal.html
276
- - spec/html/proofer/fixtures/images/gpl.png
277
- - spec/html/proofer/fixtures/images/ignorableAltViaOptions.html
278
- - spec/html/proofer/fixtures/images/ignorableImages.html
279
- - spec/html/proofer/fixtures/images/ignoreAltButNotLink.html
280
- - spec/html/proofer/fixtures/images/image_missing_protocol_invalid.html
281
- - spec/html/proofer/fixtures/images/image_missing_protocol_valid.html
282
- - spec/html/proofer/fixtures/images/missingImageAlt.html
283
- - spec/html/proofer/fixtures/images/missingImageAltText.html
284
- - spec/html/proofer/fixtures/images/missingImageExternal.html
285
- - spec/html/proofer/fixtures/images/missingImageInternal.html
286
- - spec/html/proofer/fixtures/images/missingImageSrc.html
287
- - spec/html/proofer/fixtures/images/relativeToSelf.html
288
- - spec/html/proofer/fixtures/images/rootRelativeImages.html
289
- - spec/html/proofer/fixtures/images/terribleImageName.html
290
- - spec/html/proofer/fixtures/images/workingDataURIImage.html
291
- - spec/html/proofer/fixtures/links/anchors_in_pre.html
292
- - spec/html/proofer/fixtures/links/blank_mailto_link.html
293
- - spec/html/proofer/fixtures/links/blank_tel_link.html
294
- - spec/html/proofer/fixtures/links/brokenHashExternal.html
295
- - spec/html/proofer/fixtures/links/brokenHashInternal.html
296
- - spec/html/proofer/fixtures/links/brokenInternalLink.html
297
- - spec/html/proofer/fixtures/links/brokenLinkExternal.html
298
- - spec/html/proofer/fixtures/links/brokenLinkInternal.html
299
- - spec/html/proofer/fixtures/links/brokenLinkWithNumber.html
300
- - spec/html/proofer/fixtures/links/checkSSLLinks.html
301
- - spec/html/proofer/fixtures/links/folder/anchorLink.html
302
- - spec/html/proofer/fixtures/links/folder/assets/barrel.png
303
- - spec/html/proofer/fixtures/links/folder/index.html
304
- - spec/html/proofer/fixtures/links/folder/relativeImage.html
305
- - spec/html/proofer/fixtures/links/gpl.png
306
- - spec/html/proofer/fixtures/links/head_link_href.html
307
- - spec/html/proofer/fixtures/links/head_link_href_absent.html
308
- - spec/html/proofer/fixtures/links/head_link_href_empty.html
309
- - spec/html/proofer/fixtures/links/ignorableLinks.html
310
- - spec/html/proofer/fixtures/links/ignorableLinksViaOptions.html
311
- - spec/html/proofer/fixtures/links/index.html
312
- - spec/html/proofer/fixtures/links/javascript_link.html
313
- - spec/html/proofer/fixtures/links/linkToFolder.html
314
- - spec/html/proofer/fixtures/links/linkTranslatedViaHrefSwap.html
315
- - spec/html/proofer/fixtures/links/linkWithHttps.html
316
- - spec/html/proofer/fixtures/links/linkWithRedirect.html
317
- - spec/html/proofer/fixtures/links/link_directory_without_slash.html
318
- - spec/html/proofer/fixtures/links/link_missing_protocol_invalid.html
319
- - spec/html/proofer/fixtures/links/link_missing_protocol_valid.html
320
- - spec/html/proofer/fixtures/links/links_in_pre.html
321
- - spec/html/proofer/fixtures/links/mailto_link.html
322
- - spec/html/proofer/fixtures/links/missingLinkHref.html
323
- - spec/html/proofer/fixtures/links/multipleProblems.html
324
- - spec/html/proofer/fixtures/links/notarealhash.html
325
- - spec/html/proofer/fixtures/links/relativeLinks.html
326
- - spec/html/proofer/fixtures/links/rootLink.html
327
- - spec/html/proofer/fixtures/links/tel_link.html
328
- - spec/html/proofer/fixtures/resources/Screen Shot 2012-08-09 at 7.51.18 AM.png
329
- - spec/html/proofer/fixtures/resources/books/assets/getting-good-with-git.jpg
330
- - spec/html/proofer/fixtures/resources/books/assets/pro-git.jpg
331
- - spec/html/proofer/fixtures/resources/books/assets/version-control-with-git.jpg
332
- - spec/html/proofer/fixtures/resources/books/nestedRelativeImages.html
333
- - spec/html/proofer/fixtures/resources/gpl.png
334
- - spec/html/proofer/fixtures/scripts/script.js
335
- - spec/html/proofer/fixtures/scripts/script_broken_external.html
336
- - spec/html/proofer/fixtures/scripts/script_content.html
337
- - spec/html/proofer/fixtures/scripts/script_content_absent.html
338
- - spec/html/proofer/fixtures/scripts/script_in_pre.html
339
- - spec/html/proofer/fixtures/scripts/script_missing_internal.html
340
- - spec/html/proofer/fixtures/scripts/script_valid_internal.html
341
- - spec/html/proofer/images_spec.rb
342
- - spec/html/proofer/links_spec.rb
343
- - spec/html/proofer/scripts_spec.rb
344
- - spec/html/proofer_spec.rb
345
- - spec/spec_helper.rb
182
+ test_files: []
data/.gitignore DELETED
@@ -1,26 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- coverage
6
- InstalledFiles
7
- lib/bundler/man
8
- pkg
9
- rdoc
10
- spec/reports
11
- test/tmp
12
- test/version_tmp
13
- tmp
14
-
15
- Gemfile.lock
16
- out/
17
- sample.rb
18
- run_sample.rb
19
- src/
20
- docs/
21
-
22
- # YARD artifacts
23
- .yardoc
24
- _yardoc
25
- doc/
26
- .DS_Store
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- before_install:
6
- - export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gemspec
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Garen Torikian
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,177 +0,0 @@
1
- # HTML::Proofer
2
-
3
- If you generate HTML files, _then this tool might be for you_.
4
-
5
- `HTML::Proofer` is a set of tests to validate your HTML output. These tests check if your image references are legitimate, if they have alt tags, if your internal links are working, and so on. It's intended to be an all-in-one checker for your output.
6
-
7
- [![Build Status](https://travis-ci.org/gjtorikian/html-proofer.png?branch=master)](https://travis-ci.org/gjtorikian/html-proofer) [![Gem Version](https://badge.fury.io/rb/html-proofer.png)](http://badge.fury.io/rb/html-proofer)
8
-
9
- ## Installation
10
-
11
- Add this line to your application's Gemfile:
12
-
13
- gem 'html-proofer'
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install html-proofer
22
-
23
- **NOTE:** When installation speed matters, set `NOKOGIRI_USE_SYSTEM_LIBRARIES` to `true` in your environment. This is useful for increasing the speed of your Continuous Integration builds.
24
-
25
- ## Usage
26
-
27
- ### Using in a script
28
-
29
- Require the gem; generate some HTML; create a new instance of the `HTML::Proofer` on
30
- your output folder; then `run` it. Here's a simple example:
31
-
32
- ```ruby
33
- require 'html/proofer'
34
- require 'html/pipeline'
35
- require 'find'
36
-
37
- # make an out dir
38
- Dir.mkdir("out") unless File.exists?("out")
39
-
40
- pipeline = HTML::Pipeline.new [
41
- HTML::Pipeline::MarkdownFilter,
42
- HTML::Pipeline::TableOfContentsFilter
43
- ], :gfm => true
44
-
45
- # iterate over files, and generate HTML from Markdown
46
- Find.find("./docs") do |path|
47
- if File.extname(path) == ".md"
48
- contents = File.read(path)
49
- result = pipeline.call(contents)
50
-
51
- File.open("out/#{path.split("/").pop.sub('.md', '.html')}", 'w') { |file| file.write(result[:output].to_s) }
52
- end
53
- end
54
-
55
- # test your out dir!
56
- HTML::Proofer.new("./out").run
57
- ```
58
-
59
- ### Using on the command-line
60
-
61
- You'll get a new program called `htmlproof` with this gem. Jawesome!
62
-
63
- Use it like you'd expect to:
64
-
65
- ``` bash
66
- htmlproof run ./out --swap wow:cow,mow:doh --ext .html.erb --ignore www.github.com
67
- ```
68
-
69
- Note: since `swap` is a bit special, you'll pass in a pair of `RegEx:String` values.
70
- `htmlproof` will figure out what you mean.
71
-
72
- ### Using with Jekyll
73
-
74
- Want to use HTML Proofer with your Jekyll site? Awesome. Simply add `gem 'html-proofer'`
75
- to your `Gemfile` as described above, and add the following to your `Rakefile`,
76
- using `rake test` to execute:
77
-
78
- ```ruby
79
- require 'html/proofer'
80
-
81
- task :test do
82
- sh "bundle exec jekyll build"
83
- HTML::Proofer.new("./_site").run
84
- end
85
- ```
86
-
87
- Don't have or want a `Rakefile`? You _could_ also do something like the following:
88
-
89
- ```bash
90
- htmlproof ./_site
91
- ```
92
-
93
- ## What's Tested?
94
-
95
- ### Images
96
-
97
- `img` elements:
98
-
99
- * Whether all your images have alt tags
100
- * Whether your internal image references are not broken
101
- * Whether external images are showing
102
-
103
- ### Links
104
-
105
- `a`, `link` elements:
106
-
107
- * Whether your internal links are not broken; this includes hash references (`#linkToMe`)
108
- * Whether external links are working
109
-
110
- ### Scripts
111
-
112
- `script` elements:
113
-
114
- * Whether your internal script references are not broken
115
- * Whether external scripts are loading
116
-
117
- ## Configuration
118
-
119
- The `HTML::Proofer` constructor takes an optional hash of additional options:
120
-
121
- | Option | Description | Default |
122
- | :----- | :---------- | :------ |
123
- | `disable_external` | If `true`, does not run the external link checker, which can take a lot of time. | `false` |
124
- | `ext` | The extension of your HTML files including the dot. | `.html`
125
- | `favicon` | Enables the favicon checker. | `false` |
126
- | `followlocation` | Follows external redirections. Amends missing trailing slashes to internal directories. | `true` |
127
- | `as_link_array` | Assumes that you've passed in just an array of links to check. | `false` |
128
- | `href_ignore` | An array of Strings or RegExps containing `href`s that are safe to ignore. Certain URIs, like `mailto` and `tel`, are always ignored. | `[]` |
129
- | `alt_ignore` | An array of Strings or RegExps containing `img`s whose missing `alt` tags are safe to ignore. | `[]` |
130
- | `href_swap` | A hash containing key-value pairs of `RegExp => String`. It transforms links that match `RegExp` into `String` via `gsub`. | `{}` |
131
- | `verbose` | If `true`, outputs extra information as the checking happens. Useful for debugging. | `false` |
132
-
133
- You can also pass in any of Typhoeus' options for the external link check. For example:
134
-
135
- ``` ruby
136
- HTML::Proofer.new("out/", {:ext => ".htm", :verbose = > true, :ssl_verifyhost => 2 })
137
- ```
138
-
139
- This sets `HTML::Proofer`'s extensions to use _.htm_, and gives Typhoeus a configuration for it to be verbose, and use specific SSL settings. Check [the Typhoeus documentation](https://github.com/typhoeus/typhoeus#other-curl-options) for more information on what options it can receive.
140
-
141
- ## Ignoring content
142
-
143
- Add the `data-proofer-ignore` attribute to any tag to ignore it from the checks.
144
-
145
- ## Custom tests
146
-
147
- Want to write your own test? Sure! Just create two classes--one that inherits from `HTML::Proofer::Checkable`, and another that inherits from `HTML::Proofer::Checks::Check`. `Checkable` defines various helper methods for your test, while `Checks::Check` actually runs across your content. `Checks::Check` should call `self.add_issue` on failures, to add them to the list.
148
-
149
- Here's an example custom test that protects against `mailto` links:
150
-
151
- ``` ruby
152
- class OctocatLink < ::HTML::Proofer::Checkable
153
-
154
- def mailto?
155
- return false if @data_ignore_proofer || @href.nil? || @href.empty?
156
- return @href.match /^mailto\:/
157
- end
158
-
159
- def octocat?
160
- return @href.match /\:octocat@github.com\Z/
161
- end
162
-
163
- end
164
-
165
- class MailToOctocat < ::HTML::Proofer::Checks::Check
166
-
167
- def run
168
- @html.css('a').each do |l|
169
- link = OctocatLink.new l, "octocat_link", self
170
-
171
- if link.mailto? && link.octocat?
172
- return self.add_issue("Don't email the Octocat directly!")
173
- end
174
- end
175
- end
176
- end
177
- ```