pretty_samples 0.0.5

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

pretty_samples

Prettify code samples in HTML files using Javascript code prettifier in AngularDart apps.

This library could be used with DaCSS Presentation Library

Demo

Demo is built version of example` folder.

Usage

Check example folder.

Add SamplesModule:

import 'package:angular/application_factory.dart';
import 'package:pretty_samples/dacss_samples.dart';

main() {
       applicationFactory().addModule(new SamplesModule()).run();
}

After that you can add sample attribute to any HTML element, like

<div sample='some-sample.html`></div>

Module will download some-sample.html content, prettify it and put into div.

You can also reference samples inside same document by IDs:

<div sample='#someId'></div>
<div id="#sampleId" style="display:none"></div>

Features and bugs

Please file feature requests and bugs at the issue tracker.

Changelog

0.0.1

  • Initial version

example/pretty_samples.dart

// Copyright (c) 2015, Valentyn Shybanov. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library dacss_samples.example;

import 'package:angular/application_factory.dart';
import 'package:pretty_samples/pretty_samples.dart';

main() {
  applicationFactory().addModule(new SamplesModule()).run();
}

Use this package as a library

1. Depend on it

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


dependencies:
  pretty_samples: ^0.0.5

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:pretty_samples/pretty_samples.dart';
  
Version Uploaded Documentation Archive
0.0.5 May 27, 2016 Go to the documentation of pretty_samples 0.0.5 Download pretty_samples 0.0.5 archive
0.0.4 May 11, 2015 Go to the documentation of pretty_samples 0.0.4 Download pretty_samples 0.0.4 archive
0.0.3 May 11, 2015 Go to the documentation of pretty_samples 0.0.3 Download pretty_samples 0.0.3 archive
0.0.2 Apr 20, 2015 Go to the documentation of pretty_samples 0.0.2 Download pretty_samples 0.0.2 archive
0.0.1 Apr 20, 2015 Go to the documentation of pretty_samples 0.0.1 Download pretty_samples 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
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]
0
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 pretty_samples depends on angular >=0.9.0 <5.0.0-beta+1 which requires SDK version <2.0.0 or >=2.0.0-dev.3.0 <2.0.0, version solving failed.

Health suggestions

Format lib/pretty_samples.dart.

Run dartfmt to format lib/pretty_samples.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is too old. (-100 points)

The package was released more than two years ago.

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

The description is too short. (-20 points)

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

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.