Grow your CSS skills. Land your dream job.

Routine to validate the HTML / CSS?

  • # August 19, 2013 at 2:55 am

    Hi community! All good? This will be my first post:

    How can I automate the validation checks on all the web pages that I’ve on production sites and get useful summaries of validation errors?

    I use GitHub for front-end development.

    How can I automate the validation of new code before it is rolled out into production?

    Any ideas will be very welcome!

    # August 19, 2013 at 5:00 am

    First and foremost, what is it you’re asking? Basically, I can see two different questions, and depending on which one you’re asking, the answer is kind of different =)

    My suggestions:

    1) I don’t have any automatic checks before I roll out to production

    Answer: Find yourself a good validator (Markup Validity Gem and Be Valid Asset Gem where two I found on google), and then create a script that runs those validations.

    If it’s okay for you to test this when you commit there’s the nice pre-commit hook (found in .git/hooks/ to put running of that script into.

    If you want to do it when pushing, you may want to look into Travis CI, which hooks up nicely to Github (in theory – I’ve never really used it).

    2) I already have some kind of automated process

    Answer: Well, those gems still seems to be a good plan, though it might be overkill if you have no ruby elsewhere. I found a few others as well while googling, where sideshowbarker’s VNU seemed to be another favourite. There’s even a Grunt plugin.

    # August 26, 2013 at 1:56 am

    Hi M! yes there were 2 questions sorry.
    ‘First and foremost, what is it you’re asking? ‘
    Wel l I ‘m looking for a stack to make these validations steps automatically…

    “Markup Validity Gem and Be Valid Asset Gem where two I found on google)”
    Have u tried them?

    Have u tried PhantomJS?

    F/

    # August 26, 2013 at 3:28 am

    I haven’t tried either of the gems, but I use PhantomJS as part of a Grunt stack (generated by yo) for testing/building/linting. Not used it for validating HTML or CSS, but I know there are plugins that would allow you to do just that.

    # August 26, 2013 at 4:55 am

    :) thanks!

    ‘but I know there are plugins that would allow you to do just that.’

    yes? any list that I can look for?

    are u also F-E dev?

    # August 26, 2013 at 6:06 am

    more-or-less full-stack dev. I overall just love solving problems =)

    The GruntJS page has a list of plugins, and you may also want to look at Yeoman to get more of my workflow.

    Generally I have the server running (with reload, recompiling of Sass, various other basic tasks) while working, and then run the full test-suite in a pre-commit hook. Well, the full theoretical test-suite, I might want to add. =)

    # August 26, 2013 at 6:16 am

    nice one! listen now that u’re saying that about full-stack dev.

    How do u manage or what do u do when u’re a working with MVC JS-lib and yr backend is Rails? I mean cuz Rails is also MVC among other things…

    Thanks for yr time there”´! ^_^)

    # August 26, 2013 at 12:56 pm

    Well, I don’t do Rails, so I can’t answer you to that, but I tend to separate the front-end development from the middle/backend.

    basically, I’ll start with styles, design, and JS, using mockup data, and then once that’s finished I do the backend stuff. Of course, if I use a CMS I need to keep it’s output in mind when designing the frontend.

    # August 28, 2013 at 1:54 am

    :)

    I c! what if yr backend-stack and yr frontend-stack has MVC? how do u cope with dat?
    :)
    Are u in twitter?

    # August 29, 2013 at 10:02 am

    Please, could you avoid the textspeak? It’s a touch like nails on a chalkboard for me.

    Well, I haven’t actually had a chance to work too thoroughly with stacks where both are MVC, though I’d imagine I would be doing about the same, with mockup “data” to test anything.

    Yes, my twitter handle is melindrea82

    # August 29, 2013 at 1:04 pm

    How do u manage or what do u do when u’re a working with MVC JS-lib and yr backend is Rails? I mean cuz Rails is also MVC among other things…

    I don’t use Rails either, but I’m not sure what you’re getting at: are you expecting some difficulty because your front- and back-end stacks are both MVC?

    # September 27, 2013 at 2:45 am

    …Where did my post go? O.o

    It claims I already posted this reply, so hopefully this’ll be enough filler text to repost it!

    First and foremost, what is it you’re asking? Basically, I can see two different questions, and depending on which one you’re asking, the answer is kind of different =)

    My suggestions:

    1) I don’t have any automatic checks before I roll out to production

    Answer: Find yourself a good validator (the gems mentioned in this article seems a good start), and then create a script that runs those validations.

    If it’s okay for you to test this when you commit there’s the nice pre-commit hook (found in .git/hooks/ to put running of that script into.

    If you want to do it when pushing, you may want to look into Travis CI, which hooks up nicely to Github (in theory – I’ve never really used it).

    2) I already have some kind of automated process

    Answer: Well, those gems still seems to be a good plan, though it might be overkill if you have no ruby elsewhere. I found a few others as well while googling, where this one seemed to be another favourite. There’s even a Grunt plugin.

    # September 29, 2013 at 2:22 pm

    Hi Traq!

    I think I was mixing up to different subjects the MVC at the backend and the MVC a the front-end site…..no worries now

    Tack för svaret Melindrea! ^:^)

    # September 29, 2013 at 4:29 pm

    @Melindrea I can see that post just fine; it’s the first reply (Aug.19).

    You can’t see it? I’m asking because I noticed posts of my own appearing/ disappearing for no obvious reason.

    @yoniGeek I don’t see how that could possibly cause problems – as long as the front and back know how to talk to each other, they should get along fine. Of course, they need to know how to interact anyway – that’s not a deployment or testing issue.

    # September 29, 2013 at 4:39 pm

    I wonder if the issue with my post disappearing (and then appearing – it was there now) is connected to the caching, the same as the logins/etc.

    You’re welcome @yoniGeek, happy testing =)

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".