= Validator Adds a button to the edit-page page that validates your markup using the W3C's validator service. Validation is done on the current content -- not what was last saved. Install: rake radiant:extensions:validator:update (copies necessary files to /public/) Dependencies: CodeRay (tested with gem 0.7.4.215) 'gem install coderay' Performs HTML code highlighting in the markup report (will do other types of highlighting in the future). More info available at: http://coderay.rubychan.de/) FakeWeb (tested with gem 1.1.2) 'gem install fakeweb' Used for testing to simulate responses from a remote server (in this case from the w3c validator service). More info available at: http://fakeweb.rubyforge.org/ Known Issues: This is based on Sean Cribbs' preview extension and requires a transaction-capable database (it's how we handle saving, rendering, then unsaving a page to validate what is currently in the page on-screen rather than requiring the user to first save). So, I'm not really sure what would happen if used without transactions. will it force a save of your current content? Will it render the most recently saved version? The W3C's validator SOAP interface leaves a bit to be desired. One of the big- gest issues is that they lump all warnings and errors into their own groups and don't even include the 'info' messages shown in the web interface. I've spoken with some folks at the W3C about this and they are interested in fixing it (so this will only get better in the future). For now, however, this means: * Messages that expect to be in sequential order sometimes reference the previous or next message. I've done my best to recreate this sequential ordering. If it references the 'next info message', though, you're out of luck - no info messages provided. * Global warnings have no description text - sorry that's the SOAP output again * Error messages often include line and col positions. Lines numbers are correct but they goof on calculating their column numbers (they strip out any leading spaces before doing their calculations). The code samples they give show the correct position, though. Testing is lean. I've fully tested the model (I think) but since much of the behavior here comes from javascript submitting parameters and other AJAXities, I really need more than just functional tests. I plan to incorporate some sort of selenium or other related testing. There is no error handling for the AJAX requests. There's plenty for handling errors tied to requests from the validator, though, so this is fairly edge-case. Basically, if your own server fails to respond, the browser will just hang there (good enough for now). Future Plans (To Do's): 1. First finish testing (no functional tests in place yet). 2. Look into Selenium for browser testing (too much js going on here for regular testing to be sufficient. 3. Add validation for css (and maybe XML) and incorporate auto page detection via MIME-type in Radiant to route the content to the correct validator 4. Add link checking (already in the works using Hpricot). 5. Set up site-wide testing to roll through all pages and validate/link check. 6. Set up chron-type job to automate #5 every x-days and store the results in the db (maybe even throw in auto email-notification). Acknowledgements: Thanks to Sean Cribbs for walking me through my learning curve. He's patient (and longsuffering).