-
Notifications
You must be signed in to change notification settings - Fork 272
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
TOC generation improvement #323
Comments
@jvdvegt, thank you for the PDF css, I will incorporate it into the extension and add an option to override the default CSS.
The reason Pegdown profile turns off header id generation is because pegdown uses ANCHORLINKS extension to create an anchor link with the header id. When you turn off this extension there is no place for the header id anchor.
It is not set to The only workable improvement that I can see is to add logic to the pegdown emulation profile to check which pegdown extensions are enabled and change the some settings based on it. I will do it for next release. Is there a reason, other than convenience and inertia to use PegdownOptions adapter instead of providing your settings using I ask because I still use a heavily modified PegdownOptionsAdapter in my plugin because of reluctance to rework all code using it. It is on my to do list for things to get rid off. |
@jvdvegt, added separate issues for two raised here. |
Fix for this is available. Repo updated, maven updated but may take a while to show up in maven central. |
Updated Sample: PdfConverter.java. Updated wiki: DetailsUse class The following options are available: Defined in
ℹ️ Default CSS is only added if ℹ️ If you are using the |
The TOC extention could use some improvements:
First: If I create options this way:
PegdownOptionsAdapter .flexmarkOptions(Extensions.ALL & ~(Extensions.ANCHORLINKS | Extensions.EXTANCHORLINKS_WRAP), TocExtension.create()) .toMutable();
Then in ParserEmulationProfile.java:403, HtmlRenderer.RENDER_HEADER_ID is set to false. Then on TocExtention.java:68 it is not forced to false, leading to non-working links in the TOC.
I need to set the RENDER_HEADER_ID to true manually. I see I should/could use the Multimarkdown profile, but how to use that?
Additionally, the generated PDF looks much better with some CSS like this (after adding
OPTIONS.set(TocExtension.LIST_CLASS, "toc")
). Please feel free to add this somewhere to the extension:The text was updated successfully, but these errors were encountered: