sethyuan / logseq-plugin-doc

Show page in a more document like look and provide quick exporting.
MIT License
91 stars 4 forks source link

Images exported with invalid paths #10

Closed kaolpr closed 2 years ago

kaolpr commented 2 years ago

When exporting HTML, if page contains images, the exported paths reference original image locations. I would expect to images be either embed into HTML document or exported to some assets directory for easy sharing.

sethyuan commented 2 years ago

This is a known limitation, I'm not sure I can achieve this with the current plugin architecture. Let me do more research. Meanwhile, I suggest you use Chrome to print the page into PDF for sharing.

sethyuan commented 2 years ago

I did some research on this.

First of all, embedding images is not a viable option because there are also css files, font files, even JS files that are required for proper page rendering. And not all of them can be embedded.

I also did research on the File System Access API, but it can't be used in Logseq since Logseq doesn't run on a HTTPS server and no write permission can be obtained.

The only hope left is the plugin SDK, if it can provide local file system access then I can use that to export the dependent resources out. I don't think they have this feature planned, therefore, there's nothing I can do for now.