You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.7 KiB

  1. # Jade Plugin for DocPad
  2. Adds support for the [Jade](http://jade-lang.com/) templating engine to [DocPad](https://docpad.org)
  3. Convention: `.anything.jade`
  4. ## Install
  5. ```
  6. npm install --save docpad-plugin-jade
  7. ```
  8. ## Usage
  9. ### Template Helpers as Filters
  10. Use just like any jade template. However, we do add any docpad template helpers you may have as jade filters. There are two ways you can use these filters:
  11. ``` jade
  12. -# first way, calls the template helper like: myTemplateHelper("content", {opt1="blah",opt2="blah",opt3=true})
  13. :myTemplateHelper(opt1=blah,opt2=blah,opt3)
  14. content
  15. -# second way, calls the template helper like: myTemplateHelper(arg1, arg2)
  16. :myTemplateHelper(args)
  17. arg1
  18. arg2
  19. ```
  20. NOTE: Not all template helpers support being called this way. If it doesn't work, we'd recommend using the text plugin to render eco which includes your template helper call. See following section.
  21. ### Rendering with the Text Plugin
  22. You can use the [text plugin](http://docpad.org/plugin/text) to render different parts of your template with different markups that are support by your docpad setup. Once installed, you can do things like:
  23. ``` jade
  24. :t(render="markdown")
  25. here is some *markdown*
  26. :t(render="html.md.eco")
  27. here is some <%-'eco'.toUpperCase()%> to *markdown* to html
  28. :t(render="html.eco")
  29. my url is <%-@document.url%>
  30. ```
  31. ## History
  32. You can discover the history inside the `History.md` file
  33. ## License
  34. Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT License](http://creativecommons.org/licenses/MIT/)
  35. <br/>Copyright &copy; 2012+ [Bevry Pty Ltd](http://bevry.me)
  36. <br/>Copyright &copy; 2011 [Benjamin Lupton](http://balupton.com)