Skip to content

Commit c4bfaca

Browse files
committed
Update Readme
1 parent a618bd7 commit c4bfaca

File tree

1 file changed

+49
-12
lines changed

1 file changed

+49
-12
lines changed

README.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,53 @@
1-
# Handlebars.Net.Extension
1+
# Handlebars.Net.Extension.NewtonsoftJson
22

3-
Template repository for Handlebars.Net extensions
43

5-
#### How to use:
6-
- Create new repo using template
7-
- Find all `<!-- Replace with correct value -->` and replace with valid values
8-
- Make additional changes that are required by the extensions
4+
#### [![CI](https://github.com/Handlebars-Net/Handlebars.Net.Extension.NewtonsoftJson/workflows/CI/badge.svg)](https://github.com/Handlebars-Net/Handlebars.Net.Extension.NewtonsoftJson/actions?query=workflow%3ACI) [![Nuget](https://img.shields.io/nuget/vpre/Handlebars.Net.Extension.NewtonsoftJson)](https://www.nuget.org/packages/Handlebars.Net.Extension.NewtonsoftJson/) [![performance](https://img.shields.io/badge/benchmark-statistics-blue)](http://handlebars-net.github.io/Handlebars.Net.Extension.NewtonsoftJson/dev/bench/)
95

10-
Notes:
11-
- The template is designed to be used as part of Handlebars-Net organization.
12-
Usage outside of the organization may require additional changes
6+
---
7+
8+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=alert_status)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=security_rating)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson)
9+
10+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=bugs)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=code_smells)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson&metric=coverage)](https://sonarcloud.io/dashboard?id=Handlebars-Net_Handlebars.Net.Extension.NewtonsoftJson)
11+
12+
---
13+
14+
[![GitHub issues questions](https://img.shields.io/github/issues/handlebars-net/Handlebars.Net.Extension.NewtonsoftJson/question)](https://github.com/Handlebars-Net/Handlebars.Net.Extension.NewtonsoftJson/labels/question)
15+
[![GitHub issues help wanted](https://img.shields.io/github/issues/handlebars-net/Handlebars.Net.Extension.NewtonsoftJson/help%20wanted?color=green&label=help%20wanted)](https://github.com/Handlebars-Net/Handlebars.Net.Extension.NewtonsoftJson/labels/help%20wanted)
16+
17+
---
18+
19+
## Purpose
20+
21+
Adds proper [Newtonsoft.Json](https://www.newtonsoft.com/json) support to Handlebars.Net
22+
23+
### Install
24+
```cmd
25+
dotnet add package Handlebars.Net.Extension.NewtonsoftJson
26+
```
27+
28+
### Usage
29+
```c#
30+
var handlebars = Handlebars.Create();
31+
handlebars.Configuration.UseNewtonsoftJson();
32+
```
33+
34+
### Example
35+
```c#
36+
[Fact]
37+
public void JsonTestObjects()
38+
{
39+
var model = JObject.Parse("{\"Key1\": \"Val1\", \"Key2\": \"Val2\"}");
40+
41+
var source = "{{#each this}}{{@key}}{{@value}}{{/each}}";
42+
43+
var handlebars = Handlebars.Create();
44+
handlebars.Configuration.UseNewtonsoftJson();
45+
46+
var template = handlebars.Compile(source);
47+
48+
var output = template(model);
49+
50+
Assert.Equal("Key1Val1Key2Val2", output);
51+
}
52+
```
1353

14-
#### If you want your extension to be moved under Handlebars-Net organization:
15-
- Add [@zjklee](https://github.com/zjklee) as admin for the repo
16-
- Contact [@zjklee](https://github.com/zjklee)

0 commit comments

Comments
 (0)