Has anyone got an example of a jade template and markdown working
together?
This is my app code
/**
* Module dependencies.
*/
var express = require('express'),
connect = require('connect'),
markdown = require('./lib/markdown-js/lib/markdown');
// Create and export Express app
var app = express.createServer();
// Configuration
app.configure(function(){
app.set('views', __dirname + '/views');
app.use(connect.bodyDecoder());
app.use(connect.methodOverride());
app.use(connect.compiler({ src: __dirname + '/public', enable:
['sass'] }));
app.use(connect.staticProvider(__dirname + '/public'));
});
app.configure('development', function(){
app.set('reload views', 1000);
app.use(connect.errorHandler({ dumpExceptions: true, showStack:
true }));
});
app.configure('production', function(){
app.use(connect.errorHandler());
});
// Routes
app.get('/', function(req, res){
res.render('index.jade', {
locals: {
title: 'Express'
}
});
});
app.listen(3000);
and my jade file is
h1= title
p Welcome to #{title}
:markdown
| Woah! Jade _and_ markdown, very **cool**
form
label(for='email') Email
div.form_part
p
input(type='email', id='email', name='email')
label(for='password') Password
div.form_part
p
input(type='password', id='password', name='password')
but I get the error
Connect
500 Error: /Users/jakescott/express/forms/views/index.jade:8 6. '' 7.
'' 8. 'form' Cannot find module 'markdown'
* 6. ''
* 7. ''
* 8. 'form'
*
* Cannot find module 'markdown'
* at loadModule (module:238:15)
* at require (module:364:12)
* at /Users/jakescott/.node_libraries/jade.js:116:18
* at Object.parseFilter (/Users/jakescott/.node_libraries/jade.js:
444:35)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
393:29)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
421:38)
* at Object.parseExpr (/Users/jakescott/.node_libraries/jade.js:
421:38)
* at Object.parse (/Users/jakescott/.node_libraries/jade.js:
353:27)
* at parse (/Users/jakescott/.node_libraries/jade.js:729:29)
* at Object.render (/Users/jakescott/.node_libraries/jade.js:
771:14)
On Jul 25, 7:14 pm, Jake Scott <
jake....@gmail.com> wrote:
> Oh sorry dont worry about answering that one I just saw the blog example.
>
> On Sun, Jul 25, 2010 at 7:00 PM, Jake Scott <
jake....@gmail.com> wrote:
> > Hi TJ thanks for the reply - Is there an example of some code of how to do
> > this? - I'm only just learning node and express.
>
> > On Sat, Jul 24, 2010 at 5:59 PM, vision media [ Tj Holowaychuk ] <
> >
t...@vision-media.ca> wrote:
>
> >> they just need to available to require(), so either:
>
> >> - npm install sass
> >> - clone the sass repo to ~/.node_libraries
> >> - submodule the library in your app and require.paths.unshift() the lib
> >> directory to expose it
>
> >> I have had people suggest bundling these with express, but I dont
> >> want to bundle every potentially useful module with express so it
> >> is a bit of a trade off.
>
> >> On Sat, Jul 24, 2010 at 8:06 AM, jakescott <
jake....@gmail.com> wrote:
>
> >>> I followed the instructions by installing like this:
> >>> curl -#
http://expressjs.com/install.sh| sh
>
> >>> I can use the $ express to generate a new app.
>
> >>> I can render the page but the css is returning a 500 internal server
> >>> error
> >>> Error: Cannot find module 'sass'
> >>> at module:249:21
> >>> at findModulePath (module:119:7)
> >>> at searchLocations (module:151:14)
> >>> at module:160:18
> >>> at path:79:19
> >>> at node.js:255:9
>
> >>> Would somebody be able to describe how to include other modules such
> >>> as sass.js and markdown-js. It would be good to know how to install by
> >>> cloning from Github and where we need to place these files.
>
> >>> Cheers
> >>> Jake
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Express" group.
> >>> To post to this group, send email to
expre...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>>
express-js+...@googlegroups.com<
express-js%2Bunsu...@googlegroups.com>
> >>> .
> >>> For more options, visit this group at
> >>>
http://groups.google.com/group/express-js?hl=en.
>
> >> --
> >> Tj Holowaychuk
> >> Vision Media
> >> President & Creative Lead
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Express" group.
> >> To post to this group, send email to
expre...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >>
express-js+...@googlegroups.com<
express-js%2Bunsu...@googlegroups.com>
> >> .