https://github.com/lyn-euler/mustache_recase
https://github.com/lyn-euler/mustache_recase
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/lyn-euler/mustache_recase
- Owner: lyn-euler
- License: bsd-3-clause
- Created: 2021-05-20T09:37:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T09:48:29.000Z (about 5 years ago)
- Last Synced: 2025-01-21T04:11:53.465Z (over 1 year ago)
- Language: Dart
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mustache_recase
A library for extending the functionality of [mustache](https://pub.dartlang.org/packages/mustache) package with [recase](https://pub.dartlang.org/packages/recase)
## Usage
```
import 'package:mustache/mustache.dart';
import 'package:mustache_recase/mustache_recase.dart' as mustache_recase;
void main(){
Template template = new Template("{{#title_case}} {{hello}} {{/title_case}}");
Map variables = {"hello": "hello-world"};
variables.addAll(mustache_recase.cases);
String output = template.renderString(variables);
print(output); // Hello World
}
```
See (or interact with) the [example](https://github.com/Rodsevich/mustache_recase/blob/master/example/cli_interactive_example.dart) and/or the [test](https://github.com/Rodsevich/mustache_recase/blob/master/test/mustache_recase_test.dart) of the package if you have doubts
### List of usable cases
- snake_case
- dot.case
- path/case
- param-case
- PascalCase
- Header-Case
- Title Case
- camelCase
- Sentence case
- CONSTANT_CASE
#### misc
This package was made with [Generator+](https://github.com/Rodsevich/generator-plus) package in an effort to have it tested and, at the same time, extended in it's mustache templates related features. I'm glad it worked as expected :smiley: