Post

Replies

Boosts

Views

Activity

Reply to How to host multiple docarchives on a single http server?
I've been playing with this and managed to get it to work on a single domain. I noticed most of the files had a hash at the end of them, so I merged them all down into a single .docarchive file. Of course, this may break in the future, but for now it works # Delete existing .doccarchive rm -rf templates/AllProjects.doccarchive # Create a working folder mkdir templates/working_dir # Copy most files, excluding the index and metadata.json files to the working directory rsync -a --exclude 'index.html' --exclude 'metadata.json' templates/ProjectA.doccarchive/* templates/working_dir rsync -a --exclude 'index.html' --exclude 'metadata.json' templates/ProjectB.doccarchive/* templates/working_dir # Copy across the index.html file from each Archive, but give it a new name when copying rsync templates/ProjectA.doccarchive/index.html templates/test/projectA.html rsync templates/ProjectB.doccarchive/index.html templates/test/projectB.html # Create a new .doccarchive folder mv templates/working_dir templates/AllProjects.doccarchive You can then host this on your server and point to /documentation/ProjectA or /documentation/ProjectB. There is one current drawback I can see, the table of contents isn't unique.
Feb ’22
Reply to SwiftUI: Applying a color scheme globally at runtime
I have something like this setup for instant changes, store the stylesheet as a state variable, and then when you want to change stylesheet, listen for a change. You can then use @Environment(\.stylesheet) var stylesheet and style your views as you see fit @main struct MyApp: App {   @State var stylesheet = StylesheetLoader.load(file: "MyStylesheet", in: Bundle.main) var body: some Scene {     WindowGroup {       NavigationView {         HomeView()           .environment(\.stylesheet, stylesheet) .onReceive(stylesheetPublisher, perform: { newStylesheet in stylesheet = newStylesheet }) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21