Closed acsr closed 2 years ago
I think I need to modify the source code of both projects to achieve this. I'll come back to you when I have progress.
I published new versions of logseq-plugin-tocgen and logseq-plugin-doc, can you give it a try? They should be handled well now.
@sethyuan Great work, thank you, what a fast response. First of all: works mostly as expected and needed. I added more feedback below.
Suggestion: Please make the hint to the lazy load challenge more prominent in the docs (Put sticky to front!) I removed a remark on this here after finally finding it already there. (in a former unedited version of this comment)
Links including TOC Anchor jumps are preserved when printing the PDF from Safari, but not from Chrome. Firefox et al not testet.
Occurs in both Chrome and Safari.
Reason: The div with the TOC seems to be preserved a one block on the PDF page because it did not fit the firstpage because of the header. A short unfolded TOC remains on page 1. TOCS exceeding one page or scaling the page not tested yet. Needs more testing ...
Unfolding the TOC before export helps to get the full TOC into the HTML unfolded (Good for PDF!).
Extending the markup of the Anchor Headlines. Having the Link to the Headline (Anchor Link with Chain Icon) visible on Hover after the Headline (convenient if the page is integrated elsewhere for reference. Experienced users can fetch the info from source or the TOC)
A few observations from my end:
- "Links in PDF" when I printed from Chrome were preserved, I'm on macOS and I opened the printed PDF using the Preview app. For links that open Logseq, I needed to right click on the link in PDF.
Links in PDF from Chrome were only preserved for me for "fully visible https://... links" , Logseq links not at all from Chrome. Same in Acrobat Reader.
I used Chrome Version 103.0.5060.114 (Official Build) (x86_64) on MacOS Mojave. PDF generated either by:
But this maybe an issue of the old OS/Version, since the PDF printing is handled from the OS Driver. We have everything here from HighSierra, Mojave, Catalina, BigSur, Monterey. But Logeq not on all machines.
Maybe you can share the exact setup/procedure for Chrome you used.
I need to come back on the other stuff later.
I released a new version with the following modifications:
I didn't implement a back to top button at the end of the page because I don't think it's standard for a document. An alternative for it might be to just use a back to TOC arrow.
logseq-wrap
works great!).
Found the issue, it's due to how I implemented the back arrow, I just fixed it. You can try the new version.
I can confirm, that the Line Feed rendering issue with he properties etc. is gone.
Remaining issues, maybe new Ticket or related. Chose as needed and create a new one.
I just made a test, TOC links with deep levels do behave well.
Could the link problem you mentioned somehow related to the lazy loading behavior of Logseq?
Regarding the 2nd issue, it seems to be a Logseq's bug, you can observe it without using the plugin. Doc View Exporter works by replicating Logseq's view, so this issue should be gone when it's fixed by Logseq.
Regarding the 2nd issue, it seems to be a Logseq's bug, you can observe it without using the plugin. Doc View Exporter works by replicating Logseq's view, so this issue should be gone when it's fixed by Logseq.
I found a Logseq setting that controls this behavior:
;; Enable all your properties to have corresponding pages
:property-pages/enabled? true
Youre so cool and responsive. Need to try that out in detail later next week. I think if I can 4 eyes confirm these findings by you, it should be reflected in the docs and we can close this ticket then. cu
I tried also if my suggestion from the initial issue post to make the Table of Contents from your other plugin https://github.com/sethyuan/logseq-plugin-tocgen work to jump to anchors in the same HTML. see Note on TOCs: https://github.com/sethyuan/logseq-plugin-doc/issues/20
It would be good to know if fixing the TOC challenge would be be fine here in the DOC plugin or better solved in the https://github.com/sethyuan/logseq-plugin-tocgen.
When solved there the Target Anchors could be opened in the same HTML only if anchors are included in the html. Otherwise the links can just point to the block itself in Logseq and opens in the app as well.
Feel free to ask if something is unclear.