Skip to content

Commit 334d1ea

Browse files
committed
- [Feature] support multiple breakline
- Add demo
1 parent e4de9cd commit 334d1ea

File tree

11 files changed

+290
-60
lines changed

11 files changed

+290
-60
lines changed

README.md

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,85 @@
99
---
1010

1111
<div align="center">
12-
<p><strong><a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | <a href="README.zh-Hant.md">繁體中文</a></strong></p>
12+
Your <a href="https://github.com/mini-software/MiniWord">Star</a> and <a href="https://miniexcel.github.io">dotnate</a> can make MiniWord better
1313
</div>
1414

1515
---
1616

17-
<div align="center">
18-
Your <a href="https://github.com/mini-software/MiniWord">Star</a> and <a href="https://miniexcel.github.io">Donate</a> can make MiniWord better
19-
</div>
17+
## Introduction
2018

21-
---
19+
MiniWord is an easy and effective .NET Word Template library.
2220

21+
![image](https://user-images.githubusercontent.com/12729184/190674408-12c03f86-31ea-4132-bb31-e2a793f8c40f.png)
2322

24-
### Introduction
2523

26-
MiniWord is an easy and effective .NET Word Template library.
2724

28-
### Basic Template Export
25+
## Tags
26+
27+
### Text
28+
29+
##### Example
30+
31+
```csharp
32+
var value = new Dictionary<string, object>()
33+
{
34+
["Name"] = "Jack",
35+
["Company_Name"] = "MiniSofteware",
36+
["CreateDate"] = new DateTime(2021, 01, 01),
37+
["VIP"] = true,
38+
["Points"] = 123,
39+
["APP"] = "Demo APP",
40+
};
41+
MiniWord.SaveAsByTemplate(path, templatePath, value);
42+
```
43+
44+
##### Result
45+
46+
![image](https://user-images.githubusercontent.com/12729184/190646113-04182d43-6b04-441d-911b-68de6af18039.png)
47+
48+
### Image
49+
50+
标签值为 `MiniWordPicture` 类别
51+
52+
##### Example
53+
54+
```csharp
55+
var value = new Dictionary<string, object>()
56+
{
57+
["Logo"] = new MiniWordPicture() { Path= PathHelper.GetFile("DemoLogo.png"), Width= 180, Height= 180 }
58+
};
59+
MiniWord.SaveAsByTemplate(path, templatePath, value);
60+
```
61+
62+
63+
64+
##### Template
65+
66+
![image](https://user-images.githubusercontent.com/12729184/190647953-6f9da393-e666-4658-a56d-b3a7f13c0ea1.png)
67+
68+
##### Result
69+
70+
![image](https://user-images.githubusercontent.com/12729184/190648179-30258d82-723d-4266-b711-43f132d1842d.png)
71+
72+
### List
73+
74+
tag value is `string[]` or `IList<string>` type
75+
76+
##### Example
2977

3078
```csharp
3179
var value = new Dictionary<string, object>()
3280
{
33-
["Company_Name"] = "MiniSofteware",
34-
["Name"] = "Jack",
35-
["CreateDate"] = new DateTime(2021, 01, 01),
36-
["VIP"] = true,
37-
["Points"] = 123,
38-
["APP"] = "Demo APP",
81+
["managers"] = new[] { "Jack" ,"Alan"},
82+
["employees"] = new[] { "Mike" ,"Henry"},
3983
};
4084
MiniWord.SaveAsByTemplate(path, templatePath, value);
4185
```
4286

43-
Template:
87+
Template
4488

45-
![image](https://user-images.githubusercontent.com/12729184/189614577-ac22d47c-30d5-4db5-9299-09f07211f1bf.png)
89+
![image](https://user-images.githubusercontent.com/12729184/190645513-230c54f3-d38f-47af-b844-0c8c1eff2f52.png)
4690

47-
Output:
91+
##### Result
4892

49-
![image](https://user-images.githubusercontent.com/12729184/189612248-dd9381de-bbb8-4c72-adec-ac8982f60f96.png)
93+
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)

README.zh-CN.md

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,80 @@
1313
---
1414

1515

16-
### 介绍
16+
## 介绍
1717

18-
MiniWord 简单 Word 模版导出+填充数据工具
18+
MiniWord .NET Word模板引擎,藉由Word模板和数据简单、快速生成文件
1919

20-
### 基本模版导出
20+
![image](https://user-images.githubusercontent.com/12729184/190674408-12c03f86-31ea-4132-bb31-e2a793f8c40f.png)
21+
22+
23+
24+
## 标签
25+
26+
### 文本
27+
28+
##### 代码例子
29+
30+
```csharp
31+
var value = new Dictionary<string, object>()
32+
{
33+
["Name"] = "Jack",
34+
["Company_Name"] = "MiniSofteware",
35+
["CreateDate"] = new DateTime(2021, 01, 01),
36+
["VIP"] = true,
37+
["Points"] = 123,
38+
["APP"] = "Demo APP",
39+
};
40+
MiniWord.SaveAsByTemplate(path, templatePath, value);
41+
```
42+
43+
##### 导出
44+
45+
![image](https://user-images.githubusercontent.com/12729184/190646113-04182d43-6b04-441d-911b-68de6af18039.png)
46+
47+
### 图片
48+
49+
标签值为 `MiniWordPicture` 类别
50+
51+
##### 代码例子
52+
53+
```csharp
54+
var value = new Dictionary<string, object>()
55+
{
56+
["Logo"] = new MiniWordPicture() { Path= PathHelper.GetFile("DemoLogo.png"), Width= 180, Height= 180 }
57+
};
58+
MiniWord.SaveAsByTemplate(path, templatePath, value);
59+
```
60+
61+
62+
63+
##### 模版
64+
65+
![image](https://user-images.githubusercontent.com/12729184/190647953-6f9da393-e666-4658-a56d-b3a7f13c0ea1.png)
66+
67+
##### 效果
68+
69+
![image](https://user-images.githubusercontent.com/12729184/190648179-30258d82-723d-4266-b711-43f132d1842d.png)
70+
71+
### 列表
72+
73+
标签值为 `string[]` 或是 `IList<string>`类别
74+
75+
##### 代码例子
2176

2277
```csharp
2378
var value = new Dictionary<string, object>()
2479
{
25-
["Company_Name"] = "MiniSofteware",
26-
["Name"] = "Jack",
27-
["CreateDate"] = new DateTime(2021, 01, 01),
28-
["VIP"] = true,
29-
["Points"] = 123,
30-
["APP"] = "Demo APP",
80+
["managers"] = new[] { "Jack" ,"Alan"},
81+
["employees"] = new[] { "Mike" ,"Henry"},
3182
};
3283
MiniWord.SaveAsByTemplate(path, templatePath, value);
3384
```
3485

35-
模版:
86+
##### 模版
3687

37-
![image](https://user-images.githubusercontent.com/12729184/189614577-ac22d47c-30d5-4db5-9299-09f07211f1bf.png)
88+
![image](https://user-images.githubusercontent.com/12729184/190645513-230c54f3-d38f-47af-b844-0c8c1eff2f52.png)
3889

39-
结果:
90+
##### 效果
4091

41-
![image](https://user-images.githubusercontent.com/12729184/189612248-dd9381de-bbb8-4c72-adec-ac8982f60f96.png)
92+
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)

README.zh-Hant.md

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,86 @@
99
---
1010

1111
<div align="center">
12-
<p><strong><a href="README.md">English</a> | <a href="README.zh-CN.md">簡體中文</a> | <a href="README.zh-Hant.md">繁體中文</a></strong></p>
12+
您的 <a href="https://github.com/mini-software/MiniWord">Star</a> <a href="https://miniexcel.github.io">贊助</a> 可以讓 MiniWord 走更遠
1313
</div>
1414

1515
---
1616

17-
<div align="center">
18-
您的 <a href="https://github.com/mini-software/MiniWord">Star</a> 和 <a href="https://miniexcel.github.io">贊助</a> 可以讓 MiniWord 走更遠
19-
</div>
20-
---
2117

18+
## 介紹
19+
20+
MiniWord .NET Word模板引擎,藉由Word模板和數據簡單、快速生成文件。
21+
22+
![image](https://user-images.githubusercontent.com/12729184/190674408-12c03f86-31ea-4132-bb31-e2a793f8c40f.png)
23+
24+
25+
26+
## 標籤
27+
28+
### 文本
29+
30+
##### 代碼例子
31+
32+
```csharp
33+
var value = new Dictionary<string, object>()
34+
{
35+
["Name"] = "Jack",
36+
["Company_Name"] = "MiniSofteware",
37+
["CreateDate"] = new DateTime(2021, 01, 01),
38+
["VIP"] = true,
39+
["Points"] = 123,
40+
["APP"] = "Demo APP",
41+
};
42+
MiniWord.SaveAsByTemplate(path, templatePath, value);
43+
```
44+
45+
##### 導出
46+
47+
![image](https://user-images.githubusercontent.com/12729184/190646113-04182d43-6b04-441d-911b-68de6af18039.png)
48+
49+
### 圖片
50+
51+
標籤值為 `MiniWordPicture` 類別
52+
53+
##### 代碼例子
54+
55+
```csharp
56+
var value = new Dictionary<string, object>()
57+
{
58+
["Logo"] = new MiniWordPicture() { Path= PathHelper.GetFile("DemoLogo.png"), Width= 180, Height= 180 }
59+
};
60+
MiniWord.SaveAsByTemplate(path, templatePath, value);
61+
```
62+
63+
64+
65+
##### 模版
66+
67+
![image](https://user-images.githubusercontent.com/12729184/190647953-6f9da393-e666-4658-a56d-b3a7f13c0ea1.png)
68+
69+
##### 效果
70+
71+
![image](https://user-images.githubusercontent.com/12729184/190648179-30258d82-723d-4266-b711-43f132d1842d.png)
2272

23-
### 介紹
73+
### 列表
2474

25-
MiniWord 簡單 Word 模版導出+填充數據工具。
75+
標籤值為 `string[]` 或是 `IList<string>`類別
2676

27-
### 基本模版導出
77+
##### 代碼例子
2878

2979
```csharp
3080
var value = new Dictionary<string, object>()
3181
{
32-
["Company_Name"] = "MiniSofteware",
33-
["Name"] = "Jack",
34-
["CreateDate"] = new DateTime(2021, 01, 01),
35-
["VIP"] = true,
36-
["Points"] = 123,
37-
["APP"] = "Demo APP",
82+
["managers"] = new[] { "Jack" ,"Alan"},
83+
["employees"] = new[] { "Mike" ,"Henry"},
3884
};
3985
MiniWord.SaveAsByTemplate(path, templatePath, value);
4086
```
4187

42-
模版:
88+
##### 模版
4389

44-
![image](https://user-images.githubusercontent.com/12729184/189614577-ac22d47c-30d5-4db5-9299-09f07211f1bf.png)
90+
![image](https://user-images.githubusercontent.com/12729184/190645513-230c54f3-d38f-47af-b844-0c8c1eff2f52.png)
4591

46-
結果:
92+
##### 效果
4793

48-
![image](https://user-images.githubusercontent.com/12729184/189612248-dd9381de-bbb8-4c72-adec-ac8982f60f96.png)
94+
![image](https://user-images.githubusercontent.com/12729184/190645704-1f6405e9-71e3-45b9-aa99-2ba52e5e1519.png)

release-note/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@
2222

2323
---
2424

25+
26+
27+
### 0.2.0
28+
29+
- [Feature] support array list string to generate multiple row #11
30+
- [Feature] support image #10 #3
31+
- [Feature] image support to custom width and height #8
32+
- [Feature] support multiple breakline
33+
- [Optimize] Remove xmlns declaration #7
34+
2535
### 0.1.1
36+
2637
- [Bug] Fix Fuzzy Regex replace similar key
2738

2839
### 0.1.0

release-note/README.zh-CN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222

2323
---
2424

25+
### 0.2.0
26+
27+
- [Feature] 支持 array list string 生成多行 #11
28+
- [Feature] 支持图片 #10 #3
29+
- [Feature] 图片支持自定义 width 和 height #8
30+
- [Feature] 支持多 breakline
31+
- [Optimize] 删除 xmlns declaration #7
32+
2533
### 0.1.1
2634
- [Bug] 修正 Fuzzy Regex replace similar key
2735

release-note/README.zh-Hant.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222

2323
---
2424

25+
### 0.2.0
26+
- [Feature] 支持 array list string 生成多行 #11
27+
- [Feature] 支持圖片 #10 #3
28+
- [Feature] 圖片支持自定義 width 和 height #8
29+
- [Feature] 支持多 breakline
30+
- [Optimize] 刪除 xmlns declaration #7
31+
2532
### 0.1.1
2633
- [Bug] 修正 Fuzzy Regex replace similar key
2734

samples/docx/TestDemo02.docx

-4.16 KB
Binary file not shown.

samples/docx/TestDemo03.docx

158 KB
Binary file not shown.

0 commit comments

Comments
 (0)