Branched from rapi_doc gem version 0.3.1, and modified to suit my needs