gildas-lormeau/SingleFile

Re-save a folder as a self-extracting zip html file

Opened this issue · 5 comments

Is your feature request related to a problem? Please describe.

I save a page in the universal self-extracting zip file. Then I realized I forgot to ignore fonts, so I'd like to remove them instead of getting back to the page and resaving it

Describe the solution you'd like

  • Change extension to zip
  • Unzip
  • Delete fonts
  • Ask SingleFile to pack the folder into a self-exracting zip html page

Describe alternatives you've considered (optional)
You can reopen the unzipped page and save it again, but then you might forget what profile was used and inadvertently change something you didn't want changed

Additional context (optional)
N/a

This is possible by opening the index.html file in the browser after extracting the zip file and save the page again with SingleFile. If you use Chrome, you need to enable "Allow access to file URLs" in the extension page, i.e. chrome://extensions/?id=mpiodijhokgodhhofbcjdecpffjipkle. Otherwise I would recommend to run a HTTP server and open the index.html through it (e.g. http://localhost:8080/saved-page/index.html).

Alternatively, you can use SingleFile CLI to re-save the page, see https://github.com/gildas-lormeau/single-file-cli.

That's the workaround I mentioned and use, but you lose profile (maybe you originally saved a zip which includes searchable text, but then on resaving used a different profile)

And even when using the same profile the saved file is slightly different, has a different number of files (besides those you delete, of course). Though maybe the 2nd part doesn't matter, it's just some js chunking and such that's performed differently

Is there maybe a way to "split" the saved file into pure zip and SingleFile's metadata so you could edit the zip as you like and later combine it with the metadata into your cool universal format?

Right now, I agree that today manipulating a self-extracting file is very complicated, if not impossible (for universal files) with existing tools. It's technically possible to implement such a tool, but it requires a bit of work.

Possibly related. I saved a lot of pages as Self Extracting Zip, and then I figured out that HTML Reader for Obsidian didn't really handle that well. So maybe a convert/edit function?

@johanssontobbe This should be possible with SingleFile CLI, see https://github.com/gildas-lormeau/single-file-cli. You can pass a list of paths to save with the option --urls-file. You should be able to save them without using an HTTP server.