slugify2 0.2.1

  • Readme
  • Changelog
  • Installing
  • 77

Fork #

This original repository :

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:

  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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

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.99 points)

Analysis of lib/slugify.dart reported 4 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.

line 420 col 19: Unnecessary new keyword.

line 422 col 19: Unnecessary new keyword.

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/

For more information see the pub package layout conventions.


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