README.md in html-proofer-0.2.3 vs README.md in html-proofer-0.3.0
- old
+ new
@@ -20,10 +20,12 @@
$ gem install html-proofer
## Usage
+### In a script
+
Require the gem; generate some HTML; create a new instance of the `HTML::Proofer` on
your output folder; then `run` it. Here's a simple example:
```ruby
require 'html/proofer'
@@ -50,10 +52,23 @@
# test your out dir!
HTML::Proofer.new("./out").run
```
+### Usage on the command-line
+
+You'll get a new program called `htmlproof` with this gem. Jawesome!
+
+Use it like you'd expect to:
+
+``` bash
+htmlproof run ./out --swap wow:cow,mow:doh --ext .html.erb --ignore www.github.com
+```
+
+Note: since `swap` is a bit special, you'll pass in a pair of `RegEx:String` values.
+`htmlproof` will figure out what you mean.
+
## Usage with Jekyll
Want to use HTML Proofer with your Jekyll site? Awesome. Simply add `gem 'html-proofer'` to your `Gemfile` as described above, and add the following to your `Rakefile`, using `rake test` to execute:
```ruby
@@ -63,19 +78,24 @@
sh "bundle exec jekyll build"
HTML::Proofer.new("./_site").run
end
```
+Don't have or want a `Rakefile`? You _could_ also do something like the following:
+
+```bash
+htmlproof ./_site
+```
+
## What's Tested?
* Whether all your images have alt tags
* Whether your internal image references are not broken
* Whether external images are showing
* Whether your internal links are not broken; this includes hash references (`#linkToMe`)
* Whether external links are working
## Configuration
-
The `HTML::Proofer` constructor takes an optional hash of additional options:
* `:ext`: the extension (including the `.`) of your HTML files (default: `.html`)
* `:href_swap`: a hash containing key-value pairs of `RegExp => String`. It transforms links that match `RegExp` into `String` via `gsub`.
\ No newline at end of file