Skip to content

Commit 6045f93

Browse files
committed
把 Markdown 字体改大了,看起来更舒服些
1 parent fc4df31 commit 6045f93

File tree

8 files changed

+51
-23
lines changed

8 files changed

+51
-23
lines changed

SwiftPamphletApp.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
08448F0D2799035600B61353 /* PlaySecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08448F0C2799035600B61353 /* PlaySecurity.swift */; };
1616
08448F0F2799328700B61353 /* css_cn.html in Resources */ = {isa = PBXBuildFile; fileRef = 08448F0E2799328700B61353 /* css_cn.html */; };
1717
08448F41279AC1A900B61353 /* PlayMacOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08448F40279AC1A900B61353 /* PlayMacOS.swift */; };
18+
08448F43279B83C000B61353 /* archiveDevelopers.json in Resources */ = {isa = PBXBuildFile; fileRef = 08448F42279B83C000B61353 /* archiveDevelopers.json */; };
1819
086A5F072744E88E00FECE02 /* SwiftPamphletAppApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086A5F062744E88E00FECE02 /* SwiftPamphletAppApp.swift */; };
1920
086A5F0B2744E89100FECE02 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 086A5F0A2744E89100FECE02 /* Assets.xcassets */; };
2021
086A5F0E2744E89100FECE02 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 086A5F0D2744E89100FECE02 /* Preview Assets.xcassets */; };
@@ -85,6 +86,7 @@
8586
08448F0C2799035600B61353 /* PlaySecurity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaySecurity.swift; sourceTree = "<group>"; };
8687
08448F0E2799328700B61353 /* css_cn.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = css_cn.html; sourceTree = "<group>"; };
8788
08448F40279AC1A900B61353 /* PlayMacOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayMacOS.swift; sourceTree = "<group>"; };
89+
08448F42279B83C000B61353 /* archiveDevelopers.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = archiveDevelopers.json; sourceTree = "<group>"; };
8890
086A5F032744E88E00FECE02 /* 戴铭的Swift小册子.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "戴铭的Swift小册子.app"; sourceTree = BUILT_PRODUCTS_DIR; };
8991
086A5F062744E88E00FECE02 /* SwiftPamphletAppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftPamphletAppApp.swift; sourceTree = "<group>"; };
9092
086A5F0A2744E89100FECE02 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@@ -359,6 +361,7 @@
359361
isa = PBXGroup;
360362
children = (
361363
08B4C93B2774786800742084 /* archiveRepos.json */,
364+
08448F42279B83C000B61353 /* archiveDevelopers.json */,
362365
);
363366
path = Archive;
364367
sourceTree = "<group>";
@@ -496,6 +499,7 @@
496499
086A5F4D2744EF3B00FECE02 /* guide-features.json in Resources */,
497500
086A5F58274CB8B500FECE02 /* guide-subject.json in Resources */,
498501
08AEAEE9277EDD9000B969E2 /* rssfeed.json in Resources */,
502+
08448F43279B83C000B61353 /* archiveDevelopers.json in Resources */,
499503
086A5F4F2744EF3B00FECE02 /* guide-syntax.json in Resources */,
500504
086A5F5E274CCAEC00FECE02 /* lib-SwiftUI.json in Resources */,
501505
086A5F0E2744E89100FECE02 /* Preview Assets.xcassets in Resources */,

SwiftPamphletApp/GItHubAPI/DetailView/IssueView.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import SwiftUI
9-
import MarkdownUI
109

1110
struct IssueView: View {
1211
enum EnterType {
@@ -46,7 +45,7 @@ struct IssueView: View {
4645
}
4746
} // end HStack
4847
}
49-
Markdown(vm.issue.body ?? "") // TODO: 等 SwiftUI 的 Text 支持完整的 markdown,再进行替换
48+
MarkdownView(s: vm.issue.body ?? "") // TODO: 等 SwiftUI 的 Text 支持完整的 markdown,再进行替换
5049
} // end VStack
5150
Spacer()
5251
} // end HStack
@@ -74,7 +73,7 @@ struct IssueView: View {
7473
}
7574
HStack {
7675
VStack(alignment: .leading, spacing: 0) {
77-
Markdown(comment.body)
76+
MarkdownView(s: comment.body)
7877
}
7978
Spacer()
8079
}

SwiftPamphletApp/GItHubAPI/DetailView/RepoView.swift

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import SwiftUI
9-
import MarkdownUI
109

1110
struct RepoView: View {
1211
enum EnterType {
@@ -119,7 +118,7 @@ struct ReadmeView: View {
119118
var content: String
120119
var body: some View {
121120
ScrollView {
122-
Markdown(content.base64Decoded() ?? "failed")
121+
MarkdownView(s: content.base64Decoded() ?? "failed")
123122
.padding(10)
124123
}
125124
}
@@ -205,15 +204,14 @@ struct RepoCommitLabelView: View {
205204
HStack {
206205
if commit.author != nil {
207206
AsyncImageWithPlaceholder(size: .tinySize, url: commit.author?.avatarUrl ?? "")
208-
// Text(commit.author?.login ?? "").bold()
209207
ButtonGoGitHubWeb(url: commit.author?.login ?? "", text: commit.author?.login ?? "", ignoreHost: true, bold: true)
210208

211209
} else {
212210
Text(commit.commit.author.name ?? "")
213211
}
214212
ButtonGoGitHubWeb(url: "https://github.com/\(repo.fullName)/commit/\(commit.sha ?? "")", text: "commit")
215213
} // end HStack
216-
Markdown(commit.commit.message ?? "")
214+
MarkdownView(s: commit.commit.message ?? "")
217215
} // end VStack
218216
}
219217
}
@@ -225,7 +223,7 @@ struct IssueLabelView: View {
225223
GitHubApiTimeView(timeStr: issue.updatedAt)
226224
HStack {
227225
Text(issue.title)
228-
.font(.title3)
226+
.font(.title2)
229227
Text("\(issue.comments) 回复")
230228
.foregroundColor(.secondary)
231229
.font(.footnote)
@@ -234,7 +232,7 @@ struct IssueLabelView: View {
234232
AsyncImageWithPlaceholder(size: .tinySize, url: issue.user.avatarUrl)
235233
ButtonGoGitHubWeb(url: issue.user.login, text: issue.user.login, ignoreHost: true)
236234
}
237-
Markdown(issue.body ?? "")
235+
MarkdownView(s: issue.body ?? "")
238236
} // end VStack
239237
}
240238
}
@@ -252,7 +250,7 @@ struct IssueEventLabelView: View {
252250
}
253251
HStack {
254252
Text(issueEvent.issue.title)
255-
.font(.title3)
253+
.font(.title2)
256254
Text("\(issueEvent.issue.comments) 回复")
257255
.foregroundColor(.secondary)
258256
.font(.footnote)
@@ -261,7 +259,7 @@ struct IssueEventLabelView: View {
261259
AsyncImageWithPlaceholder(size: .tinySize, url: issueEvent.issue.user.avatarUrl)
262260
ButtonGoGitHubWeb(url: issueEvent.issue.user.login, text: issueEvent.issue.user.login, ignoreHost: true)
263261
}
264-
Markdown(issueEvent.issue.body ?? "")
262+
MarkdownView(s: issueEvent.issue.body ?? "")
265263
} // end VStack
266264
}
267265
}

SwiftPamphletApp/GItHubAPI/DetailView/UserView.swift

+9-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77

88
import SwiftUI
9-
import MarkdownUI
109

1110
struct UserView: View {
1211
@EnvironmentObject var appVM: AppVM
@@ -131,7 +130,7 @@ struct ListCommits: View {
131130
var body: some View {
132131
ForEach(event.payload.commits ?? [PayloadCommitModel](), id: \.self) { c in
133132
ButtonGoGitHubWeb(url: "https://github.com/\(event.repo.name)/commit/\(c.sha ?? "")", text: "提交")
134-
Text(c.message ?? "")
133+
MarkdownView(s: c.message ?? "")
135134
}
136135
}
137136
}
@@ -183,13 +182,14 @@ struct AUserEventLabel: View {
183182

184183
if event.payload.issue?.number != nil {
185184
if event.payload.issue?.title != nil {
186-
Text(event.payload.issue?.title ?? "").bold()
185+
Text(event.payload.issue?.title ?? "")
186+
.font(.system(.title2))
187187
}
188188
if event.payload.issue?.body != nil && event.type != "IssueCommentEvent" {
189-
Markdown(event.payload.issue?.body ?? "")
189+
MarkdownView(s: event.payload.issue?.body ?? "")
190190
}
191191
if event.type == "IssueCommentEvent" && event.payload.comment?.body != nil {
192-
Markdown(event.payload.comment?.body ?? "")
192+
MarkdownView(s: event.payload.comment?.body ?? "")
193193
}
194194
}
195195

@@ -199,15 +199,16 @@ struct AUserEventLabel: View {
199199

200200
if event.payload.pullRequest != nil {
201201
if event.payload.pullRequest?.title != nil {
202-
Text(event.payload.pullRequest?.title ?? "").bold()
202+
Text(event.payload.pullRequest?.title ?? "")
203+
.font(.system(.title2))
203204
}
204205
if event.payload.pullRequest?.body != nil {
205-
Markdown(event.payload.pullRequest?.body ?? "")
206+
MarkdownView(s: event.payload.pullRequest?.body ?? "")
206207
}
207208
}
208209

209210
if event.payload.description != nil {
210-
Markdown(event.payload.description ?? "")
211+
MarkdownView(s: event.payload.description ?? "")
211212
}
212213
} // end VStack
213214
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"name":"逆向",
4+
"id":2201220814,
5+
"users":[
6+
{
7+
"id":"horsicq",
8+
"des":"研究二进制,擅长汇编和C++,开发了很多逆向工具"
9+
}
10+
]
11+
}
12+
]

SwiftPamphletApp/Resource/Archive/archiveRepos.json

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
{
8484
"id":"jmpews/Dobby",
8585
"des":"轻量多平台 Hook"
86+
},
87+
{
88+
"id":"horsicq/XMachOViewer",
89+
"des":"查看 Mach-O"
8690
}
8791
]
8892
},

SwiftPamphletApp/SwiftPamphletAppApp.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ struct SwiftPamphletApp: View {
117117
Button {
118118
gotoWebBrowser(urlStr: appVM.webLinkStr)
119119
} label: {
120-
Text("用浏览器打开")
121120
Label("Browser", systemImage: "safari")
121+
Text("用浏览器打开")
122122
}
123123
ShareView(s: appVM.webLinkStr)
124124
}

SwiftPamphletApp/ViewComponet/ViewComponet.swift

+13-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77

88
import SwiftUI
99
import WebKit
10+
import MarkdownUI
11+
12+
// MarkdownUI
13+
struct MarkdownView: View {
14+
var s: String
15+
var body: some View {
16+
Markdown(s)
17+
.markdownStyle(MarkdownStyle(font:.title3))
18+
}
19+
}
1020

1121
// 共享菜单
1222
struct ShareView: View {
@@ -18,21 +28,21 @@ struct ShareView: View {
1828
p.declareTypes([.string], owner: nil)
1929
p.setString(s, forType: .string)
2030
} label: {
21-
Text("拷贝链接")
2231
Image(systemName: "doc.on.doc")
32+
Text("拷贝链接")
2333
}
2434
Divider()
2535
ForEach(NSSharingService.sharingServices(forItems: [""]), id: \.title) { item in
2636
Button {
2737
item.perform(withItems: [s])
2838
} label: {
29-
Text(item.title)
3039
Image(nsImage: item.image)
40+
Text(item.title)
3141
}
3242
}
3343
} label: {
34-
Text("分享")
3544
Image(systemName: "square.and.arrow.up")
45+
Text("分享")
3646
}
3747
}
3848
}

0 commit comments

Comments
 (0)