How to integrate view engines like SWIG, EJS, JADE etc in total.Js

184 views
Skip to first unread message

Dave Alex

unread,
Apr 8, 2014, 8:03:05 AM4/8/14
to tot...@googlegroups.com
How can we integrate  view engiens like SWIG, EJS, JADE etc in total.Js. Is there any example relating to this?

Peter Širka

unread,
Apr 8, 2014, 8:08:29 AM4/8/14
to tot...@googlegroups.com
Hi Dave,
here is implementation of JADE and SWIG: https://github.com/totaljs/modules/

Thanks

Eugene De Klerk

unread,
Aug 11, 2014, 8:07:09 AM8/11/14
to tot...@googlegroups.com
Hi Peter

Im completely new to total.js and jade. I have been trying to run the example from github without any success. 

What i do:
Create folder on my hard drive say "c:\test"
Then in the command promt i do "c:\test> total" which creates the directories folders and installs total.js
I then follow the instructions on github
"c:\test> npm install total.js"
"c:\test> npm install jade"

Then i copy the jade.js file from "the c:\test\node_modules\jade" folder to a folder created by myself called "modules"
With all of this done i ran the server and got the default hello world screen from total.js
I then created a new file in the views folder called jadetest.jade with the following content

html
  head
   h1 Test Site
  body
   h1 Test Site

in the default controller i change self.view('homepage'); to self.view('jadetest');

with this done i get a server error

view "jadetest" not found. 

Is there anywhere i should be setting something in total.js that would tell it that im using jade or anything else im missing.
Im sure this is not very complicated but i can not find a single complete example or help. 

Peter Širka

unread,
Aug 11, 2014, 12:26:31 PM8/11/14
to tot...@googlegroups.com
Hi Eugene,
you must download a module with Jade for total.js, because total.js has own view engine.

Read here:

Please give me a feedback.
Thanks.
Reply all
Reply to author
Forward
0 new messages