jael_preprocessor 1.0.0

  • README.md
  • Installing
  • Versions
  • 49

jael_preprocessor

Pub build status

A pre-processor for resolving blocks and includes within Jael templates.

Installation

In your pubspec.yaml:

dependencies:
  jael_prepreprocessor: ^1.0.0-alpha

Usage

It is unlikely that you will directly use this package, as it is more of an implementation detail than a requirement. However, it is responsible for handling include and block directives (template inheritance), so you are a package maintainer and want to support Jael, read on.

To keep things simple, just use the resolve function, which will take care of inheritance for you.

import 'package:jael_preprocessor/jael_preprocessor.dart' as jael;

myFunction() async {
  var doc = await parseTemplateSomehow();
  var resolved = await jael.resolve(doc, dir, onError: (e) => doSomething());
}

You may occasionally need to manually patch in functionality that is not available through the official Jael packages. To achieve this, simply provide an Iterable of Patcher functions:

myOtherFunction(jael.Document doc) {
  return jael.resolve(doc, dir, onError: errorHandler, patch: [
    syntactic(),
    sugar(),
    etc(),
  ]);
}

This package uses package:file, rather than dart:io.

1. Depend on it

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


dependencies:
  jael_preprocessor: "^1.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:jael_preprocessor/jael_preprocessor.dart';
        
Version Uploaded Documentation Archive
1.0.0 Nov 28, 2017 Go to the documentation of jael_preprocessor 1.0.0 Download jael_preprocessor 1.0.0 archive
1.0.0-alpha+2 Oct 2, 2017 Go to the documentation of jael_preprocessor 1.0.0-alpha+2 Download jael_preprocessor 1.0.0-alpha+2 archive
1.0.0-alpha+1 Oct 2, 2017 Go to the documentation of jael_preprocessor 1.0.0-alpha+1 Download jael_preprocessor 1.0.0-alpha+1 archive
1.0.0-alpha Oct 1, 2017 Go to the documentation of jael_preprocessor 1.0.0-alpha Download jael_preprocessor 1.0.0-alpha archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
9 / 100
Health:
Code health derived from static analysis. [more]
94 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]
49

Platforms

Detected platforms: web, other

Primary library: package:jael_preprocessor/jael_preprocessor.dart with components: mirrors.

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use jael_preprocessor.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0
file ^2.0.0 2.3.5
jael ^1.0.0-alpha 1.0.0
Transitive dependencies
charcode 1.1.1
code_buffer 1.0.0
intl 0.15.2
meta 1.1.2
path 1.5.1
source_span 1.4.0
string_scanner 1.0.2
symbol_table 1.0.4
Dev dependencies
test ^0.12.0