This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Sources/swift-doc/Subcommands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,11 +133,24 @@ extension SwiftDoc {
133133}
134134
135135func fetchRemoteCSS( ) throws -> Data {
136+ #if swift(>=5.3)
136137 let cssURL = Bundle . module. url ( forResource: " all.min " , withExtension: " css " ) !
137138 return try Data ( contentsOf: cssURL)
139+ #else
140+ let url = URL ( string: " https://raw.githubusercontent.com/SwiftDocOrg/swift-doc/master/Resources/all.min.css " ) !
141+ return try Data ( contentsOf: url)
142+ #endif
138143}
139144
140145func fetchRemoteJS( ) throws -> Data {
141- let jsURL = Bundle . module. url ( forResource: " all " , withExtension: " js " ) !
146+ #if swift(>=5.3)
147+ let jsURL = Bundle . module. url ( forResource: " all " , withExtension: " js " ) !
142148 return try Data ( contentsOf: jsURL)
149+ #else
150+ return Data ( """
151+ window.addEventListener( " load " , ()=>{
152+ document.querySelector( " .theme-select-container " ).hidden = true;
153+ })
154+ """ . utf8)
155+ #endif
143156}
You can’t perform that action at this time.
0 commit comments