Skip to main content

Link to the blog post

ID
0059ab4
date
2024-05-17 06:40:17+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
8642ea3
message
Link to the blog post
changed files
1 file, 12 additions, 3 deletions

Changed files

README.md (1031) → README.md (1407)

diff --git a/README.md b/README.md
index 830637b..f97907e 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,19 @@
 # safari-webarchiver
 
-This tool creates [Safari webachive files](https://en.wikipedia.org/wiki/Webarchive) on the command line.
+This tool creates [Safari webarchive files](https://en.wikipedia.org/wiki/Webarchive) on the command line.
 This gives you an offline archive of web pages, which can be stored and backed up independently of any cloud services.
 
 ```console
-$ ./save_safari_webarchive.swift "https://example.com" "example.webarchive"
+$ save_safari_webarchive.swift "https://example.com" "example.webarchive"
 ```
 
+## How it works
+
+It opens the given URL in a `WKWebView`, calls `createWebArchiveData` to create a webarchive file, and saves it to disk.
+That's the core workflow, and then there's a bunch of error handling around that.
+
+For a more detailed explanation of this code, see <https://alexwlchan.net/2024/creating-a-safari-webarchive/>
+
 ## Installation
 
 1.  Install the Xcode Command Line Tools
@@ -20,9 +27,11 @@ Run the script passing two arguments: the URL you want to archive, and the path 
 For example, this command will save the URL to this GitHub repo to `safari-webarchiver.webarchive`:
 
 ```console
-$ ./save_safari_webarchive.swift "https://github.com/alexwlchan/safari-webarchiver" "safari-webarchiver.webarchive"
+$ save_safari_webarchive.swift "https://github.com/alexwlchan/safari-webarchiver" "safari-webarchiver.webarchive"
 ```
 
+It will refuse to overwrite a webarchvie that
+
 ## Acknowledgements
 
 This is partially inspired by [a similar script](https://github.com/newzealandpaul/webarchiver) written in 2008 by newzealandpaul.