Open vishalkrsinha opened 3 years ago
backend-pdf
is not defined in this converter, see: https://github.com/Mogztter/asciidoctor-web-pdf/issues/129
So both conditional blocks won't work:
ifdef::backend-pdf[]
:toc: macro
endif::[]
// ...
ifdef::backend-pdf[]
toc::[]
endif::[]
You can use env-web-pdf
or pass a custom attribute.
env-web-pdf
Sorry, but got confused with the suggestion(s) here. I modified my script a bit as below (just commented out the conditional parts):
:doctype: book
:PubDate: October 2020
:SystemType: Eductor
:KSDocType: Module Reference
= {SystemType}
// ifdef::env-github[]
:toc: macro
:toclevels: 3
// endif::[]
:sectnums:
:experimental:
:RevNumber: B
:icons: font
:linkattrs:
:webfonts!:
:data-uri:
:linkcss:
:iconfont-remote!:
:webfonts!:
<<<
*Document history*
[cols="12,15,73"]
|===
3+|{set:cellbgcolor:#ccc}
|{set:cellbgcolor:}Rev. A
|March 2013
|Created document and first XML version -- MHy
|Rev. B
|October 2020
|Design calculations -- MHy
|===
// ifdef::env-github[]
// toc::[]
// endif::[]
== Introduction
And I see the below output - No toc on the left side (in bookmarks) but see on the right side:
I need toc in Bookmark section too with numbering of contents exactly similar to 'asciidoctor-pdf' results. Suggestions please?
PS: I see html & pdf both files getting generated here instead of just the 'pdf'.
Oh I see, so the Table Of Contents is generated but missing from the PDF outline right?
Probably something we need to fix to be "on par" with asciidoctor-pdf
.
Oh I see, so the Table Of Contents is generated but missing from the PDF outline right?
Yes. But I believe toc would have been in bookmarks (left pane are) too along with in main document. I might be missing the trick. Do you have any simplest example please for the same?
Probably something we need to fix to be "on par" with
asciidoctor-pdf
.
Any update please?
Any update please?
This is an open source project, if you want to implement this feature, you will need to update the logic in here: https://github.com/Mogztter/asciidoctor-web-pdf/blob/main/lib/outline.js
Above script generates proper toc with 'asciidoctor-pdf' as below...![toc-asciidoctor-pdf](https://user-images.githubusercontent.com/42475844/126992563-cf0905d8-990e-4c49-9ffc-a507e8f37af6.PNG)
But the same script doesn't generate the toc at all with 'asciidoctor-web-pdf' as below...![toc-asciidoctor-web-pdf](https://user-images.githubusercontent.com/42475844/126992662-2c0e7264-e54b-4901-b3b5-9f405f6909f0.PNG)
Suggestions to correct this will be much appreciated. Thank you.