Validate angular2 HTML and CSS with Webpack - html

I have an angular2 project that uses webpack to process all the typescript, html, and css.
I would like to validate my HTML and CSS/SCSS every time it's rebuilt, but I don't see any webpack loaders to do this. Not sure if I'm just searching for the wrong things, but searches like webpack validate html template angular2 aren't returning anything related.
The only way I have to validate the HTML right now is to load the relevant part of the page, copy the rendered source to a string and put it in the w3 validator.
Any suggestions for webpack loaders to validate HTML and CSS/SCSS?

Related

angular 4 load html template files from external folder

I developed an application with angular 4 for security reason and changing the template without compiling I am trying to find a way can change HTML and application use that. somehow I need to read HTML template files from an external folder and use that.
I tried to find a way, but unfortunately I could not get a direct answer I hope here I can found out is it any solution for that or not?
what I did are:
https://github.com/lacolaco/ng-dynamic
Load Angular2 template from external URL
Equivalent of $compile in Angular 2
Angular 4 Template Binding with ES6 Template String
Dynamically load HTML template in angular2
How to bind raw html in Angular2
Previously Angular were shipping angular-compiler in build (bundle js) for security reason they removed angular-compiler from bundle and reason is obvious that angular compiles code on build and there is no need to ship compiler. It creates extra overhead on your production site and also creates heavier bundle. So the answer is no. You cannot inject template from external source. Why not create a component and use condition to show your external html in this way?

Parsing HTML file that ERB template creates

I am new to ruby on rails. I understand that I can parse html documents using nokogiri. I need to write the html that the erb template creates to a file. Then I will parse that with nokogiri.
I can view the html that is created via Inspect Element in my web browser. This is all well and good, but I am at a loss as to how I can write this HTML to a readable / parse-able file in my local project?
Please try this one
ERB.new(#template.source).result

AngularJS: Bundle all partial views/templates for production

I wish to keep views as modular as possible. In practice it means I have lots of small generalized HTML snippets, from which the actual HTML page is composed. Now ng-include and custom directives with templateUrl suit me quite well, but only in development, because each HTML snippet is being requested separately.
In production, however, I expect a single page app to be, ummm, in a single page, all bundled and minified — just like the JavaScript module loaders (RequireJS, Component, Browserify, DuoJS, etc.) would do to modular JavaScript files. No extra HTTP traffic for loading HTML chunks is acceptable.
Now I'm pretty sure AngularJS does not do bundling out-of-the-box (I would've found it by now), but maybe you guys have come up with something to address this issue?
P.S. It should be noted that I am not looking for cache-related solutions.
you can use grunt-angularjs-template
it does concatenates all templates in one file. as per its docs
Grunt build task to concatenate & register your AngularJS templates in
the $templateCache
if you are using gulp, the gulp equivalent of it is gulp-angular-templatecache
If you’re using gulp then a good option would be gulp-angular-embed-templates

How can i transform Jade files into html?

I am starting with Node.js application, so I wanted to take some help from the existing solutions but in views their are always jade files what are they and how can i transform them to html easily?
You can use EJS for templating other then Jade which provide additional features of HTML. You can configure template on app.js of Express
At http://html2jade.org/ you can paste jade templates into the jade side (on the right) and it will convert it to html (on the left).
(N.B. this functionality does not exist on http://html2pug.org/)
To transform Jade code to Html, you have to install jade compiler in your system and then by using jade CLI you can convert your jade file to Html Read here, But if you not want to install it to system convert it online here Jade to Html Converter.

Generating static HTML files with Handlebars js

How would I use handlebars to pre-compile a template to html and save the resulting HTML as a static HTML file, is it possible to do this? Based on what I've been reading it isn't but I was hoping maybe there is a Grunt task or something I missed...
This that does what I was looking for
https://github.com/patrickkettner/grunt-compile-handlebars