jade Getting started with jade - RIP Tutorial
文章推薦指數: 80 %
Learn jade - Pug (formerly known as jade) is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and.
Downloadjade(PDF)
jade
Gettingstartedwithjade
Attributes
Case
harpjs
jade
Gettingstartedwithjade
Attributes
Case
harpjs
jade
Gettingstartedwithjade
Remarks
Pug(formerlyknownasjade)isahighperformancetemplateengineheavilyinfluencedbyHamlandimplementedwithJavaScriptforNode.jsandbrowsers.
ProducesHTML
Supportsdynamiccode
Supportsreusability(DRY)
Homepage
RepositoryonGitHub
Versions
versionreleasedate0.0.22010-07-031.0.02013-12-221.11.02015-06-12
InstallationorSetup
BeforetolaunchyoutocodewithPug,youneedtohavesomeprerequisits.
Youwillneedtoinstall:
NodeJSwithNPM
ExpressJS(optional)
AfterinstallingNodeJS,youcancheckinyourterminalthecorrectinstallationdoing:
$node-v
Ifsuccessful,itwillprintthenumberofNode'sversion.
ToinstallPugintoyourproject,thepreferredandeasywayisthroughNPM(NodePackageManager).Ifyouarefamiliarwiththat,simplyexecutethislineofcodeinyourTerminal:
$npminstallpug
Ifyouwanttoinstallglobally,youcantype:
$npminstallpug-cli-g
andrunwith
$pug--help
Syntax
Pug(oldnameisJade)isaclean,whitespacesensitivesyntaxforwritingHTML.Hereisasimpleexample:
doctypehtml
html(lang="en")
head
title=pageTitle
script(type='text/javascript').
if(foo)bar(1+5)
body
h1Pug-nodetemplateengine
#container.col
ifyouAreUsingPug
pYouareamazing
else
pGetonit!
p.
Pugisaterseandsimpletemplatinglanguagewitha
strongfocusonperformanceandpowerfulfeatures.
ProducesfollowingoutputasHTML
Youareamazing Pugisaterseandsimpletemplatinglanguagewithastrongfocusonperformanceandpowerfulfeatures.Pug-nodetemplateengine
HerearetherulestorenderPugtoHTMLcode:
Byindentingthetext,theHTMLtreewillbebuild.indentingcouldbeusedwithspacesortabs.Thiscouldnotbemixed!
HTMLtagsarewrittenwithout
延伸文章資訊
- 1Tutorials & Guides | Jade Site - Java Agent DEvelopment ...
Tutorials & Guides. Basic Documentation. Introduction to JADE · JADE Administration Tutorial by R...
- 2jade Getting started with jade - RIP Tutorial
Learn jade - Pug (formerly known as jade) is a high performance template engine heavily influence...
- 3JADE Tutorial and Primer - Université de Montréal
This tutorial concentrates on the basic features of Jade and explains these in detail with many s...
- 4Jade Template Engine - TutorialsTeacher
In this section, you will learn how to use Jade template engine in Node.js application using Expr...
- 5JADE Tutorial
Administering the JADE agent platform. 4. Identifying the building blocks for an agent programmin...