Skip to content
A validator for Manning's DocBook format. Because that particular wheel needed re-inventing.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
features
lib
spec
.gitignore
Gemfile
LICENSE
README.md
Rakefile
manning-docbook-validator.gemspec

README.md

Manning DocBook Validator

Used to parse DocBook files and report back on duplicate IDs and code examples that are too long. Plus whatever other rules get made up along the way.

Usage

This gem isn't available on Rubygems.org because it's so niche/hipster. So you're going to have to download and install it like this:

git clone git://github.com/radar/manning-docbook-validator
cd manning-docbook-validator
rake install

Once you've installed it, run this command:

mdv <some file>

It will report "Chapter is valid!" if there are no reoccuring IDs in the document, and if there are no listing lines over 72 characters.

If you have something that's broke, MDV will let you know about it.

Best thing is that it won't die on the first encounter, but will actually persist through the document, collecting all the errors and then will present them to you so you can fix it up.

Caveats

If you have a listing line with a callout on the end of it or anything really that puts it over 72 characters, Manning's parser will barf on it. This one doesn't because it uses an XML parsing tool (Nokogiri) rather than reading the file line-by-line and parsing it using god-knows-what. Probably regular expressions.

Final word

Better tools == happier writers == better quality

Something went wrong with that request. Please try again.