jael_preprocessor 1.0.0+1

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

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.0.0+1

  • Minor change to Patcher signature for Dart 2 compatibility.

example/main.dart

import 'dart:async';

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

Future<jael.Document> process(
    jael.Document doc, Directory dir, errorHandler(jael.JaelError e)) {
  return jael.resolve(doc, dir, onError: errorHandler, patch: [
    (doc, dir, onError) {
      print(doc.root.children.length);
      return doc;
    },
  ]);
}

Use this package as a library

1. Depend on it

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


dependencies:
  jael_preprocessor: ^1.0.0+1

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+1 Apr 3, 2018 Go to the documentation of jael_preprocessor 1.0.0+1 Download jael_preprocessor 1.0.0+1 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
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
8
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because jael_preprocessor depends on file >=0.1.0 <5.0.2 which requires SDK version <2.0.0-∞, version solving failed.

Health suggestions

Format lib/jael_preprocessor.dart.

Run dartfmt to format lib/jael_preprocessor.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Homepage does not exists. (-20 points)

We were unable to access https://github.com/angel-dart/jael/tree/master/jael_processor at the time of the analysis.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=2.0.0