p-hatan/ mirror

pub repository

mirror.p-hatan.com

mustache4dart

0.0.3

A mustache implementation for Dart language

Download archive

Readme

Mustache for Dart

A simple implementation of mustache for the Dart language. At the moment this project serves as an excuse to better explore the language. Although it is still in development you can have a look at what is capable of at the tests

Using it

In order to use the library, just add it to your pubspec.yalm as a dependency

dependencies:
  mustache4dart: any

and you are good to go. You can use the render toplevel function to render your template. For example:

var salutation = render('Hello {{name}}!', {name: 'Bob'});
print(salutation); //shoud print Hello Bob!

Compiling to functions

If you have a template that you are going to reuse with different contextes you can compile a template to a function using the toplevel function compile:

var salut = compile('Hello {{name}}!');
print(salut('Alice')); //should print Hello Alice! 

Running the tests

At the moment the project is under heavy development. If you want to run the tests the following commands should be enough

git clone git://github.com/valotas/mustache4dart.git
git submodule init
git submodule update 
pub install
test/run.sh

At the moment mustache4dart can pass all interpolation, inverted and sections specs.

Versioning

Until a stable release the versioning of the project will be 0.0.[NUM] where NUM should be the number of groups of the mustache specs that pass.

Build status

Build Status You can watch the project failing live by clicking at the status badge :-)

Changelog

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add mustache4dart
pubspec.yaml
name: mustache4dart
version: 0.0.3
author: Georgios Valotasios <valotas@gmail.com>
description: A mustache implementation for Dart language
homepage: https://github.com/valotas/mustache4dart
dependencies:
  unittest: any

#  js: any

Version history

VersionPublishedArchiveSHA-256
0.0.0-dev2013-02-19T21:28:29.445070ZDownloadd6d720bce05b079f2e943e7904c8bee9721b4056d116f7bd1c8403b1ec4a7f84
0.0.12013-02-26T22:03:46.448190ZDownload84179de91d6a4a697227726baba191627d8bb616ec1e4f837e81806f82de832b
0.0.32013-02-26T22:25:33.418970ZDownloade6c0658e0aaf82a90efbfb78d00ed32c72b1b75bf1cb5633e2c228466d4abc05
0.0.42013-03-03T18:06:55.789500ZDownloadeee0a90b0f4c2d99cb5231f241f5c39881fe864d5625283a2c58c0f158e570e0
0.0.72013-03-04T23:32:27.453030ZDownload355b01846a16fd00c64c8e323e428207c2e860637805df2747fc083d56735ba3
0.0.8+0.4.1.02013-03-07T21:36:57.679800ZDownload04dd1aaa4a3a78bb7493f1f7abbe268057ad3e2c69816bfa641faaa25a559e3b
0.0.9+0.4.1.02013-03-19T21:43:18.721950ZDownloadf76d8f4979877a6d2e387fa917ab99c8c68b9a03d01310682ccfa4538b262363
0.0.10+0.4.32013-03-29T09:16:43.510650ZDownload0a9daeefac6cede2b07e81a78bc6f11870439f8c0dc749c3006d7fa1613d3b41
0.0.10+0.4.5.12013-04-14T19:26:45.202910ZDownload1222f83daec4d3b8f857d587c96f90e45159caf31f3db553966459420da07664
0.0.11+0.4.7.12013-04-17T21:44:39.083260ZDownload689c53fb8889d842234e62544d500f15ac8669ee132d1ff1777f6f2eb367869a
0.0.12+0.5.0.12013-04-26T21:19:41.254860ZDownloadb62a950e075f5bb443b9feaadebcff537f111696285d8ea9493d4dcb8d7d050c
0.0.13+0.5.3.02013-05-06T06:44:50.599850ZDownloadd69524ea02b33bbb94230535a088711c5ab968e72e6ea7c62e8ce9a24f1c9140
0.0.14+0.5.7.32013-05-18T21:30:24.500820ZDownload68134df835b429a04397d6069c1ad0c378f29f1fccd91342d85c1b5eaf370bc7
0.0.16+0.5.9.02013-05-25T16:58:56.638630ZDownloadcf455f4ce40986b37714f377c0574099fef0203d1142a3c0f14a899c79dd3fa3
0.0.17+0.5.202013-06-24T19:46:16.406610ZDownloadc3352531ad3afa687b3125a92cc185541f4bf5a674f9b348f71d712bc5547de5
0.0.18+0.6.15.32013-08-08T16:10:34.844320ZDownload1fd4ff2ee68101a1b1d7b6ce865a901a1d04141bf3c805842a18dbfa1d13ecfe
0.0.19+0.6.21.32013-08-28T21:18:20.505260ZDownload624cc040cbc9b83ba56183b49167ab68cbd6e5949e40b6c0a43821c9358a3eea
0.0.20+0.6.21.32013-08-29T17:58:45.786730ZDownload418444b0cbe4824b31c8a96d98482248020bf3b274cacaa6f844fccbd6e72dc8
0.0.21+0.7.3.12013-09-21T17:05:15.179380ZDownload27a5cc9907374204518c4123264f4ec8b7fd27b5a257e2ad3e166d7ddd2c4dce
0.0.22+0.8.72013-10-28T23:09:03.918250ZDownload292858babcdd8fc42b69c7f29b23b91c1a54e277886a4778518535db2ded3a52
0.0.232013-11-09T12:16:04.708970ZDownloade3bf2c330dbc5cac99c80718644a35ea3d357399e360ae5e08ca7364d99e2272
0.0.242013-11-09T12:22:36.392200ZDownloaddcb83723c1a7b5984bb206933bb56e5979813816888e9e60219dd4d4e30f0092
1.0.02013-11-24T14:01:03.945520ZDownloadfbdf886fc5ce991323556aaf277d730c1837e56d301096b48db94eb701c50af1
1.0.12014-03-16T19:36:24.317110ZDownload3efe740572fcf904d7e48f13f1e6a283ed58fcae7b87a74eddd89c33f87cf2ad
1.0.22014-03-17T22:23:27.197490ZDownloadd104d41f1be20d36286ea4291bd39e8bc90288a10122819f0d1d9df7262a97a7
1.0.32014-04-03T21:28:20.126980ZDownloadb99045d7e4bc215d4301863e40956831dc8bc867eec36e1715be4fa3a906b115
1.0.42014-04-05T11:20:14.658ZDownload7db7a382ebbdd26196ce29b481e7932273982f14115f6b24404ccae0e0e724f0
1.0.52014-07-26T14:34:08.662790ZDownload076a8fe82009e7047fcbf814e46b4fde5365c5569fb1fd417c76ef3ee240e74f
1.0.62014-09-14T16:53:09.722960ZDownloadab87cb35322b90074e51f1e1b1790109e78a00a2cc5fb89a7231b7be5a6224dc
1.0.72014-10-23T20:13:40.391280ZDownload58f1e2bbfdcdf253b415c287ea0b9e1f39fcd58aea5d5ebcdc09352f245ae5af
1.0.82015-02-01T12:31:49.532440ZDownload38016c342ce69f773664695ec5a49bd0b57944eff6cc8e42ac0064b7f154aaa9
1.0.92015-02-13T19:53:49.499880ZDownload2095f1277ca308225852db7933b777301f50898fb9d857c65bf86e4649ed7c68
1.0.102015-03-15T16:48:32.234410ZDownload5aac935269c83772d0bc8c51c760d8d4ba5fbad699f21811226ea04b04c414f8
1.0.112017-03-17T18:14:57.650078ZDownloadbe0d21e99d2c4664814cca54be7e11be37e181681a1bbe0813da64d0ce5bd18d
1.0.122017-03-17T18:24:47.243489ZDownload625d1e3478edf1912dab43c055570257e50c41048cefb6915799fd6dcbbc0714
1.1.02017-05-10T20:30:22.023292ZDownloadab036d116ddca77d2af532d5f52783e1b0dc2f2bd8a2503ec9b74a621a455291
2.0.02017-06-13T19:23:50.361672ZDownload971eddc6f565af98b5408a01e507534bf3963a13dd18ad1c1826e07c0228506a
2.1.02017-06-21T20:42:44.818271ZDownload0472811dcb58ac047e349c9c62f02cb991188c02f24a19dd2c5c9597b8c17859
2.1.12018-04-14T21:18:28.022508ZDownloadf301b06380743067d387417253877366a86e2b2a7460011b7c5a8f3a101051c4
2.1.22018-05-12T17:16:39.618138ZDownloadf25d6f892ff79907ebe80da7bbe09a6610ee179b026419ee0abeabfe18c87811
3.0.0-dev.0.02018-08-19T15:44:53.264293ZDownloadc48f078a7add48b0e47fd0bcd7ae54df5a6fc2214c81b310a6caf5aefb1c7752
3.0.0-dev.1.02018-08-25T15:26:18.189409ZDownload8e300b762db7c2667e51554864606b8af2a5ef3a7f3075b4c7f613ca17962e3a

Dependencies

unittest "any"