Closed syamajala closed 1 month ago
Not sure if we should embed the html file directly in archive_data.rs as a string, but here is a patch:
diff --git a/src/archive_data.rs b/src/archive_data.rs
index da61fd7..a97d839 100644
--- a/src/archive_data.rs
+++ b/src/archive_data.rs
@@ -254,6 +254,19 @@ impl<T: DeferredDataSource> DataSourceArchiveWriter<T> {
}
});
+ std::fs::write(self.path.join("index.html"),
+ "<html>
+<script>
+window.onload = function() {
+ var prof = location
+ if(location.protocol !== 'https:') {
+ prof = location.replace(`https:${location.href.substring(location.protocol.length)}`);
+ }
+ window.location.replace(\"https://legion.stanford.edu/prof-viewer/?url=\"+prof.href);
+}
+</script>
+</html>")?;
+
Ok(())
}
}
I'm happy to take this as a PR. The file seems sort enough that for now I'm ok with just embedding the string like that.
legion_prof archive
should create an index.html with this in it:Then we can just load an archive when navigating to the directory on sapling. See this as an example: http://sapling2.stanford.edu/~seshu/legion_prof/