Allows you to batch create JSPs or HTMLs ala Staticmatic style
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


BatchJHaml allows you to create JSP or XHTML files in one go.

Prerequisites :
  1.) Apache Commons IO
  2.) Apache Commons Lang
  3.) Guava 
  4.) JHaml
  5.) MarkdownJ
  6.) JUnit
Usage :
  1.) install ant
  2.) create a "lib" folder and put all jars mentioned above in there.
  3.) run "ant build" to compile the source and create a jar file.
  4.) create an "output" folder. This is where your jsps will be generated.
  5.) create a "haml" folder and a "layouts" folder inside the "haml" folder. This is where your haml files will sit.
  6.) modify the accordingly.
  6.) run "ant run" to convert your Haml files to jsp.
  7.) run "ant createJavaDoc" to generate java docs.
  8.) run "ant test" to run unit test
Note :
  - To use a custom layout for your Haml view, set the `@layout` variable at the beginning of the file: `- @layout = 'foo'`
  - To use the javascript helper, add `= javascripts 'foo'` in the %head
  - If you need custom javascripts for each page, add `= javascripts` in your layout's %head and for each page, add `- @javascripts 'foo','bar'`

Ant build.xml integration :
Add the following in your build.xml. Of course, you need to modify the xml accordingly.

<target name="compile-haml">
  <echo message="Converting haml files into jsp ..." />
  <java fork="true" classname="com.progriff.jhaml.BatchJHaml">
      <fileset dir="${library.home}">
        <include name="**/commons-io-*.jar" />
        <include name="**/commons-lang-*.jar" />
        <include name="**/guava-*.jar" />
        <include name="**/jhaml-*.jar" />
        <include name="**/markdownj-*.jar" />
      <path location="${library.home}/BatchJHaml.jar"/>
    <arg value="~/BatchJHaml/haml"/>
    <arg value="~/BatchJHaml/haml/layouts"/>
    <arg value="~/BatchJHaml/pages"/>
    <arg value="jsp"/>
    <arg value="~/BatchJHaml/javascripts"/>
    <arg value="~/BatchJHaml/stylesheets"/>
    <arg value="true"/> <!-- sets build recursively or not -->

Copyright (c) 2011 Benson Lim. See LICENSE for details.