Skip to content

Commit

Permalink
doc : update ch documents
Browse files Browse the repository at this point in the history
  • Loading branch information
shps951023 committed Mar 1, 2023
1 parent 61ea2d6 commit 6ccd8cf
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 2 deletions.
114 changes: 114 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,120 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);

![image](https://user-images.githubusercontent.com/12729184/190843663-c00baf16-21f2-4579-9d08-996a2c8c549b.png)

### 二级列表

Tag 是 `IEnumerable<MiniWordForeach>` 类别. 使用方式`{{foreach``endforeach}}`.

##### Example

```csharp
var value = new Dictionary<string, object>()
{
["TripHs"] = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
{ "sDate", DateTime.Parse("2022-09-08 08:30:00") },
{ "eDate", DateTime.Parse("2022-09-08 15:00:00") },
{ "How", "Discussion requirement part1" },
{
"Details", new List<MiniWordForeach>()
{
new MiniWordForeach()
{
Value = new Dictionary<string, object>()
{
{"Text", "Air"},
{"Value", "Airplane"}
},
Separator = " | "
},
new MiniWordForeach()
{
Value = new Dictionary<string, object>()
{
{"Text", "Parking"},
{"Value", "Car"}
},
Separator = " / "
}
}
}
}
}
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```

##### Template

![before_foreach](https://user-images.githubusercontent.com/38832863/220123955-063c9345-3998-4fd7-982c-8d1e3b48bbf8.PNG)

##### Result

![after_foreach](https://user-images.githubusercontent.com/38832863/220123960-913a7140-2fa2-415e-bb3e-456e04167382.PNG)

### 条件判断

`@if``@endif` tags .

##### Example

```csharp
var value = new Dictionary<string, object>()
{
["Name"] = new List<MiniWordHyperLink>(){
new MiniWordHyperLink(){
Url = "https://google.com",
Text = "測試連結22!!"
},
new MiniWordHyperLink(){
Url = "https://google1.com",
Text = "測試連結11!!"
}
},
["Company_Name"] = "MiniSofteware",
["CreateDate"] = new DateTime(2021, 01, 01),
["VIP"] = true,
["Points"] = 123,
["APP"] = "Demo APP",
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```

##### Template

![before_if](https://user-images.githubusercontent.com/38832863/220125429-7dd6ce94-35c6-478e-8903-064f9cf9361a.PNG)

##### Result

![after_if](https://user-images.githubusercontent.com/38832863/220125435-72ea24b4-2412-45de-961a-ad4b2134417b.PNG)

##

```csharp
var value = new
{
Company_Name = new MiniWordColorText { Text = "MiniSofteware", FontColor = "#eb70AB", },
Name = new[] {
new MiniWordColorText { Text = "Ja", HighlightColor = "#eb70AB" },
new MiniWordColorText { Text = "ck", HighlightColor = "#a56abe" }
},
CreateDate = new MiniWordColorText
{
Text = new DateTime(2021, 01, 01).ToString(),
HighlightColor = "#eb70AB",
FontColor = "#ffffff",
},
VIP = true,
Points = 123,
APP = "Demo APP",
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```





## 其他
Expand Down
114 changes: 114 additions & 0 deletions README.zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,120 @@ MiniWord.SaveAsByTemplate(path, templatePath, value);



### 二级列表

Tag 是 `IEnumerable<MiniWordForeach>` 类别. 使用方式`{{foreach``endforeach}}`.

##### Example

```csharp
var value = new Dictionary<string, object>()
{
["TripHs"] = new List<Dictionary<string, object>>
{
new Dictionary<string, object>
{
{ "sDate", DateTime.Parse("2022-09-08 08:30:00") },
{ "eDate", DateTime.Parse("2022-09-08 15:00:00") },
{ "How", "Discussion requirement part1" },
{
"Details", new List<MiniWordForeach>()
{
new MiniWordForeach()
{
Value = new Dictionary<string, object>()
{
{"Text", "Air"},
{"Value", "Airplane"}
},
Separator = " | "
},
new MiniWordForeach()
{
Value = new Dictionary<string, object>()
{
{"Text", "Parking"},
{"Value", "Car"}
},
Separator = " / "
}
}
}
}
}
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```

##### Template

![before_foreach](https://user-images.githubusercontent.com/38832863/220123955-063c9345-3998-4fd7-982c-8d1e3b48bbf8.PNG)

##### Result

![after_foreach](https://user-images.githubusercontent.com/38832863/220123960-913a7140-2fa2-415e-bb3e-456e04167382.PNG)

### 条件判断

`@if``@endif` tags .

##### Example

```csharp
var value = new Dictionary<string, object>()
{
["Name"] = new List<MiniWordHyperLink>(){
new MiniWordHyperLink(){
Url = "https://google.com",
Text = "測試連結22!!"
},
new MiniWordHyperLink(){
Url = "https://google1.com",
Text = "測試連結11!!"
}
},
["Company_Name"] = "MiniSofteware",
["CreateDate"] = new DateTime(2021, 01, 01),
["VIP"] = true,
["Points"] = 123,
["APP"] = "Demo APP",
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```

##### Template

![before_if](https://user-images.githubusercontent.com/38832863/220125429-7dd6ce94-35c6-478e-8903-064f9cf9361a.PNG)

##### Result

![after_if](https://user-images.githubusercontent.com/38832863/220125435-72ea24b4-2412-45de-961a-ad4b2134417b.PNG)

##

```csharp
var value = new
{
Company_Name = new MiniWordColorText { Text = "MiniSofteware", FontColor = "#eb70AB", },
Name = new[] {
new MiniWordColorText { Text = "Ja", HighlightColor = "#eb70AB" },
new MiniWordColorText { Text = "ck", HighlightColor = "#a56abe" }
},
CreateDate = new MiniWordColorText
{
Text = new DateTime(2021, 01, 01).ToString(),
HighlightColor = "#eb70AB",
FontColor = "#ffffff",
},
VIP = true,
Points = 123,
APP = "Demo APP",
};
MiniWord.SaveAsByTemplate(path, templatePath, value);
```



## 其他

### POCO or dynamic 參數
Expand Down
3 changes: 2 additions & 1 deletion release-note/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
---


### 0.6.2
### 0.7.0
- [New] Add support to List inside List via `IEnumerable<MiniWordForeach>` and `{{foreach`/`endforeach}}` tags (via @eynarhaji)
- [New] Add support to @if statements inside templates (via @eynarhaji)
- [New] Support multiple color word by word (via @andy505050)

### 0.6.1
- [Bug] Fixed system does not support `IEnumerable<MiniWordHyperLink>` (#39 via @isdaniel)
Expand Down
5 changes: 5 additions & 0 deletions release-note/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

---

### 0.7.0
- [New] 支持 List inside List via `IEnumerable<MiniWordForeach>` and `{{foreach`/`endforeach}}` tags (via @eynarhaji)
- [New] 支持 @if statements inside templates (via @eynarhaji)
- [New] 支持 multiple color word by word (via @andy505050)

### 0.6.1
- [Bug] 修正系统不支持 `IEnumerable<MiniWordHyperLink>` (#39 via @isdaniel)

Expand Down
5 changes: 5 additions & 0 deletions release-note/README.zh-Hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

---

### 0.7.0
- [New] 支持 List inside List via `IEnumerable<MiniWordForeach>` and `{{foreach`/`endforeach}}` tags (via @eynarhaji)
- [New] 支持 @if statements inside templates (via @eynarhaji)
- [New] 支持 multiple color word by word (via @andy505050)

### 0.6.1
- [Bug] 修正系統不支持 `IEnumerable<MiniWordHyperLink>` (#39 via @isdaniel)

Expand Down
2 changes: 1 addition & 1 deletion src/MiniWord/MiniWord.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;net5.0</TargetFrameworks>
<Version>0.6.2</Version>
<Version>0.7.0</Version>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>MiniWord</AssemblyName>
Expand Down

0 comments on commit 6ccd8cf

Please sign in to comment.