nunjucks

A powerful templating engine with inheritance, asynchronous control, and more (jinja2 inspired)

BSD-2-CLAUSE License

Downloads
4.5M
Stars
8.5K
Committers
154

Bot releases are hidden (Show)

nunjucks - v2.3.0

Published by carljm almost 9 years ago

  • Return null from WebLoader on missing template instead of throwing an
    error, for consistency with other loaders. This allows WebLoader to support
    the new ignore missing flag on the include tag. If ignore missing is
    not set, a generic "template not found" error will still be thrown, just like
    for any other loader. Ajax errors other than 404 will still cause WebLoader
    to throw an error directly.
  • Add preserve-linebreaks option to striptags filter. Thanks Ivan
    Kleshnin. Merge of #619.
nunjucks - v2.2.0

Published by carljm almost 9 years ago

  • Add striptags filter. Thanks Anthony Giniers. Merge of
    #589.
  • Allow compiled templates to be imported, included and extended. Thanks Luis
    Gutierrez-Sheris. Merge of
    #581.
  • Fix issue with different nunjucks environments sharing same globals. Each
    environment is now independent. Thanks Paul Pechin. Merge of
    #574.
  • Add negative steps support for range function. Thanks Nikita Mostovoy. Merge
    of #575.
  • Remove deprecation warning when using the default filter without specifying
    a third argument. Merge of
    #567.
  • Add support for chaining of addGlobal, addFilter, etc. Thanks Rob Graeber. Merge of
    #537
  • Fix error propagation. Thanks Tom Delmas. Merge of
    #534.
  • trimBlocks now also trims windows style line endings. Thanks Magnus Tovslid. Merge of
    #548
  • include now supports an option to suppress errors if the template does not
    exist. Thanks Mathias Nestler. Merge of
    #559
nunjucks - v2.1.0

Published by carljm about 9 years ago

  • Fix creating WebLoader without opts. Merge of
    #524.
  • Add hasExtension and removeExtension methods to Environment. Merge of
    #512.
  • Add support for kwargs in sort filter. Merge of
    #510.
  • Add none as a lexed constant evaluating to null. Merge of
    #480.
  • Fix rendering of multiple raw blocks. Thanks Aaron O'Mullan. Merge of
    #503.
  • Avoid crashing on async loader error. Thanks Samy Pessé. Merge of
    #504.
  • Add support for keyword arguments for sort filter. Thanks Andres Pardini. Merge of
    #510
nunjucks - v2.0.0 - lots of stuff

Published by jlongster about 9 years ago

Most of the changes can be summed up in the issues tagged 2.0.

Or you can see all commits.

Most important changes:

  • autoescape is now on by default. You need to explicitly pass { autoescape: false } in the options to turn it off.
  • watch is off by default. You need to explicitly pass { watch: true } to start the watcher.
  • The default filter has changed. It will show the default value only if the argument is undefined. Any other value, even false-y values like false and null, will be returned. You can get back the old behavior by passing true as a 3rd argument to activate the loose-y behavior: foo | default("bar", true). In 2.0 if you don't pass the 3rd argument, a warning will be displayed about this change in behavior. In 2.1 this warning will be removed.
  • New filter tag
  • Lots of other bug fixes and small features, view the above issue list!
nunjucks - v1.3.4 - npm optimizations

Published by jlongster over 9 years ago

This is an extremely minor release that only adds an .npmignore so that the bench, tests, and docs folders do not get published to npm. Nunjucks should download a lot faster now.

nunjucks - v1.3.3

Published by jlongster over 9 years ago

This is exactly the same as v1.3.1, just fixing a typo in the git version tag.

nunjucks - v1.3.1

Published by jlongster over 9 years ago

We added strict mode to all the files, but that broke running nunjucks in the browser. Should work now with this small fix.

nunjucks - v1.3.0

Published by jlongster over 9 years ago

  • Relative templates: you can now load a template relatively by starting the path with ., like ./foo.html
  • FileSystemLoader now takes a noCache option, if true will disable caching entirely
  • Additional lstripBlocks and trimBlocks available to clean output automatically
  • New selectattr and rejectattr filters
  • Small fixes to the watcher
  • Several bug fixes

cc83724 prep for v1.3.0
eaa0f78 Merge pull request #370 from MaxKramnik/master
c00a33b Removing ignoreInitial option for chokidar to refresh view after first template save, removing event == "add"
3664163 Merge pull request #391 from SamyPesse/fix/windows
0f8b21b Simplify EOL norm regex in tests
41dd01c Disable windows tests for node 0.8
ce18959 Add very simple test for precompile
ff075af Fix #392: fix precompile.js for strict mode
7ff10e3 Use explicit path to mocha bin in test script
3b2f4ea Remove make as testing dependency
f58fd64 Add appveyor.yml for windows testing
5b48f29 Improve EOL normalization for tests
f08182c Add method to normalize EOL in tests
8974aa3 Merge pull request #390 from mozilla/fix-watching
cde3dc5 fix watching in node-loader
dda4e84 Fix escape for windows path
8ef8c47 Merge pull request #389 from SamyPesse/patch-1
1388170 Fix error when template is not found
2a2a31f Merge pull request #387 from mozilla/eqeqeq
2af7844 use === and !== instead == and !=
4245822 Merge pull request #386 from mozilla/use-strict
459e400 Add 'use strict'; #1
3f83a11 Merge pull request #385 from mozilla/single-quote
d930a2d Change always using single quote
901d808 Merge pull request #379 from SamyPesse/fix/378
4568ace Add method isRelative to loader
fcd71c6 Merge pull request #380 from stevemao/patch-1
4a5e862 add keywords in package.json
e0b1431 Don't force template name to be a string in compiler
c8b3b16 Remove useless that
17bc3f0 Fix #378: move cache to loader
252b76a Fix #375: Always resolve path when parentName is present
0f4a85c Improve cache performance for relative path
af62c97 Add test for cache path of relative paths
42d2b9f minor cleanup, regenerate browserfiles
1077f97 Merge pull request #349 from SamyPesse/feature/relative
9c6b2bb Pass name to compiler creation
52412a1 Accept path options in env.renderString
103dd2c Add test for relative path and renderString
1b7dcc6 Resolve of relative paths is done by loader
40d4ce7 Add tests for relative paths
9946ee8 Fix test of position of template file
d292cce Accept absolute path in FileSystemLoader
7bc9cd3 use parentName in getTemplate to resolve name
8285207 Pass name to getTemplate
4ce458e emit update when the template is changed the first time when the event == "add"
3dd3158 Add selectattr and rejectattr in built-in filters list.
aae3ec9 merge docs into main repo
8c6e2bc Merge pull request #354 from SamyPesse/feature/nocacheoption
dafc9e3 Merge pull request #355 from radev/master
ab9a7c7 Merge pull request #365 from carljm/selectattr
904316a Merge pull request #364 from carljm/list-on-array
dcfa36a Allow list filter to pass arrays through as-is.
bab41dc Add support for selectattr and rejectattr filters.
9a77099 Moved environment options to opts
fecfa42 Implement lstripBlocks and trimBlocks from Jinja2
e7572fd Add option to "noCache" to FileSystemLoader

nunjucks - v1.2.0

Published by jlongster over 9 years ago

24024b5 (HEAD, origin/master, master) Merge pull request #353 from SamyPesse/patch-1
324a875 Fix tests for non-breaking whitespaces
8b81acb Add test for non-breaking spaces
0815d4d use \u00A0 instead of String.charCode
2aaed2a Add nonbreaking space to whitespace chars list
52a50fc Fix spelling
c0baa5c Merge pull request #306 from eventEmitter/master
5f0c528 Merge pull request #336 from carljm/in-precedence
219d2eb Merge pull request #339 from oyyd/my_fork
140ccad Merge pull request #346 from fabien/master
1aaec23 fixed merge conflict
e1ab103 Update package.json
3a34fc9 Fix #317
f655747 Add test to verify that imports are without context by default.
f710479 Bind 'in' operator more tightly than boolean operators.
d5fd4c4 add test to ensure without context works
dbdc966 implement import with context
4f6b02e async rendering doesn't throw anymore when compiling errors (fixes https://github.com/mozilla/nunjucks/issues/233)
f0b7384 Merge remote-tracking branch 'origin/master'
71d050f fix type in _matches in tokenizer (fixes #294)
99033de Merge pull request #300 from rhengles/bin-precompile-windows
b8fe5ca fix typo in error message in parsePrimary (fixed #297)
e67a405 precompile command for Windows
fbf5dd5 Revert "upgrade chokidar"

nunjucks - v1.1.0

Published by jlongster about 10 years ago

User visible changes:

  • Fix a bug in urlize that would remove periods
  • custom tag syntax (like {% and %}) was made Environment-specific internally. Previously they were global even though you set them through the Environment.
  • Remove aggressive optimization that only emitted loop variables when uses. It introduced several bugs and didn't really improve perf.
  • Support the regular expression syntax like /foo/g.
  • The replace filter can take a regex as the first argument
  • The call tag was implemented
  • for tags can now take an else clause
  • The cycler object now exposes the current item as the current property
  • The chokidar library was updated and should fix various issues

Dev changes:

  • Test coverage now available via istanbul. Will automatically display after running tests.
nunjucks - v1.0.7

Published by jlongster about 10 years ago

Mixed up a few things in the 1.0.6 release, so another small bump. This merges in one thing:

  • The length filter will not throw an error is used on an undefined variable. It will return 0 if the variable is undefined.
nunjucks - v1.0.6

Published by jlongster about 10 years ago

  • Added the addGlobal method to the Environment object
  • import/extends/include now can take an arbitrary expression
  • fix bugs in set
  • improve express integration (allows rendering templates without an extension)
nunjucks - v1.0.5

Published by jlongster over 10 years ago

  • Added support for browserify
  • Added option to specify template output path when precompiling templates
  • Keep version comment in browser minified files
  • Speed up SafeString implementation
  • Handle null and non-matching cases for word count filter
  • Added support for node-webkit
  • Other various minor bugfixes
nunjucks - chokidar repo fix - v1.0.4

Published by jlongster over 10 years ago

  • The chokidar dependency moved repos, and though the git URL should have been forwarded some people were having issues. This fixed the repo and version. (v1.0.3 is skipped because it was published with a bad URL, quickly fixed with another version bump)
nunjucks - Bug fixes - v1.0.2

Published by jlongster over 10 years ago

  • Use chokidar for watching file changes. This should fix a lot of problems on OS X machines.
  • Always use / in paths when precompiling templates
  • Fix bug where async filters hang indefinitely inside if statements
  • Extensions now can override autoescaping with an autoescape property
  • Other various minor bugfixes
nunjucks - We've reached 1.0! Better APIs, asynchronous control, and more

Published by jlongster almost 11 years ago

  • An asynchronous API is now available, and async filters, extensions, and
    loaders is supported. The async API is optional and if you don't do
    anything async (the default), nothing changes for you. You can read
    more about this
    here. (fixes #41)
  • Much simpler higher-level API for initiating/configuring nunjucks is
    available. Read more
    here.
  • An official grunt plugin is available for precompiling templates: grunt-nunjucks
  • The browser files have been renamed. nunjucks.js is now the full
    library with compiler, and nunjucks-slim.js is the small version
    that only works with precompiled templates
  • urlencode filter has been added
  • The express integration has been refactored and isn't a kludge
    anymore. Should avoid some bugs and be more future-proof;
  • The order in which variables are lookup up in the context and frame
    lookup has been reversed. It will now look in the frame first, and
    then the context. This means that if a for loop introduces a new
    var, like {% for name in names %}, and if you have name in the
    context as well, it will properly reference name from the for loop
    inside the loop. (fixes #122 and #119)
Package Rankings
Top 0.5% on Npmjs.org
Top 20.66% on Repo1.maven.org
Top 4.04% on Proxy.golang.org
Top 18.39% on Pypi.org
Badges
Extracted from project README
NPM Version NPM Downloads Linux Build Windows Build Test Codecov