Utilize the advanced features of Jade to create dynamic web pages and significantly decrease development timeAbout This BookMake your templates clean, beautiful, and reusableUse Jade best practices right from the startSuccessfully automate redundant markupWho This Book Is ForThis book is for web developers with at least a basic understanding of HTML and JavaScript. It will enable you to write an easier form of language that then compiles into HTML.
What You Will LearnWrite cleaner, indentation-based markupUse logical statements to format data for display on the WebAvoid repetition by eliminating redundant operationsDivide your templates into logical sections with blocksAvoid common organizational pitfalls when designing Jade-based projectsApply shorthand for brevityUtilize Jade for client-side templatesEmploy techniques like filters to quickly mock-up web pages in higher level languages like stylus or coffeescriptIn DetailJade is a template engine for node.js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.js, but it can also be used in a variety of other environments to produce XML-like documents such as HTML and RSS.
This practical, example-oriented guide will teach you how to write Jade, utilize its features, and recognize the best ways to organize templates in your projects. With this book, you will avoid the common pitfalls and issues with sparse documentation, allowing you to learn Jade faster and use it more effectively.
To understand Jade, we will first examine the reasons for its design and how these translate into a tool that can provide real benefits to you. You will develop confidence with each of the features of the language with the help of practical examples and thorough explanations. We will cover preprocessors, basic syntax, feeding data into templates, and incorporating logic. By the end of this book, you will be able to effectively use essential features such as filters and mixins as well as template inheritance through a block system. To tie it all together, we will also look at some of the best practices to follow when organizing your Jade projects.
Use this comprehensive guide to the Jade language to help you become a more efficient web developer.
Over the last two years I've been building commercial and open-source Node.js projects and I've been using the Jade template engine almost exclusively ever since.
That is why I've got so used with it that I now find writing plain old "vanilla" HTML code rather cumbersome and unproductive. That's also why, even since the early days of the project, I've introduced support for compiling Jade templates in ASPAX, arguably the simplest Node.js asset packager you can use.
Until recently I've been under the impression that there's not much more I can learn about it - until I found Sean's excellent book.
While the "official" Jade website is pretty good, this book will also give you, in Chapter 1, a brief overview of the current markup preprocessor engines landscape and a nice explanation of how Jade really works, in both pictures and code. It will also show you why Jade is so cool compared to other alternatives out there, due to its concision and clarity.
Chapters 2 through 7 will teach you everything about writing Jade code, starting with the basic syntax, working with data, flow control logic and even touching advanced topics like filters, mixins and template inheritance.
Chapter 8, undoubtedly one of the most valuable pieces of information in the book, will teach you how to structure the presentation-related code in your application.
So, if you're looking to become a professional JavaScript/Node.js developer or you already are one but you're looking for a well-written Jade reference to consolidate your skills, you should definitely have a look at "Web Development with Jade".