zen 1.0.0

  • README.md
  • Example
  • Installing
  • Versions
  • 44

zen #

Build html_builder nodes by writing CSS selectors. Also includes querySelector functionality for html_builder AST's.

Using the z function, you can cleanly create complex, nested HTML trees.

Example #

import 'package:html_builder/elements.dart';
import 'package:html_builder/html_builder.dart';
import 'package:zen/zen.dart';

Node semanticUiForm() {
  return z('form.ui.form', [
    z('.ui.left.icon.input', [
      z('i.chat.icon'),
      z('input[type="text"][placeholder="Say something..."]'),
    ]),
    z('button.ui.submit.button', [
      text('Submit'),
    ]),
  ]);
}

void main() {
  var tree = semanticUiForm();
  print(new StringRenderer().render(tree));
  print(Zen.querySelectorAll(tree, '.ui'));
}

example/main.dart

import 'package:html_builder/elements.dart';
import 'package:html_builder/html_builder.dart';
import 'package:zen/zen.dart';

Node semanticUiForm() {
  return z('form.ui.form', [
    z('.ui.left.icon.input', [
      z('i.chat.icon'),
      z('input[type="text"][placeholder="Say something..."]'),
    ]),
    z('button.ui.submit.button', [
      text('Submit'),
    ]),
  ]);
}

void main() {
  var tree = semanticUiForm();
  print(new StringRenderer().render(tree));
  print(Zen.querySelectorAll(tree, '.ui'));
}

Use this package as a library

1. Depend on it

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


dependencies:
  zen: ^1.0.0

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:zen/zen.dart';
  
Version Uploaded Documentation Archive
1.0.0 Jun 1, 2018 Go to the documentation of zen 1.0.0 Download zen 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
72
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13

Platforms

Detected platforms: Flutter, web, other

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

Health suggestions

Fix lib/zen.dart. (-1 points)

Analysis of lib/zen.dart reported 2 hints:

line 33 col 22: Use = to separate a named parameter from its default value.

line 39 col 22: Use = to separate a named parameter from its default value.

Format lib/src/factory.dart.

Run dartfmt to format lib/src/factory.dart.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
csslib ^0.14.0 0.14.6
html_builder ^1.0.0 1.0.5
Transitive dependencies
args 1.5.1
charcode 1.1.2
collection 1.14.11
logging 0.11.3+2
path 1.6.2
source_span 1.5.4
term_glyph 1.1.0
Dev dependencies
test ^0.12.0