Permalink
Browse files

Filter docs

  • Loading branch information...
1 parent 01f4f62 commit e10486733a28395908c3a67205a15d7081c41847 @tj tj committed Jul 1, 2010
Showing with 25 additions and 0 deletions.
  1. +16 −0 Readme.md
  2. +4 −0 examples/markdown.jade
  3. +5 −0 examples/run.js
View
@@ -13,6 +13,7 @@
- executable for compiling jade templates via the command line
- html 5 mode (using the _!!! 5_ doctype)
- optional memory caching
+ - combine dynamic and static tag classes
- no tag prefix
- filters
- :sass
@@ -177,6 +178,21 @@ defined by default, which can easily be extended:
'mobile': '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'
};
+## Filters
+
+Filters are prefixed with `:`, for example `:markdown` and
+pass the following block of text to an arbitrary function for processing. View the _features_
+at the top of this document for available filters.
+
+ body
+ :markdown
+ | Woah! jade _and_ markdown, very **cool**
+ | we can even link to [stuff](http://google.com)
+
+Renders:
+
+ <body><p>Woah! jade <em>and</em> markdown, very <strong>cool</strong> we can even link to <a href="http://google.com">stuff</a></p></body>
+
## bin/jade
Output html to _stdout_:
View
@@ -0,0 +1,4 @@
+body
+ :markdown
+ | Woah! jade _and_ markdown, very **cool**
+ | we can even link to [stuff](http://google.com)
View
@@ -24,4 +24,9 @@ jade.renderFile(__dirname + '/users.jade', { locals: { users: users }}, function
jade.renderFile(__dirname + '/interpolation.jade', { locals: { name: 'tj', email: 'tj@vision-media.ca' }}, function(err, html){
if (err) throw err;
sys.puts('\x1b[1minterpolation.jade:\x1b[0m', html, '');
+});
+
+jade.renderFile(__dirname + '/markdown.jade', function(err, html){
+ if (err) throw err;
+ sys.puts('\x1b[1mmarkdown.jade:\x1b[0m', html, '');
});

0 comments on commit e104867

Please sign in to comment.