Posted in Interesting, Open Source, Programming, Web Tech

Pug.js

What is pug.js?

Pug.js a HTML template engine for Node.js. You can write a simple pug code which the compiler will compile it to HTML code and later on browser will render it.

How does pug code differ from html code?

Pug code is a crisp piece of code which looks like a paragraph which helps in readability. Pug supports JavaScript, so using JavaScript expressions, we can format HTML code. HTML code is consists of tags and Pug also uses same tags. But pug doesn’t have closing tags.

Some thoughts…

Since pug comes as a npm package we can run using browser or on node.js using cli. One should take care of white space while writing pug code, because it can cost a big time.

 

Posted in Interesting, Programming, Web Tech

Quirks mode & Standard mode

Quirk in general means peculiarity or characteristic. In order to maintain backward compatibility for web pages designed for older versions of some of the browsers which does not comply to standards of W3C(World Wide Web Consortium )and IETF(Internet Engineering Task Force). Its a non-standard mode.

The recent browser follow a standard mode which complies with W3C wherein the behaviour is as per HTML and CSS specifications. For HTML documents browsers use a DOCTYPE at the beginning of the document for handling the webpage in standard mode. <!DOCTYPE html> provides the purpose of activating the full standard mode.