Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eugenesvk opened this issue Jun 5, 2024 · 5 comments
Open

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

eugenesvk opened this issue Jun 5, 2024 · 5 comments

Comments

@eugenesvk
Copy link

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

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jun 10, 2024

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.

@eugenesvk
Copy link
Author

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?

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jun 10, 2024

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.

@johanssontobbe
Copy link

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?

@gildas-lormeau
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants