From 426e8c3d82201a1b8db56130400783d019993142 Mon Sep 17 00:00:00 2001 From: Daniel Heath Date: Tue, 30 Apr 2019 11:01:57 +1000 Subject: [PATCH] Add rack middleware to readme --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index be4f699f..537a16df 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,19 @@ Below is mostly comprehensive list of checks that HTMLProofer can perform. You can configure HTMLProofer to run on a file, a directory, an array of directories, or an array of links. +There's also a rack middleware. + +### Using in a rails app + +Add to `config/application.rb` + + config.middleware.use HTMLProofer::Middleware if Rails.env.test? + config.middleware.use HTMLProofer::Middleware if Rails.env.development? + +This will raise an error at runtime if your HTML is invalid. + +Particularly helpful for projects which have extensive CI, since any invalid HTML will fail your build. + ### Using in a script 1. Require the gem.