Skip to content

Commit abe3a3f

Browse files
committed
Support code highlighting
1 parent 7a42eae commit abe3a3f

21 files changed

+1535
-128
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
# SKGenerateModelTool
22

3-
[![](https://img.shields.io/badge/.dmg-4.2MB-brightgreen)](https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg) ![](https://img.shields.io/badge/Dart-flutter-blue) ![](https://img.shields.io/badge/Swift-91.7%25-brightgreen) ![](https://img.shields.io/badge/license-MIT-green)
3+
[![](https://img.shields.io/badge/.dmg-4.2MB-brightgreen)](https://github.com/Xcoder1011/SKGenerateModelTool/blob/master/SKGenerateModelTool.dmg) ![](https://img.shields.io/badge/Dart-flutter-blue)
4+
![](https://img.shields.io/badge/TypeScript-interface-brightgreen)
5+
![](https://img.shields.io/badge/Swift-91.7%25-brightgreen)
6+
![](https://img.shields.io/badge/license-MIT-green)
47

5-
- 支持Objective-C / Swift / Dart
8+
- 支持Objective-C / Swift / Dart / TypeScript
69
- 支持通过URL链接或json字符串一键生成model文件
7-
- 支持字符串加密(可设置不同的密钥,开发者可自行修改加密算法)
8-
- 支持自定义model父类、自定义model前缀、自定义文件名、自定义作者名
9-
- 支持自定义输出文件夹路径
1010
- 兼容YYModel / MJExtension / HandyJSON解析
11-
- 兼容服务端返回“id”字段
12-
- 类驼峰命名
11+
- 支持字符串加密(可设置不同的密钥,开发者可自行修改加密算法)
12+
- 支持自定义model父类名、自定义model前缀、自定义作者名、添加注释
13+
- 支持代码高亮(使用[highlight.js](https://highlightjs.org/)
14+
- 支持导出TypeScript Interfaces
15+
- 支持自定义导出文件路径
1316
- Flutter Model解析兼容了服务端返回string/int/double时数据类型混用的情况
17+
- 兼容服务端返回“id”字段
18+
- 支持类驼峰命名
1419

15-
- Support OC / Swift / Dart
20+
- Support OC / Swift / Dart / TypeScript
1621
- Supports one-click generation of model files through URL links or json strings
22+
- Compatible with YYModel / MJExtension analysis
1723
- Support string encryption (different keys can be set, developers can modify the encryption algorithm)
18-
- Support custom model parent class, custom model prefix, custom file name, custom author name
24+
- Support custom model superclass name, custom model prefix, custom author name, add comments
25+
- Support code highlighting(It uses [highlight.js](https://highlightjs.org/) as it core)
26+
- Support for exporting TypeScript Interfaces
1927
- Support custom output folder path
20-
- Compatible with YYModel / MJExtension analysis
28+
- Flutter model parsing is compatible with mixed data types when the server returns string / int / double
2129
- Compatible server returns "id" field
2230
- Supports hump naming
23-
- Flutter model parsing is compatible with mixed data types when the server returns string / int / double
31+
2432

2533
![SKGenerateModelTool](../master/images/home.png)
2634

@@ -128,6 +136,9 @@ Map<String, dynamic> _$SKDataModelToJson(SKDataModel instance) {
128136
###### Flutter Model header
129137
![header](../master/images/flutter1.png)
130138

139+
###### TypeScript Interfaces
140+
![header](../master/images/typescript.png)
141+
131142
###### 字符串加密示例
132143
![字符串加密示例](../master/images/encrypt.png)
133144

SKGenerateModelTool.dmg

297 KB
Binary file not shown.

SKGenerateModelTool.xcodeproj/project.pbxproj

Lines changed: 98 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
A44B9CFD2786953900BA8991 /* xcode.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9C992786953900BA8991 /* xcode.min.css */; };
11+
A44B9D002786953900BA8991 /* vs2015.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9C9C2786953900BA8991 /* vs2015.min.css */; };
12+
A44B9D2C2786953A00BA8991 /* github.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9CC82786953900BA8991 /* github.min.css */; };
13+
A44B9D512786953A00BA8991 /* highlight.min.js in Resources */ = {isa = PBXBuildFile; fileRef = A44B9CEE2786953900BA8991 /* highlight.min.js */; };
14+
A44B9D522786953A00BA8991 /* CodeAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44B9CF02786953900BA8991 /* CodeAttributedString.swift */; };
15+
A44B9D532786953A00BA8991 /* Highlightr.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44B9CF12786953900BA8991 /* Highlightr.swift */; };
16+
A44B9D552786953A00BA8991 /* HTMLUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44B9CF32786953900BA8991 /* HTMLUtils.swift */; };
17+
A44B9D562786953A00BA8991 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44B9CF42786953900BA8991 /* Theme.swift */; };
18+
A44B9D572786953A00BA8991 /* Shims.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44B9CF52786953900BA8991 /* Shims.swift */; };
19+
A44B9D5D27870E5500BA8991 /* androidstudio.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9D5C27870E5500BA8991 /* androidstudio.min.css */; };
20+
A44B9D5F27870E8100BA8991 /* vs.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9D5E27870E8100BA8991 /* vs.min.css */; };
21+
A44B9D6127870EA900BA8991 /* idea.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9D6027870EA900BA8991 /* idea.min.css */; };
22+
A44B9D6B2787173F00BA8991 /* docco.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9D6A2787173F00BA8991 /* docco.min.css */; };
23+
A44B9D6D2787193E00BA8991 /* pojoaque.min.css in Resources */ = {isa = PBXBuildFile; fileRef = A44B9D6C2787193E00BA8991 /* pojoaque.min.css */; };
1024
BC6E5D5224C0770800809D98 /* EncryptExampleModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6E5D5124C0770800809D98 /* EncryptExampleModel.m */; };
1125
BC874A1A250A238C00F3A346 /* SKTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC874A19250A238C00F3A346 /* SKTextView.swift */; };
1226
BC88CEA12467A8A600A4828B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC88CEA02467A8A600A4828B /* AppDelegate.swift */; };
@@ -19,6 +33,20 @@
1933
/* End PBXBuildFile section */
2034

2135
/* Begin PBXFileReference section */
36+
A44B9C992786953900BA8991 /* xcode.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = xcode.min.css; sourceTree = "<group>"; };
37+
A44B9C9C2786953900BA8991 /* vs2015.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = vs2015.min.css; sourceTree = "<group>"; };
38+
A44B9CC82786953900BA8991 /* github.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = github.min.css; sourceTree = "<group>"; };
39+
A44B9CEE2786953900BA8991 /* highlight.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = highlight.min.js; sourceTree = "<group>"; };
40+
A44B9CF02786953900BA8991 /* CodeAttributedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeAttributedString.swift; sourceTree = "<group>"; };
41+
A44B9CF12786953900BA8991 /* Highlightr.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Highlightr.swift; sourceTree = "<group>"; };
42+
A44B9CF32786953900BA8991 /* HTMLUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTMLUtils.swift; sourceTree = "<group>"; };
43+
A44B9CF42786953900BA8991 /* Theme.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; };
44+
A44B9CF52786953900BA8991 /* Shims.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shims.swift; sourceTree = "<group>"; };
45+
A44B9D5C27870E5500BA8991 /* androidstudio.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = androidstudio.min.css; sourceTree = "<group>"; };
46+
A44B9D5E27870E8100BA8991 /* vs.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = vs.min.css; sourceTree = "<group>"; };
47+
A44B9D6027870EA900BA8991 /* idea.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = idea.min.css; sourceTree = "<group>"; };
48+
A44B9D6A2787173F00BA8991 /* docco.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = docco.min.css; sourceTree = "<group>"; };
49+
A44B9D6C2787193E00BA8991 /* pojoaque.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = pojoaque.min.css; sourceTree = "<group>"; };
2250
BC6E5BD824C071EE00809D98 /* SKEncryptHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKEncryptHeader.h; sourceTree = "<group>"; };
2351
BC6E5D5024C0770800809D98 /* EncryptExampleModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EncryptExampleModel.h; sourceTree = "<group>"; };
2452
BC6E5D5124C0770800809D98 /* EncryptExampleModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EncryptExampleModel.m; sourceTree = "<group>"; };
@@ -47,6 +75,59 @@
4775
/* End PBXFrameworksBuildPhase section */
4876

4977
/* Begin PBXGroup section */
78+
A44B9C8F2786922C00BA8991 /* Highlightr */ = {
79+
isa = PBXGroup;
80+
children = (
81+
A44B9C902786953900BA8991 /* Assets */,
82+
A44B9CEF2786953900BA8991 /* Classes */,
83+
);
84+
path = Highlightr;
85+
sourceTree = "<group>";
86+
};
87+
A44B9C902786953900BA8991 /* Assets */ = {
88+
isa = PBXGroup;
89+
children = (
90+
A44B9C922786953900BA8991 /* styles */,
91+
A44B9CEC2786953900BA8991 /* Highlighter */,
92+
);
93+
path = Assets;
94+
sourceTree = "<group>";
95+
};
96+
A44B9C922786953900BA8991 /* styles */ = {
97+
isa = PBXGroup;
98+
children = (
99+
A44B9C992786953900BA8991 /* xcode.min.css */,
100+
A44B9C9C2786953900BA8991 /* vs2015.min.css */,
101+
A44B9CC82786953900BA8991 /* github.min.css */,
102+
A44B9D5E27870E8100BA8991 /* vs.min.css */,
103+
A44B9D6C2787193E00BA8991 /* pojoaque.min.css */,
104+
A44B9D5C27870E5500BA8991 /* androidstudio.min.css */,
105+
A44B9D6A2787173F00BA8991 /* docco.min.css */,
106+
A44B9D6027870EA900BA8991 /* idea.min.css */,
107+
);
108+
path = styles;
109+
sourceTree = "<group>";
110+
};
111+
A44B9CEC2786953900BA8991 /* Highlighter */ = {
112+
isa = PBXGroup;
113+
children = (
114+
A44B9CEE2786953900BA8991 /* highlight.min.js */,
115+
);
116+
path = Highlighter;
117+
sourceTree = "<group>";
118+
};
119+
A44B9CEF2786953900BA8991 /* Classes */ = {
120+
isa = PBXGroup;
121+
children = (
122+
A44B9CF02786953900BA8991 /* CodeAttributedString.swift */,
123+
A44B9CF12786953900BA8991 /* Highlightr.swift */,
124+
A44B9CF32786953900BA8991 /* HTMLUtils.swift */,
125+
A44B9CF42786953900BA8991 /* Theme.swift */,
126+
A44B9CF52786953900BA8991 /* Shims.swift */,
127+
);
128+
path = Classes;
129+
sourceTree = "<group>";
130+
};
50131
BC88CE942467A8A600A4828B = {
51132
isa = PBXGroup;
52133
children = (
@@ -66,6 +147,7 @@
66147
BC88CE9F2467A8A600A4828B /* SKGenerateModelTool */ = {
67148
isa = PBXGroup;
68149
children = (
150+
A44B9C8F2786922C00BA8991 /* Highlightr */,
69151
BC88CEA02467A8A600A4828B /* AppDelegate.swift */,
70152
BC88CEA22467A8A600A4828B /* ViewController.swift */,
71153
BCB184B224B808AF00C2A5D3 /* SKEncryptString */,
@@ -151,7 +233,16 @@
151233
isa = PBXResourcesBuildPhase;
152234
buildActionMask = 2147483647;
153235
files = (
236+
A44B9D2C2786953A00BA8991 /* github.min.css in Resources */,
237+
A44B9D6127870EA900BA8991 /* idea.min.css in Resources */,
238+
A44B9CFD2786953900BA8991 /* xcode.min.css in Resources */,
154239
BC88CEA52467A8AA00A4828B /* Assets.xcassets in Resources */,
240+
A44B9D002786953900BA8991 /* vs2015.min.css in Resources */,
241+
A44B9D6D2787193E00BA8991 /* pojoaque.min.css in Resources */,
242+
A44B9D5D27870E5500BA8991 /* androidstudio.min.css in Resources */,
243+
A44B9D512786953A00BA8991 /* highlight.min.js in Resources */,
244+
A44B9D5F27870E8100BA8991 /* vs.min.css in Resources */,
245+
A44B9D6B2787173F00BA8991 /* docco.min.css in Resources */,
155246
BC88CEA82467A8AA00A4828B /* Main.storyboard in Resources */,
156247
);
157248
runOnlyForDeploymentPostprocessing = 0;
@@ -167,9 +258,14 @@
167258
BC874A1A250A238C00F3A346 /* SKTextView.swift in Sources */,
168259
BCB6929F24A2EC8F004AC91A /* EncryptionController.swift in Sources */,
169260
BC88D01E2467C2AA00A4828B /* SKCodeBuilder.swift in Sources */,
261+
A44B9D562786953A00BA8991 /* Theme.swift in Sources */,
262+
A44B9D552786953A00BA8991 /* HTMLUtils.swift in Sources */,
170263
BC88CEA32467A8A600A4828B /* ViewController.swift in Sources */,
171264
BCB184B424B8090500C2A5D3 /* SKEncryptTool.swift in Sources */,
172265
BC88CEA12467A8A600A4828B /* AppDelegate.swift in Sources */,
266+
A44B9D522786953A00BA8991 /* CodeAttributedString.swift in Sources */,
267+
A44B9D572786953A00BA8991 /* Shims.swift in Sources */,
268+
A44B9D532786953A00BA8991 /* Highlightr.swift in Sources */,
173269
);
174270
runOnlyForDeploymentPostprocessing = 0;
175271
};
@@ -313,7 +409,7 @@
313409
"$(inherited)",
314410
"@executable_path/../Frameworks",
315411
);
316-
MACOSX_DEPLOYMENT_TARGET = 10.10;
412+
MACOSX_DEPLOYMENT_TARGET = 10.11;
317413
PRODUCT_BUNDLE_IDENTIFIER = com.Xcoder1011.SKGenerateModelTool;
318414
PRODUCT_NAME = "$(TARGET_NAME)";
319415
SWIFT_OBJC_BRIDGING_HEADER = "SKGenerateModelTool/SKEncryptString/SKGenerateModelTool-Bridging-Header.h";
@@ -335,7 +431,7 @@
335431
"$(inherited)",
336432
"@executable_path/../Frameworks",
337433
);
338-
MACOSX_DEPLOYMENT_TARGET = 10.10;
434+
MACOSX_DEPLOYMENT_TARGET = 10.11;
339435
PRODUCT_BUNDLE_IDENTIFIER = com.Xcoder1011.SKGenerateModelTool;
340436
PRODUCT_NAME = "$(TARGET_NAME)";
341437
SWIFT_OBJC_BRIDGING_HEADER = "SKGenerateModelTool/SKEncryptString/SKGenerateModelTool-Bridging-Header.h";

0 commit comments

Comments
 (0)