Comments (12)
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.
from logseq-plugin-doc.
I published new versions of logseq-plugin-tocgen and logseq-plugin-doc, can you give it a try? They should be handled well now.
from logseq-plugin-doc.
@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)
Howto preserve Links and TOC jumps in PDF (can become part of the docs)
Links including TOC Anchor jumps are preserved when printing the PDF from Safari, but not from Chrome. Firefox et al not testet.
Virtual Page break in PDF Export after Title and Properties and before a long unfolded TOC
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 ...
Remaining challenges.
-
Unfolding the TOC before export helps to get the full TOC into the HTML unfolded (Good for PDF!).
- Nice to have: Export the full TOC but fold like visible state and allow to unfold in HTML (not needed 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 Back to TOC Link on the headline itself in the content or at the end of the line (Up Arrow icon)
- A Back to top Link at the end.
from logseq-plugin-doc.
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.
- "Page break with long TOC" can be observed, it's caused by how Logseq's DOM is structured. I can try to work around it.
- It's not possible to achieve interactive TOC in the exported HTML currently, this is due to low level implementations.
- "Extending the markup of the Anchor Headlines", I don't quite get it, can you maybe do some screenshots?
from logseq-plugin-doc.
- "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.
- TOC Links and all kind of links from Logseg Pages, Tags working n HTML are not working in PDF
I used Chrome Version 103.0.5060.114 (Official Build) (x86_64) on MacOS Mojave.
PDF generated either by:
- "Open in Preview" Button in Chrome (Text may vary in english)
- "PDF" menu -> "Open in Preview" in Chrome Print Dialog
- System Printer Dialog from Chrome Printer Dialog and "Save as PDF" from "PDF" menu
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.
from logseq-plugin-doc.
I released a new version with the following modifications:
- A workaround for the page break for long TOC problem.
- A back to TOC arrow for each title that has a TOC entry.
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.
from logseq-plugin-doc.
- Back to top works great and opening the TOC at the slot is great when the TOC is long.
- Page break before long TOCs is now gone, but may introduce new issues by missing newlines in the HTML at other locations in content when just newlines are present (e.g. properties blocks, source code blocks etc.) .
- You can discover these flaws already in the HTML.
- I have no fast setup to compare that with the old version that much, but I saved the old test exports and they have no issue.
- See attached Screenshots with properties example
- Maybe you can fix this with a more restrictive CSS selector for your new markup.
- To do future testing it could help to create a test.md file containing all the common different markup cases (including your own plugins special markup, e.g. your
logseq-wrap
works great!).- For a different project, I suggested to add a sample markup snippet to the package that can be concatenated to a global test document. I know that this cannot cover all permutations of the result. Alternatively it can be published on github only, but I think it does not bloat the package that much. This is more relevant for Logseq itself but helpful for your plugin in particular.
from logseq-plugin-doc.
Found the issue, it's due to how I implemented the back arrow, I just fixed it. You can try the new version.
from logseq-plugin-doc.
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.
- TOC links level 6+ in HTML pointing to blocks in loseq not anchors
But I discovered now that I missed to find an issue with the TOC links pointing to the Anchors are not working in HTML (and PDF) below level 5 of the TOC either expanded by hand in Logseq or setting the default in the plugin prefs, (Option to set it explicit in the content seems missing).- The Links in HTML below Level 5 still point to the Logseq Block ID
- This was already present in former versions, but not recognized by me
- Properties Fieldnames in HTML are (now?) linking to a fictive Logseq page with the name of the property, showing nothing else when property name is not already given to a page or tag.
- This was already present in former versions, but not recognized by me, because the Links were not visible as Links. I discovered this by accident while the CSS was not fully loaded and the properties appeared as links for a glimpse.
- Could have been recognized when looking into the HTML source, but was blind from the initial working random samples I tried.
from logseq-plugin-doc.
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.
from logseq-plugin-doc.
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
from logseq-plugin-doc.
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
from logseq-plugin-doc.
Related Issues (20)
- When requesting an export, you can export the directory functionality together HOT 5
- Did this plugin change it's behavior? HOT 1
- [featur request] Enhance Block IDs in HTML to full fledged Logseq links (optional) HOT 3
- 【功能请求】 HOT 10
- Add a document style #.ul-nested to allow for deep nested unordered lists without markup going wild HOT 3
- export is not working HOT 4
- Disable intra-graph links HOT 6
- 导出时,主题样式为logseq默认样式而非选择样式 HOT 3
- 复杂主题导出时只能导出前半段内容 HOT 3
- 不兼容 logseq 0.8.9 HOT 6
- can support close doc view export ? HOT 1
- 能否保留列表竖线 HOT 2
- "导出成图片" 如何使用? HOT 2
- 你好,试了下不能识别 tab。 HOT 2
- 0.9.4版本,导出的html无法滚动,但缩小显示比例能看到下面还有内容 HOT 7
- 导出的主题样式与logseq选择样式不一致 HOT 1
- about exporting HOT 4
- Any chance for an option to keep bullets in doc view? HOT 2
- DOC视图中,在logseq中折叠块不能显示出来 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logseq-plugin-doc.