angel_mustache 2.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 53

mustache

Gitter version build status

Mustache (Handlebars) view generator for the Angel web server framework.

Thanks so much @c4wrd for his help with bringing this project to life!

Installation

In pubspec.yaml:

dependencies:
    angel_mustache: ^2.0.0

Usage

const FileSystem fs = const LocalFileSystem();

configureServer(Angel app) async {
  // Run the plug-in
  await app.configure(mustache(fs.directory('views')));
  
  // Render `hello.mustache`
  await res.render('hello', {'name': 'world'});
}

Options

  • partialsPath: A path within the viewsDirectory to search for partials in. Default is ./partials.
  • fileExtension: The file extension to search for. Default is .mustache.

2.0.0

  • Angel 2 and Dart 2 support.

example/main.dart

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_mustache/angel_mustache.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';

const FileSystem fs = const LocalFileSystem();

configureServer(Angel app) async {
  // Run the plug-in
  await app.configure(mustache(fs.directory('views')));

  // Render `hello.mustache`
  app.get('/', (req, res) async {
    await res.render('hello', {'name': 'world'});
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angel_mustache: ^2.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angel_mustache/angel_mustache.dart';
  
Version Uploaded Documentation Archive
2.0.0 Nov 8, 2018 Go to the documentation of angel_mustache 2.0.0 Download angel_mustache 2.0.0 archive
1.1.0 Nov 18, 2017 Go to the documentation of angel_mustache 1.1.0 Download angel_mustache 1.1.0 archive
1.0.3 Apr 5, 2017 Go to the documentation of angel_mustache 1.0.3 Download angel_mustache 1.0.3 archive
1.0.2 Jun 21, 2016 Go to the documentation of angel_mustache 1.0.2 Download angel_mustache 1.0.2 archive
1.0.1 May 2, 2016 Go to the documentation of angel_mustache 1.0.1 Download angel_mustache 1.0.1 archive
1.0.0 May 2, 2016 Go to the documentation of angel_mustache 1.0.0 Download angel_mustache 1.0.0 archive
1.0.0-dev Apr 22, 2016 Go to the documentation of angel_mustache 1.0.0-dev Download angel_mustache 1.0.0-dev archive
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
53
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: other

Primary library: package:angel_mustache/angel_mustache.dart with components: io, mirrors.

Health issues and suggestions

Document public APIs (-10 points)

2 out of 2 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Fix lib/src/mustache_context.dart. (-0.50 points)

Analysis of lib/src/mustache_context.dart reported 1 hint:

line 2 col 8: Unused import: 'package:path/path.dart'.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
angel_framework ^2.0.0-alpha 2.0.0-alpha.14
file ^5.0.0 5.0.6
mustache4dart ^3.0.0-dev 3.0.0-dev.1.0
path ^1.0.0 1.6.2
Transitive dependencies
analyzer 0.33.6 0.34.0
angel_container 1.0.0
angel_http_exception 1.0.0+3
angel_model 1.0.0+1
angel_route 3.0.0
args 1.5.1
async 2.0.8
body_parser 1.1.1
build 1.0.1
build_config 0.3.1+4
build_resolvers 0.2.2+6
build_runner 1.1.2
build_runner_core 1.1.1
built_collection 4.1.0
built_value 6.1.6
charcode 1.1.2
code_buffer 1.0.1
code_builder 3.1.3
collection 1.14.11
combinator 1.0.0+3
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
dart2_constant 1.0.2+dart2
dart_style 1.2.0 1.2.1
fixnum 0.10.9
front_end 0.1.6+8 0.1.7
glob 1.1.7
graphs 0.1.3+1
html 0.13.3+3
http2 0.1.9
http_multi_server 2.0.5
http_parser 3.1.3
http_server 0.9.8+1
intl 0.15.7
io 0.3.3
js 0.6.1+1
json_annotation 2.0.0
kernel 0.3.6+8 0.3.7
logging 0.11.3+2
matcher 0.12.4
merge_map 1.0.1
meta 1.1.6
mime 0.9.6+2
mock_request 1.0.4
package_config 1.0.5
package_resolver 1.0.6
pedantic 1.3.0
plugin 0.2.0+3
pool 1.3.6
pub_semver 1.4.2
pubspec_parse 0.1.2+3
quiver 2.0.1
reflectable 2.0.8
shelf 0.7.3+3
shelf_web_socket 0.2.2+4
source_span 1.4.1
stack_trace 1.9.3
stream_channel 1.6.8
stream_transform 0.0.14+1
string_scanner 1.0.4
timing 0.1.1+1
tuple 1.0.2
typed_data 1.1.6
utf 0.9.0+5
uuid 1.0.3
watcher 0.9.7+10
web_socket_channel 1.0.9
yaml 2.1.15
Dev dependencies
http any 0.12.0
test any