zen 1.0.0

  • README.md
  • Example
  • Installing
  • Versions
  • 65

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]
39
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, web, other

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

Issues and suggestions

Maintain CHANGELOG.md.

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

The description is too short.

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

Format lib/src/factory.dart.

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0 <3.0.0
csslib ^0.14.0 0.14.4+1
html_builder ^1.0.0 1.0.5
Transitive dependencies
args 1.5.0
charcode 1.1.2
collection 1.14.11
logging 0.11.3+2
path 1.6.2
source_span 1.4.1
Dev dependencies
test ^0.12.0