slugify2 0.2.1

Fork #

This original repository : https://github.com/izolate/slugify

slugify #

Converts strings to slugs, for pretty URLs

Features #

  • Removes special characters
  • Approximates replacements for characters not in the Latin alphabet
  • Allows custom delimiter and case sensitivity

Usage #

import 'package:slugify/slugify.dart';

Slugify slugify = new Slugify();
String slug = slugify.slugify('Hello World!');

print(slug); // hello-world

Custom settings #

By default, the slugs returned are lowercased and delimited by - to optimize for URL use. You can override this by supplying the parameters delimiter (String) and lowercase (bool) when instantiating the class.

new Slugify(delimiter: '_', lowercase: false);

Changelog #

0.2.1 #

  • Change Licence MIT to BSD

0.2.0 #

  • Added compatible dart 2.0

0.1.1 #

  • Set return type on Slugify.slugify()

0.1.0 #

  • Added documentation

0.0.2 #

  • Added unit tests
  • Added examples

0.0.1 #

  • Initial commit

Use this package as a library

1. Depend on it

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


dependencies:
  slugify2: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:slugify2/slugify.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
84
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in libraries.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

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

Analysis of lib/slugify.dart reported 2 hints:

line 402 col 28: Use = to separate a named parameter from its default value.

line 402 col 49: Use = to separate a named parameter from its default value.

Maintenance suggestions

The package description is too short. (-16 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.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and slugify2.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
Dev dependencies
test ^1.5.3

Admin