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

When requesting an export, you can export the directory functionality together #18

Open
lion-no-back opened this issue May 29, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@lion-no-back
Copy link

I really like this plug-in you developed. It has been about two months since I started using it. It has brought me a lot of convenience. I just don’t know if it is possible to add the generated directory when exporting function is used

@sethyuan
Copy link
Owner

Plugins don't have that much permissions.

If what you want is to share the exported page, I'd recommend you to use Google Chrome to open the exported HTML and print it into a PDF file, for sharing. Just remember to check Background graphics. In this way, you'll practically have 100% accurate PDF conversion.

image

@lion-no-back
Copy link
Author

Well, thank you for your suggestion. Sometimes the article is a bit long and the title is more, so I want to generate a directory, export it as an html file, and then I can do it offline, so that the gif image can be saved well, but the pdf does not have this. Thank you for your suggestion

@sethyuan
Copy link
Owner

Understood. It is certainly better to have a copy of all used resources when exporting. I'll keep this issue open and will make more researches on this topic.

@sethyuan sethyuan self-assigned this May 30, 2022
@sethyuan sethyuan added the enhancement New feature or request label May 30, 2022
@acsr
Copy link

acsr commented Sep 23, 2022

Today I did some export with the new [[Logseq]] v0.8.7 und [[logseq-plugin-doc]] v1.11.1

Images are linked as absolute path to the PKM dir

I found out that after including Images AND moving the export around, the Images are linked statically to the Logseq PKM directory like [absolutepath]/assets/file.png
(this is the main gotcha of this ticket).

I never recognized this due to the fact that I always converted the export to PDF in place of the original save location at once.

But now I needed to share the full export as working HTML with others.

What I did:

  • In Chrome save the page as Website Full
  • This created a folder with all the images and the style.css, tabler-icons.min.css and photoswipe.js files

Icons missing

When you open the new HTML everything looks fine except:

Tabler Icons are gone, because Web Fonts are linked via relative link from CSS expected to be in the Logseq Plugin Directory relative to the original CSS.

Solution: Copy over the font files from ~/logseq/Export Hugo Docs/static/css/fonts/tabler-icons.* (on Mac!)

In Chrome Collected saves, TOC Links are absolute and refuse to work after moving the export.

Sideeffect of the Chrome Step: Links of a TOC from https://github.com/sethyuan/logseq-plugin-tocgen to the anchors are now absolute corresponding to the location during export from Chrome. I missed to check that before. The actual export is relative!

Solution: Search and Replace TOC Links to Anchors in the Chrome export html and remove the path before the character# starting the anchor link part.

New Image UI features in Logseq

There is a new challenge with Logseq 0.8.7 and the enhanced icon overlays over images.

The full (original) path and Delete and Copy Links are displayed together with the Show Full Size icons and their tooltips but without useful action.

You can now try to port back the HTML functionality to the export or try to hide the items in CSS. Both is useless for PDF as final target format.

Depending on the usecase the original path and exporting from there is useful or showing just the filename and offering a copy from the export.

The show fullsize icon functionality ist always important if you use images that are scaled down in the doc view but need to be explored in fullsize. This is still possible by opening with rightclick into a new tab, but cumbersome and not acceptable for others.

Conclusion

Except the manual postproduction work, I am now quite happy with the look and TOC functionality of the HTML. The actual export code is very clumsy and contains a lot of boilerplate, but this is not the fault of the plugin.

@acsr
Copy link

acsr commented Sep 23, 2022

One more thought: Is it possible to include all resources as Base64 encoded data urls in a single big HTML file from Logseq?
Sometimes a big monolith and not suitable, but also simple solution to avoid a directory if possible and acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants