a pug implementation written in Java (formerly known as jade)

Related tags

Utility jade4j
Overview

Build Status

Attention: jade4j is now pug4j

In alignment with the javascript template engine we renamed jade4j to pug4j. You will find it under https://github.com/neuland/pug4j This is also a new release which supports almost the entire pug 2 syntax.

Please report pug4j issues in the new repository.

jade4j - a jade implementation written in Java

jade4j's intention is to be able to process jade templates in Java without the need of a JavaScript environment, while being fully compatible with the original jade syntax.

Contents

Example

index.jade

doctype html
html
  head
    title= pageName
  body
    ol#books
      for book in books
        if book.available
          li #{book.name} for #{book.price} €

Java model

List<Book> books = new ArrayList<Book>();
books.add(new Book("The Hitchhiker's Guide to the Galaxy", 5.70, true));
books.add(new Book("Life, the Universe and Everything", 5.60, false));
books.add(new Book("The Restaurant at the End of the Universe", 5.40, true));

Map<String, Object> model = new HashMap<String, Object>();
model.put("books", books);
model.put("pageName", "My Bookshelf");

Running the above code through String html = Jade4J.render("./index.jade", model) will result in the following output:

<!DOCTYPE html>
<html>
  <head>
    <title>My Bookshelf</title>
  </head>
  <body>
    <ol id="books">
      <li>The Hitchhiker's Guide to the Galaxy for 5,70 €</li>
      <li>The Restaurant at the End of the Universe for 5,40 €</li>
    </ol>
  </body>
</html>

Syntax

We have put up an interactive jade documentation.

See also the original visionmedia/jade documentation.

Usage

via Maven

As of release 0.4.1, we have changed maven hosting to sonatype. Using Github Maven Repository is no longer required.

Please be aware that we had to change the group id from 'de.neuland' to 'de.neuland-bfi' in order to meet sonatype conventions for group naming.

Just add following dependency definitions to your pom.xml.

<dependency>
  <groupId>de.neuland-bfi</groupId>
  <artifactId>jade4j</artifactId>
  <version>1.3.2</version>
</dependency>

Build it yourself

Clone this repository ...

git clone https://github.com/neuland/jade4j.git

... build it using maven ...

cd jade4j
mvn install

... and use the jade4j-1.x.x.jar located in your target directory.

Simple static API

Parsing template and generating template in one step.

String html = Jade4J.render("./index.jade", model);

If you use this in production you would probably do the template parsing only once per template and call the render method with different models.

JadeTemplate template = Jade4J.getTemplate("./index.jade");
String html = Jade4J.render(template, model);

Streaming output using a java.io.Writer

Jade4J.render(template, model, writer);

Full API

If you need more control you can instantiate a JadeConfiguration object.

JadeConfiguration config = new JadeConfiguration();

JadeTemplate template = config.getTemplate("index");

Map<String, Object> model = new HashMap<String, Object>();
model.put("company", "neuland");

config.renderTemplate(template, model);

Caching

The JadeConfiguration handles template caching for you. If you request the same unmodified template twice you'll get the same instance and avoid unnecessary parsing.

JadeTemplate t1 = config.getTemplate("index.jade");
JadeTemplate t2 = config.getTemplate("index.jade");
t1.equals(t2) // true

You can clear the template and expression cache by calling the following:

config.clearCache();

For development mode, you can also disable caching completely:

config.setCaching(false);

Output Formatting

By default, Jade4J produces compressed HTML without unneeded whitespace. You can change this behaviour by enabling PrettyPrint:

config.setPrettyPrint(true);

Jade detects if it has to generate (X)HTML or XML code by your specified doctype.

If you are rendering partial templates that don't include a doctype jade4j generates HTML code. You can also set the mode manually:

config.setMode(Jade4J.Mode.HTML);   // <input checked>
config.setMode(Jade4J.Mode.XHTML);  // <input checked="true" />
config.setMode(Jade4J.Mode.XML);    // <input checked="true"></input>

Filters

Filters allow embedding content like markdown or coffeescript into your jade template:

script
  :coffeescript
    sayHello -> alert "hello world"

will generate

<script>
  sayHello(function() {
    return alert("hello world");
  });
</script>

jade4j comes with a plain and cdata filter. plain takes your input to pass it directly through, cdata wraps your content in <![CDATA[...]]>. You can add your custom filters to your configuration.

config.setFilter("coffeescript", new CoffeeScriptFilter());

To implement your own filter, you have to implement the Filter Interface. If your filter doesn't use any data from the model you can inherit from the abstract CachingFilter and also get caching for free. See the neuland/jade4j-coffeescript-filter project as an example.

Helpers

If you need to call custom java functions the easiest way is to create helper classes and put an instance into the model.

public class MathHelper {
    public long round(double number) {
        return Math.round(number);
    }
}
model.put("math", new MathHelper());

Note: Helpers don't have their own namespace, so you have to be careful not to overwrite them with other variables.

p= math.round(1.44)

Model Defaults

If you are using multiple templates you might have the need for a set of default objects that are available in all templates.

Map<String, Object> defaults = new HashMap<String, Object>();
defaults.put("city", "Bremen");
defaults.put("country", "Germany");
defaults.put("url", new MyUrlHelper());
config.setSharedVariables(defaults);

Template Loader

By default, jade4j searches for template files in your work directory. By specifying your own FileTemplateLoader, you can alter that behavior. You can also implement the TemplateLoader interface to create your own.

TemplateLoader loader = new FileTemplateLoader("/templates/", "UTF-8");
config.setTemplateLoader(loader);

Expressions

The original jade implementation uses JavaScript for expression handling in if, unless, for, case commands, like this

- var book = {"price": 4.99, "title": "The Book"}
if book.price < 5.50 && !book.soldOut
  p.sale special offer: #{book.title}

each author in ["artur", "stefan", "michael"]
  h2= author

As of version 0.3.0, jade4j uses JEXL instead of OGNL for parsing and executing these expressions.

We decided to switch to JEXL because its syntax and behavior is more similar to ECMAScript/JavaScript and so closer to the original jade.js implementation. JEXL runs also much faster than OGNL. In our benchmark, it showed a performance increase by factor 3 to 4.

We are using a slightly modified JEXL version which to have better control of the exception handling. JEXL now runs in a semi-strict mode, where non existing values and properties silently evaluate to null/false where as invalid method calls lead to a JadeCompilerException.

Reserved Words

JEXL comes with the three builtin functions new, size and empty. For properties with this name the . notation does not work, but you can access them with [].

- var book = {size: 540}
book.size // does not work
book["size"] // works

You can read more about this in the JEXL documentation.

Framework Integrations

Breaking Changes

1.3.1

  • Fixed a mayor scoping bug in loops. Use this version and not 1.3.0

1.3.0

  • setBasePath has been removed from JadeConfiguration. Set folderPath on FileTemplateLoader instead.
  • Scoping of variables in loops changed, so its more in line with jade. This could break your template.

1.2.0

  • Breaking change in filter interface: if you use filters outside of the project, they need to be adapted to new interface

1.0.0

In Version 1.0.0 we added a lot of features of JadeJs 1.11. There are also some Breaking Changes:

  • Instead of 'id = 5' you must use '- var id = 5'
  • Instead of 'h1(attributes, class = "test")' you must use 'h1(class= "test")&attributes(attributes)'
  • Instead of '!!! 5' you must use 'doctype html'
  • Jade Syntax for Conditional Comments is not supported anymore
  • Thanks to rzara for contributing to issue-108

Authors

Special thanks to TJ Holowaychuk the creator of jade!

License

The MIT License

Copyright (C) 2011-2019 neuland Büro für Informatik, Bremen, Germany

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Jade compiler exception on strings containing comma

    Jade compiler exception on strings containing comma

    I get jade compiler exception when calling method with string parameter containing comma (,) charracter:

    Jade Compiler Exception - unable to evaluate ['a] - Tokenization de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression@1:3 tokenization error in ''a'

    Try to compile following example:

    mixin test(text)
          div= text
    
        mixin test('a,b')
    

    version: 0.4.0

    Thx for fix.

    opened by dusanmsk 14
  • is comma not optional in the attribute list?

    is comma not optional in the attribute list?

    according to the demo site, http://naltatis.github.io/jade-syntax-docs/, comma between attributes is optional, so something like this should be valid: a(href="#" name="blue") but when I try it, I get an exception: de.neuland.jade4j.exceptions.ExpressionException: unable to evaluate ["#" name="blue"] - Parsing "blue"@1:43 parsing error near '... en express ...' at de.neuland.jade4j.expression.ExpressionHandler.evaluateExpression

    unless I add a comma between the attributes like this a(href="#", name="blue")

    Is this intended behavior, or am I doing something wrong? Cheers, Reza

    enhancement 
    opened by ralemy 9
  • jade4j compilation issue

    jade4j compilation issue

    Hi,

    Environment: Windows 7.

    I have downloaded jade4j code. But when I build the code even without change "de.neuland.jade4j.compiler.OriginalJadeTest" test case fails with error

    Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 2.

    Rgds - Sidd

    opened by siddhartharoy 9
  • Can't build on Windows

    Can't build on Windows

    I tried to build it on a windows computer, but the tests fails. This is not an issue for me, but I just wanted to post it anyway.

    It seems that the code relies somewhat on unix-paths - especially the ability to 1) concatenate 2 paths and 2) use the path directly in a URI.create() call.

    1) Concatenating windows paths become stuff like 'C:\folder\folder\C:\folder\folder\folder\file

    2) URI.create does not like uri's like 'C:\folder\file' unless it is prepended with something like 'file:/' resulting in file:/C:/folder/file

    I tried on windows XP with JDK 1.6.24.

    bug 
    opened by michaelkrog 9
  • String interpolation in attributes string differs from Jade

    String interpolation in attributes string differs from Jade

    Hi,

    string interpolation in attribute strings seems to differ substantial from the implementation in Jade 1.11.

    # results from http://jade-lang.com/ 
    
    mixin testMixin()
      h1.test&attributes(attributes)
    
    - var foo = "qux"
    - var bar = "quux"
    - foobar = "#{foo}-#{bar}"
    
    # v1
    +testMixin()(class="#{foobar}") 
    # result: <h1 class="test #{foo}-#{bar}"></h1> – Works in jade4j, but not in Jade 
    
    # v2 
    +testMixin()(class=foobar)   
    # result: <h1 class="test #{foo}-#{bar}"></h1> – Works in jade4j, but not in Jade
    
    # v3
    +testMixin()(class="#{foo}-#{bar}")
    # result: <h1 class="test qux-quux"></h1>  – Works in Jade, but not in jade4j
    
    

    This is crucial, because there's no version that works in Jade an jade4j simultaneously. V3 seems to be the only working notation in the current Jade implementation, jade4j needs the syntax of v2.

    Please drop me a line if I'm wrong or missed another notation for that purpose.

    wontfix 
    opened by erotte 7
  • Variable assignments in for/each loops

    Variable assignments in for/each loops

    Hello, please consider the following dummy code:

    - var books = ["A", "B", "C"]
    - var foo = false
    each book in books
      - foo = true
    
    p= foo
    

    According to your interactive jade documentation, the expected ouput is: <p>true</p> Although, the received output in Jade4J is: <p>false</p>

    I know JEXL is not quite the same as what your interactive documentation uses, so what would be the correct piece of code to retrieve true?

    Thank you.

    PS: I worked around it by injecting other variables in Java, or using Helper classes, but I'd rather have it work in the template files if it is supposed to.

    enhancement 
    opened by adrogon 6
  • Potential indentation issue

    Potential indentation issue

    I'm not sure if this is a bug or just me doing something wrong. I have a Jade template that uses tabs and I've verified that there are no spaces. The first line is not indented at all. When the template gets parsed, I get an error:

    class de.neuland.jade4j.exceptions.JadeLexerException layout:3 invalid indentation; expecting 0 spaces at de.neuland.jade4j.lexer.Lexer.indent(Lexer.java:652) at de.neuland.jade4j.lexer.Lexer.next(Lexer.java:152) at de.neuland.jade4j.lexer.Lexer.lookahead(Lexer.java:192) at de.neuland.jade4j.parser.Parser.lookahead(Parser.java:726) at de.neuland.jade4j.parser.Parser.parseTag(Parser.java:462) at de.neuland.jade4j.parser.Parser.parseExpr(Parser.java:116) at de.neuland.jade4j.parser.Parser.parse(Parser.java:97) at de.neuland.jade4j.parser.Parser.parse(Parser.java:105) at de.neuland.jade4j.JadeConfiguration.createTemplate(JadeConfiguration.java:88) at de.neuland.jade4j.JadeConfiguration.getTemplate(JadeConfiguration.java:60)

    opened by ebordeau 6
  • Allow

    Allow "- var" and "-" statements for declaring variables within templates

    Currently, there isn't any support for - var someVar = "someString" or - someVar = "someString" statements. They must be someVar = "someString". This breaks compatibility with the official Jade library. So to remedy this issue, a RegEx replace statement has been added that looks for the - var or - statements, removes them, and lets the Scanner continue on normally.

    opened by larsonjj 5
  • Self Closing tags

    Self Closing tags

    I was wondering if there was a way to create a self closing tag when generating my XML...

    ex.

    I would expect to write something like this in my template (with a trailing forward slash)

    Person(firstName='Bob')(lastName='Smith')/

    but it outputs:

    /

    opened by ckarawani 5
  • Spurious invalid indentation exception

    Spurious invalid indentation exception

    When compiling the following template:

    .sidebar-placeholder
        h1 Sidebar Empty
        p.lead
          | The sidebar is used when selecting certain objects or operations
          | in the main user interface. It will open when needed,
          | and can be closed using the
          button
            i.icon-chevron-left
          |  button.
    

    which is (I believe) valid; I get an "invalid indentation" exception on line 4.

    I've pasted the same text into http://naltatis.github.io/jade-syntax-docs/ and it generates my expected HTML output.

    opened by hlship 5
  • JadeParserException with simple template

    JadeParserException with simple template

    With a jade template of:

    a.myclass= user.name
      b.anotherclass
    

    I get the following exception (assume I am passing in a valid value for user):

    Exception in thread "main" class de.neuland.jade4j.exceptions.JadeParserException helloworld:2
    expected class de.neuland.jade4j.lexer.token.Block but got class de.neuland.jade4j.lexer.token.Indent
        at de.neuland.jade4j.parser.Parser.expect(Parser.java:733)
        at de.neuland.jade4j.parser.Parser.parseBlock(Parser.java:245)
        at de.neuland.jade4j.parser.Parser.parseCode(Parser.java:635)
        at de.neuland.jade4j.parser.Parser.parseTag(Parser.java:481)
        at de.neuland.jade4j.parser.Parser.parseExpr(Parser.java:110)
        at de.neuland.jade4j.parser.Parser.parse(Parser.java:91)
        at de.neuland.jade4j.JadeConfiguration.createTemplate(JadeConfiguration.java:86)
        at de.neuland.jade4j.JadeConfiguration.getTemplate(JadeConfiguration.java:58)
        at JadeTest.main(JadeTest.java:32)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    

    The test runner for this is as basic as can be:

    public static void main(String... args) throws Exception {
          final Map<String,Object> params = new HashMap<String, Object>();
          params.put("user", new User("Nesbitt", "23"));
    
          WL(Jade4J.render("z:/dev/jade/src/main/resources/templates/helloworld.jade", params));
       }
    
       public static void WL(String s) {
          System.out.println(s);
       }
    
    opened by briannesbitt 5
  • Bump gson from 2.5 to 2.8.9

    Bump gson from 2.5 to 2.8.9

    Bumps gson from 2.5 to 2.8.9.

    Release notes

    Sourced from gson's releases.

    Gson 2.8.9

    • Make OSGi bundle's dependency on sun.misc optional (#1993).
    • Deprecate Gson.excluder() exposing internal Excluder class (#1986).
    • Prevent Java deserialization of internal classes (#1991).
    • Improve number strategy implementation (#1987).
    • Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990).
    • Support arbitrary Number implementation for Object and Number deserialization (#1290).
    • Bump proguard-maven-plugin from 2.4.0 to 2.5.1 (#1980).
    • Don't exclude static local classes (#1969).
    • Fix RuntimeTypeAdapterFactory depending on internal Streams class (#1959).
    • Improve Maven build (#1964).
    • Make dependency on java.sql optional (#1707).

    Gson 2.8.8

    • Fixed issue with recursive types (#1390).
    • Better behaviour with Java 9+ and Unsafe if there is a security manager (#1712).
    • EnumTypeAdapter now works better when ProGuard has obfuscated enum fields (#1495).
    Changelog

    Sourced from gson's changelog.

    Version 2.8.9

    • Make OSGi bundle's dependency on sun.misc optional (#1993).
    • Deprecate Gson.excluder() exposing internal Excluder class (#1986).
    • Prevent Java deserialization of internal classes (#1991).
    • Improve number strategy implementation (#1987).
    • Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990).
    • Support arbitrary Number implementation for Object and Number deserialization (#1290).
    • Bump proguard-maven-plugin from 2.4.0 to 2.5.1 (#1980).
    • Don't exclude static local classes (#1969).
    • Fix RuntimeTypeAdapterFactory depending on internal Streams class (#1959).
    • Improve Maven build (#1964).
    • Make dependency on java.sql optional (#1707).

    Version 2.8.8

    • Fixed issue with recursive types (#1390).
    • Better behaviour with Java 9+ and Unsafe if there is a security manager (#1712).
    • EnumTypeAdapter now works better when ProGuard has obfuscated enum fields (#1495).

    Version 2.8.7

    • Fixed ISO8601UtilsTest failing on systems with UTC+X.
    • Improved javadoc for JsonStreamParser.
    • Updated proguard.cfg (#1693).
    • Fixed IllegalStateException in JsonTreeWriter (#1592).
    • Added JsonArray.isEmpty() (#1640).
    • Added new test cases (#1638).
    • Fixed OSGi metadata generation to work on JavaSE < 9 (#1603).

    Version 2.8.6

    2019-10-04 GitHub Diff

    • Added static methods JsonParser.parseString and JsonParser.parseReader and deprecated instance method JsonParser.parse
    • Java 9 module-info support

    Version 2.8.5

    2018-05-21 GitHub Diff

    • Print Gson version while throwing AssertionError and IllegalArgumentException
    • Moved utils.VersionUtils class to internal.JavaVersion. This is a potential backward incompatible change from 2.8.4
    • Fixed issue google/gson#1310 by supporting Debian Java 9

    Version 2.8.4

    2018-05-01 GitHub Diff

    • Added a new FieldNamingPolicy, LOWER_CASE_WITH_DOTS that mapps JSON name someFieldName to some.field.name
    • Fixed issue google/gson#1305 by removing compile/runtime dependency on sun.misc.Unsafe

    Version 2.8.3

    2018-04-27 GitHub Diff

    • Added a new API, GsonBuilder.newBuilder() that clones the current builder
    • Preserving DateFormatter behavior on JDK 9

    ... (truncated)

    Commits
    • 6a368d8 [maven-release-plugin] prepare release gson-parent-2.8.9
    • ba96d53 Fix missing bounds checks for JsonTreeReader.getPath() (#2001)
    • ca1df7f #1981: Optional OSGi bundle's dependency on sun.misc package (#1993)
    • c54caf3 Deprecate Gson.excluder() exposing internal Excluder class (#1986)
    • e6fae59 Prevent Java deserialization of internal classes (#1991)
    • bda2e3d Improve number strategy implementation (#1987)
    • cd748df Fix LongSerializationPolicy null handling being inconsistent with Gson (#1990)
    • fe30b85 Support arbitrary Number implementation for Object and Number deserialization...
    • 1cc1627 Fix incorrect feature request template label (#1982)
    • 7b9a283 Bump bnd-maven-plugin from 5.3.0 to 6.0.0 (#1985)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Improve MAVEN build Performance

    Improve MAVEN build Performance

    According to Maven parallel test, we can run tests in parallel.

    ===================== If there are any inappropriate modifications in this PR, please give me a reply and I will change them.

    opened by ChenZhangg 0
  • Bump commons-io from 2.4 to 2.7

    Bump commons-io from 2.4 to 2.7

    Bumps commons-io from 2.4 to 2.7.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [bug] array.length is not supported

    [bug] array.length is not supported

    - var lessons = ["jade","js"]
    if lessons
        if lessons.length>2
            p more than 2: #{lessons.join(',')}
        else if lessons.length >1
            p more than 1: #{lessons.join(',')}
        else
            p no1 lessons:#{lessons.length}
    else
        p no2 lessons
    

    output no1 lessons:

    wontfix 
    opened by Colindeng 1
  • Add simple server for prototyping inspired by handlebars-proto

    Add simple server for prototyping inspired by handlebars-proto

    Add a simple server for prototyping.

    • -h or --help show simple help message
    • --port set port to run, or run on 4567 if not given
    • use current directory or given one to serve files
    • file to serve is given in url
    • if a yml or json file with same name as template exists, it is used as model in rendering
    • to access a file called "foo.jade" use http://localhost:4567/foo
    • to access a file called "bar.jade" in a directory called "foo" use http://localhost:4567/foo/bar

    I've added a profile called jade4j-proto to execute appassembler plugin to create a distributable folder

    opened by giflw 0
Releases(jade4j-1.3.2)
  • jade4j-1.3.2(Mar 17, 2020)

  • jade4j-1.3.1(Feb 28, 2020)

    • Fixed issue #191: Scoping Issue with nested loops
    • Fixed issue #187: maven pom flexmark-all is too much
    • Fixed issue #188: Unit tests failures on default Windows console

    Please upgrade to this version and don't use 1.3.0

    Source code(tar.gz)
    Source code(zip)
  • jade4j-1.3.0(Jan 6, 2020)

    • removed obsolete basePath handling. Basepath Should be configured in the FileTemplateLoader
    • made file extension configurable. removed last static jade extension check.
    • Fixed issue #172: json als mixin argument (quoted keys)
    • Fixed issue #153: Variable assignments in for/each loops
    • Improvements to issue #150: Caused by: java.lang.RuntimeException this reader only responds to
    Source code(tar.gz)
    Source code(zip)
  • jade4j-1.2.7(Oct 11, 2019)

  • jade4j-1.2.6(Nov 1, 2017)

    • Fixing issue #154: using .pug extension
    • Fixing issue #157: array constructing in mixin parameters don't work
    • Testcase #155: case with default not working (at least using JsExpressionHandler)
    • Fixing multiline Code Blocks
    • Syncronize template creation when cache is enabled
    Source code(tar.gz)
    Source code(zip)
  • jade4j-1.2.5(Nov 10, 2016)

  • v1.2.4(Oct 11, 2016)

    • Fixed issue #141: Jade4J does not support unbuffered code blocks
    • Fixing issue #52: Includes in templates in paths with spaces
    • IMPORTANT: Don't use this version. There is a bug with path resolution. Wait for 1.2.5.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.3(Jun 17, 2016)

  • v1.2.2(Jun 17, 2016)

    • Fixing issue #106: Filters cannot be set using xml configuration
    • Testcase issue 65
    • Fixing issue #78: Incorrect rendering of backslashes in attribute values
    • Fixing issue #68: Multi-Line Strings include the trailing slash
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Apr 18, 2016)

  • v1.2.0(Apr 18, 2016)

    • Fixing issue #135: Resource loaded using the ClasspathTemplateLoader require *.jade extension before they are copied in (Thanks to nishtahir and crowmagnumb)
    • Fixing issue #129: multiple class attributes per HTML tag are not supported (breaking change in Filter interface, you need to adapt thirdparty filters)
    Source code(tar.gz)
    Source code(zip)
  • v1.1.4(Jan 14, 2016)

  • v1.1.1(Dec 2, 2015)

  • v1.1.0(Nov 29, 2015)

  • v1.0.10(Nov 27, 2015)

  • v1.0.9(Nov 27, 2015)

    • Fixing jade-Output without doctype
    • Fixing issue #122: Mixin Block after Mixin Call on same Line
    • Fixing issue #123: Block append not working correct.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.8(Nov 26, 2015)

  • v1.0.7(Nov 16, 2015)

  • v1.0.6(Nov 12, 2015)

    1.0.6 / 2015-11-12

    • Fixing issue 118: Problems with nested/inherited attributes
    • Fixing issue 117: &attributes() -> String index out of range when mixin called with ()()

    1.0.5 / 2015-11-12

    • Fixing Issue 116: &attributes() -> Classcast Exception with integers as keys in maps, inside of loops
    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Nov 12, 2015)

    • Fixing Issue 115: &attributes() -> Classcast Exception with integers as keys in maps
    • Fixing Issue 104: mixin definitions are ignored in extension template (Thanks to rzara)
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Nov 11, 2015)

  • v1.0.2(Nov 10, 2015)

  • v1.0.1(Nov 10, 2015)

    • Fixing Issue 112: Fixed ++ and -- recognition
    • Fixing Issue 111: Maven Upgrade auf 3.2.5
    • Added Testcases for closed Issues 43,56,70,74,81,97,104,107
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Nov 6, 2015)

    In Version 1.0.0 we updated to the new Syntax of JadeJs 1.11. There are also some Breaking Changes:

    • Instead of 'id = 5' you must use '- var id = 5'
    • Instead of 'h1(attributes, class = "test")' you must use 'h1(class= "test")&attributes(attributes)'
    • Instead of '!!! 5' you must use 'doctype html'
    • Jade Syntax for Conditional Comments is not supported anymore
    • Thanks to rzara for contributing to issue-108

    We mark this release as a pre-release, because of the major changes we made to Jade4J.

    Source code(tar.gz)
    Source code(zip)
  • v0.4.3(May 27, 2015)

    Accepted pull request from dusanmsk (https://github.com/neuland/jade4j/pull/91) regarding mixin argument splitting and added further tests.

    Source code(tar.gz)
    Source code(zip)
  • v0.3.17(Oct 9, 2013)

  • v0.3.16(Oct 7, 2013)

  • v0.3.15(Sep 12, 2013)

  • v0.3.14(Aug 24, 2013)

Owner
neuland - Büro für Informatik
neuland - Büro für Informatik
Hashids algorithm v1.0.0 implementation in Java

Hashids.java A small Java class to generate YouTube-like hashes from one or many numbers. Ported from javascript hashids.js by Ivan Akimov What is it?

CELLA 944 Jan 5, 2023
"Pathfinder" - a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS

"Pathfinder" is a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS.

Dan Sirbu 2 Mar 9, 2022
Java lib for monitoring directories or individual files via java.nio.file.WatchService

ch.vorburger.fswatch Java lib for monitoring directories or individual files based on the java.nio.file.WatchService. Usage Get it from Maven Central

Michael Vorburger ⛑️ 21 Jan 7, 2022
Tencent Kona JDK11 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) with quarterly updates. Tencent Kona JDK11 is certified as compatible with the Java SE standard.

Tencent Kona JDK11 Tencent Kona JDK11 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) w

Tencent 268 Dec 16, 2022
This repository contains Java programs to become zero to hero in Java.

This repository contains Java programs to become zero to hero in Java. Data Structure programs topic wise are also present to learn data structure problem solving in Java. Programs related to each and every concep are present from easy to intermidiate level

Sahil Batra 15 Oct 9, 2022
An open-source Java library for Constraint Programming

Documentation, Support and Issues Contributing Download and installation Choco-solver is an open-source Java library for Constraint Programming. Curre

null 607 Jan 3, 2023
Java Constraint Programming solver

https://maven-badges.herokuapp.com/maven-central/org.jacop/jacop/badge.svg [] (https://maven-badges.herokuapp.com/maven-central/org.jacop/jacop/) JaCo

null 202 Dec 30, 2022
Java Constraint Solver to solve vehicle routing, employee rostering, task assignment, conference scheduling and other planning problems.

OptaPlanner www.optaplanner.org Looking for Quickstarts? OptaPlanner’s quickstarts have moved to optaplanner-quickstarts repository. Quick development

KIE (Drools, OptaPlanner and jBPM) 2.8k Jan 2, 2023
Alibaba Java Diagnostic Tool Arthas/Alibaba Java诊断利器Arthas

Arthas Arthas is a Java Diagnostic tool open sourced by Alibaba. Arthas allows developers to troubleshoot production issues for Java applications with

Alibaba 31.5k Jan 4, 2023
Java rate limiting library based on token/leaky-bucket algorithm.

Java rate-limiting library based on token-bucket algorithm. Advantages of Bucket4j Implemented on top of ideas of well known algorithm, which are by d

Vladimir Bukhtoyarov 1.7k Jan 8, 2023
Object-Oriented Java primitives, as an alternative to Google Guava and Apache Commons

Project architect: @victornoel ATTENTION: We're still in a very early alpha version, the API may and will change frequently. Please, use it at your ow

Yegor Bugayenko 691 Dec 27, 2022
Google core libraries for Java

Guava: Google Core Libraries for Java Guava is a set of core Java libraries from Google that includes new collection types (such as multimap and multi

Google 46.5k Jan 1, 2023
Java regular expressions made easy.

JavaVerbalExpressions VerbalExpressions is a Java library that helps to construct difficult regular expressions. Getting Started Maven Dependency: <de

null 2.6k Dec 30, 2022
MinIO Client SDK for Java

MinIO Java SDK for Amazon S3 Compatible Cloud Storage MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations

High Performance, Kubernetes Native Object Storage 787 Jan 3, 2023
java port of Underscore.js

underscore-java Requirements Java 1.8 and later or Java 11. Installation Include the following in your pom.xml for Maven: <dependencies> <dependency

Valentyn Kolesnikov 411 Dec 6, 2022
(cross-platform) Java Version Manager

jabba Java Version Manager inspired by nvm (Node.js). Written in Go. The goal is to provide unified pain-free experience of installing (and switching

Stanley Shyiko 2.5k Jan 9, 2023
Manage your Java environment

Master your Java Environment with jenv Website : http://www.jenv.be Maintainers : Gildas Cuisinier Future maintainer in discussion: Benjamin Berman As

jEnv 4.6k Dec 30, 2022
The shell for the Java Platform

______ .~ ~. |`````````, .'. ..'''' | | | |'''|''''' .''```. .'' |_________| |

CRaSH Repositories 916 Dec 30, 2022
Lightweight Java State Machine

Maven <dependency> <groupId>com.github.stateless4j</groupId> <artifactId>stateless4j</artifactId> <version>2.6.0</version>

Stateless 4 Java 772 Dec 22, 2022