gjtorikian / html-proofer

Test your rendered HTML files to make sure they're accurate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Small extra hint for beginners

vegardjervell opened this issue · comments

Hey, first of all I want to say that this is a great tool!

However, I'm struggling to understand how to use the scripts provided in the README, and as of now I'm confined to writing bash scripts with an unholy amount of arguments being passed to htmlproofer (I'm very thankful that the CLI program exists). What I'm struggling with is specifically understanding the lines

  1. Create a new instance of the HTMLProofer on your output folder.
  2. Call proofer.run on that path.

If the guide could contain a slightly more verbose explanation of what is meant by that, perhaps with a snippet of what I should be doing to create and run the file from a terminal, that would be of great help.

Thanks again for a very helpful tool!

The lines you’ve quoted are for using this library in a Ruby program. The steps for using the CLI is here.

If that’s not helpful—if you can give me more information on your scenario (“I want to write a bash script using htmlproofer that does…”), I can write better docs around it!

Thanks for your quick reply! I think the guide for the CLI tool, and the --help docs are good already, that's what I've been using so far.

I was suspecting that it was Ruby, and I'm just getting into the basics of Ruby now after getting confirmation from you :) my goal is to be able to use HTMLProofer without needing bash scripts for everything. I just think it would be helpful to clearly state in the guide how you would proceed with creating and running the script. Something like

# I don't know if this would be correct
touch htmlproofer_demo.rb
# ... Write contents of the file ...
ruby htmlproofer_demo.rb

I think the barrier to entry could be lowered a bit by something like that. After all, this is a tool that can be very useful for people who know next-to-nothing about Ruby and just need to put together some basic scripts (which is a nice excuse to start learning Ruby as well).