Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 5a68c76

Browse files
committed
Revert "Load CSS from package resource when available (#192)"
This reverts commit 44c3026.
1 parent f441648 commit 5a68c76

File tree

6 files changed

+10
-27
lines changed

6 files changed

+10
-27
lines changed

.node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"not dead"
66
],
77
"scripts": {
8-
"watch": "postcss -w ../Assets/**/*.css -o ../Sources/swift-doc/Resources/all.min.css --config ./postcss.config.js"
8+
"watch": "postcss -w ../Assets/**/*.css -o ../Resources/all.min.css --config ./postcss.config.js"
99
},
1010
"dependencies": {
1111
"cssnano": "^4.1.10",

Changelog.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131

3232
- Changed GitHub Action to use prebuilt Docker image.
3333
#185 by @mattt and @MaxDesiatov.
34-
- Changed build command to load CSS from package resource when available.
35-
#192 by @mattt.
3634

3735
## [1.0.0-beta.4] - 2020-07-31
3836

Package.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ let package = Package(
4040
.product(name: "SwiftSyntaxHighlighter", package: "SwiftSyntaxHighlighter"),
4141
.product(name: "Logging", package: "swift-log"),
4242
.product(name: "LoggingGitHubActions", package: "LoggingGitHubActions")
43-
],
44-
resources: [
45-
.copy("Resources")
4643
]
4744
),
4845
.target(
File renamed without changes.

Sources/SwiftDoc/SourceFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public struct SourceFile: Hashable, Codable {
4545
sourceLocationConverter = SourceLocationConverter(file: url.path(relativeTo: directory), tree: tree)
4646
super.init()
4747

48-
walk(tree)
48+
_ = walk(tree)
4949

5050
assert(context.isEmpty)
5151
}

Sources/swift-doc/Subcommands/Generate.swift

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,9 @@ extension SwiftDoc {
120120
}
121121

122122
if case .html = format {
123-
let destinationURL = outputDirectoryURL.appendingPathComponent("all.css")
124-
125-
func fetchRemoteCSS() throws -> Data {
126-
let url = URL(string: "https://raw.githubusercontent.com/SwiftDocOrg/swift-doc/master/Resources/all.min.css")!
127-
return try Data(contentsOf: url)
128-
}
129-
130-
#if swift(>=5.3)
131-
if let resourceURL = Bundle.module.url(forResource: "all.min", withExtension: "css") {
132-
if !fileManager.fileExists(atPath: destinationURL.path) {
133-
try fileManager.copyItem(at: resourceURL, to: destinationURL)
134-
}
135-
} else {
136-
let cssData = try fetchRemoteCSS()
137-
try writeFile(cssData, to: destinationURL)
138-
}
139-
#else
140-
let cssData = try fetchRemoteCSS()
141-
try writeFile(cssData, to: destinationURL)
142-
#endif
123+
let cssData = try fetchRemoteCSS()
124+
let cssURL = outputDirectoryURL.appendingPathComponent("all.css")
125+
try writeFile(cssData, to: cssURL)
143126
}
144127

145128
} catch {
@@ -148,3 +131,8 @@ extension SwiftDoc {
148131
}
149132
}
150133
}
134+
135+
func fetchRemoteCSS() throws -> Data {
136+
let url = URL(string: "https://raw.githubusercontent.com/SwiftDocOrg/swift-doc/master/Resources/all.min.css")!
137+
return try Data(contentsOf: url)
138+
}

0 commit comments

Comments
 (0)