Web Development with Jade
By Seán Lang
()
About this ebook
This 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.
Read more from Seán Lang
European History for Dummies Rating: 3 out of 5 stars3/5Twentieth Century History For Dummies Rating: 3 out of 5 stars3/5British History For Dummies Rating: 0 out of 5 stars0 ratings
Related to Web Development with Jade
Related ebooks
Getting Started with React Native Rating: 4 out of 5 stars4/5Instant Jsoup How-to Rating: 0 out of 5 stars0 ratingsClean Code in JavaScript: Develop reliable, maintainable, and robust JavaScript Rating: 5 out of 5 stars5/5Advanced Express Web Application Development Rating: 0 out of 5 stars0 ratingsImplementing AppFog Rating: 0 out of 5 stars0 ratingsWeb App Testing Using Knockout.JS Rating: 0 out of 5 stars0 ratingsInstant Apache Stanbol Rating: 0 out of 5 stars0 ratingsJasmine JavaScript Testing - Second Edition Rating: 0 out of 5 stars0 ratingsInstant Java Password and Authentication Security Rating: 0 out of 5 stars0 ratingsBuilding Web Applications with Flask Rating: 0 out of 5 stars0 ratingsExpress Web Application Development Rating: 3 out of 5 stars3/5WildFly: New Features Rating: 0 out of 5 stars0 ratingsIntroduction to JVM Languages Rating: 0 out of 5 stars0 ratingsMastering Python Design Patterns Rating: 0 out of 5 stars0 ratingsBuilding Slack Bots Rating: 0 out of 5 stars0 ratingsOpa Application Development Rating: 0 out of 5 stars0 ratingsJavaScript Projects for Kids Rating: 0 out of 5 stars0 ratingsMeteor Design Patterns Rating: 0 out of 5 stars0 ratingsNode.js High Performance Rating: 0 out of 5 stars0 ratingsLearning Swift Rating: 5 out of 5 stars5/5Building a Web Application with PHP and MariaDB: A Reference Guide Rating: 0 out of 5 stars0 ratingsGetting Started with PhantomJS Rating: 0 out of 5 stars0 ratingsInstant RubyMine Assimilation Rating: 0 out of 5 stars0 ratingsTypeScript Essentials Rating: 4 out of 5 stars4/5JavaScript and JSON Essentials Rating: 5 out of 5 stars5/5Gradle Dependency Management Rating: 0 out of 5 stars0 ratingsAndroid Application Programming with OpenCV Rating: 3 out of 5 stars3/5Mastering Clojure Rating: 0 out of 5 stars0 ratingsLearning Shell Scripting with Zsh Rating: 0 out of 5 stars0 ratingsLearning HTML5 by Creating Fun Games Rating: 4 out of 5 stars4/5
Internet & Web For You
No Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5How to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsSocial Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5Coding For Dummies Rating: 5 out of 5 stars5/5How to Be Invisible: Protect Your Home, Your Children, Your Assets, and Your Life Rating: 4 out of 5 stars4/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5The Gothic Novel Collection Rating: 5 out of 5 stars5/5Get Rich or Lie Trying: Ambition and Deceit in the New Influencer Economy Rating: 0 out of 5 stars0 ratingsCoding All-in-One For Dummies Rating: 4 out of 5 stars4/5200+ Ways to Protect Your Privacy: Simple Ways to Prevent Hacks and Protect Your Privacy--On and Offline Rating: 0 out of 5 stars0 ratingsPodcasting For Dummies Rating: 4 out of 5 stars4/5Hacking : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Ethical Hacking Rating: 5 out of 5 stars5/5Remote/WebCam Notarization : Basic Understanding Rating: 3 out of 5 stars3/5Beginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratingsMore Porn - Faster!: 50 Tips & Tools for Faster and More Efficient Porn Browsing Rating: 3 out of 5 stars3/5The Cyber Attack Survival Manual: Tools for Surviving Everything from Identity Theft to the Digital Apocalypse Rating: 0 out of 5 stars0 ratingsThe Digital Marketing Handbook: A Step-By-Step Guide to Creating Websites That Sell Rating: 5 out of 5 stars5/5The Logo Brainstorm Book: A Comprehensive Guide for Exploring Design Directions Rating: 4 out of 5 stars4/5The Internet Is Not What You Think It Is: A History, a Philosophy, a Warning Rating: 4 out of 5 stars4/5How To Start A Podcast Rating: 4 out of 5 stars4/5How to Destroy Surveillance Capitalism Rating: 4 out of 5 stars4/5Introduction to Internet Scams and Fraud: Credit Card Theft, Work-At-Home Scams and Lottery Scams Rating: 4 out of 5 stars4/5
Reviews for Web Development with Jade
0 ratings0 reviews
Book preview
Web Development with Jade - Seán Lang
Table of Contents
Web Development with Jade
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. What is Jade?
Markup like poetry
Why should I preprocess?
How Jade preprocesses
Comparison with other preprocessors
HAML
PHP
Jinja2
Mustache
Installation instructions
Compiling Jade
Summary
2. Basic Syntax
Significance of whitespace
Tags
Text and blocks of text
Text on the same line
Text blocks
Shorthand text blocks
Inline HTML
Attributes
Passing objects as attributes
Shorthands
IDs and classes
Automatic div
Comments
Single line
Block comments
Block expansion
Doctypes
Summary
3. Feeding Data into Templates
Syntax
Defining variables
Interpolation everywhere!
Using variables without interpolation
Escaping
Sending the variables to the compiler
Compiler arg
Programmatically
Summary
4. Logic in Templates
Adding logic with JavaScript
If/else
For loops
Complex operations
Built-in logical operators
If / else / else if
Unless
Cases
Each loops
While loops
A warning about interpolation
Summary
5. Filters
The full list
Template engines
Stylesheet languages
Minifiers
Others
Examples
Markdown
CoffeeScript
Stylus
Passing arguments
Summary
6. Mixins
Syntax and mechanics
Defining mixins
Calling mixins
Passing blocks
Another warning about interpolation
The arguments object
Summary
7. Template Inheritance
Blocks
Blocks don't provide encapsulation
Extends
Replace
Append
Prepend
Incompatibility
Extra things in extenders
Includes
Static
Filtered
Jade
Summary
8. Organizing Jade Projects
General best practices
Keeping logic out of templates
Inlining
Minification
Removing style-induced redundancy
Semantic divisions
Server-side versus client-side rendering
Client-side rendering
Server-side rendering
Build systems
Summary
A Closing Note – Contributing Back to Jade
Index
Web Development with Jade
Web Development with Jade
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2014
Production Reference: 1200314
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-635-5
www.packtpub.com
Cover Image by Aniket Sawant (<aniket_sawant_photography@hotmail.com>)
Credits
Author
Sean Lang
Reviewers
Fco. Javier Velasco Arjona
Dan Williams
Acquisition Editor
Sam Birch
Content Development Editor
Shaon Basu
Technical Editor
Dennis John
Copy Editors
Gladson Monteiro
Sayanee Mukherjee
Janbal Dharmaraj
Mradula Hegde
Kirti Pai
Adithi Shetty
Project Coordinator
Akash Poojary
Proofreader
Simran Bhogal
Indexer
Tejal R. Soni
Graphics
Yuvraj Mannari
Production Coordinator
Kyle Albuquerque
Cover Work
Kyle Albuquerque
About the Author
Sean Lang attends the Milwaukee School of Engineering; he is currently majoring in software engineering. Even though he is a freshman there, he is by no means new to the field. He has been teaching himself software development for the last four years, and during this time, he has done extensive volunteer work for open source software projects. These include roots (a toolkit for building web apps), the Jade template engine, nib (a set of utilities for advanced web page styling), and a myriad of smaller projects. In addition to this, he has been doing freelance web designing and consulting, which is especially convenient