jael_preprocessor 1.0.0+1

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages 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

Analysis

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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
24 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90 / 100
Overall score:
Weighted score of the above. [more]
60
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:jael_preprocessor/jael_preprocessor.dart.

Suggestions

  • Homepage does not exists.

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/jael_preprocessor.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <=2.0.0
file ^2.0.0 2.3.7 5.0.1
jael ^1.0.0-alpha 1.0.4
Transitive dependencies
charcode 1.1.1
code_buffer 1.0.0
dart2_constant 1.0.1+dart2
intl 0.15.6
meta 1.1.5
path 1.6.0
source_span 1.4.0
string_scanner 1.0.2
symbol_table 1.0.4
Dev dependencies
test ^0.12.0