Conversation
|
Thank you for the contribution! This is useful. In the PDF I built from this PR, tutorials start from page 443. In the table of contents, I don't see anything about the tutorials. Or should I look specifically somewhere? Also, the Quickstart tutorial (only), appears to have larger font. I guess this is because it does not yet have a sidebar (intentionally, but maybe we can rethink that decision), but then this is a separate issue. As a side effect of including the tutorials (which have many pictures), the resulting PDF is 17MB (compared to the previous 3-4MB). If you see any easy way to reduce the size, that would be great! In any case, I would appreciate it if you could post screenshots of any updates, or share the PDF itself, as it is currently a bit cumbersome for me to build locally. |
|
I will add tutorial_sidebar loop to tocpage.html (pg 443+) To solve the size issue caused by tutorial pictures, I was confused a bit to either use an argument or to implement some variable technique. docs: I believe we should explicitly list these optimization techniques in docs-meta-publish-to-pdf.md as this will serve as a guide for future work to ensure that the PDF remains lightweight. |
|
@the-matrixneo hey! solid PR! PS. minor suggestion regarding commit history. I think its better to use |
- Updated prince-list.txt and tocpage.html to include tutorials - Integrated --raster-images-res 150 flag in pdf-docs.sh to reduce size - Documented optimizations in docs-meta-publish-to-pdf.md
07ca382 to
efe296d
Compare
the-matrixneo
left a comment
There was a problem hiding this comment.
I have updated the PR :
-
Table of Contents: Fixed the recursive loop in tocpage.html to correctly index tutorials.
-
PDF Optimization: Added the --raster-images-res 150 flag to pdf-docs.sh to downsample images.
-
Documentation: Updated docs-meta-publish-to-pdf.md to reflect the new build command and sidebar logic.

@MakisH please have a look!!
MakisH
left a comment
There was a problem hiding this comment.
This is making progress and shaping up nicely! Some more comments to consider.
|
|
||
| ```bash | ||
| prince --javascript --input-list=_site/pdfconfigs/prince-list.txt -o pdf/docs.pdf | ||
| prince --javascript --raster-images-res 150 --input-list=_site/pdfconfigs/prince-list.txt -o pdf/docs.pdf |
There was a problem hiding this comment.
Which Prince version are you using? I got 16.2, and it only has:
--raster-output=TEMPLATE Enable raster output.
--raster-format=FORMAT Set raster output format. [auto|png|jpeg]
--raster-jpeg-quality=NUM Set quality for raster JPEG output.
--raster-pages=PAGE Set range of pages to rasterise. [all|first|NUM]
--raster-dpi=DPI Set resolution of raster output.
--raster-background=COLOR Set background color. [white|transparent]
--raster-threads=NUM Set number of threads for raster output.
| pdf_sidebar: docs_sidebar | ||
| pdf_sidebars: | ||
| - docs_sidebar | ||
| - tutorial_sidebar |
There was a problem hiding this comment.
This part needs some polishing, the example does not make much sense right now.
pdfconfigs/config_docs_pdf.yml
Outdated
| pdf_sidebar: docs_sidebar | ||
| pdf_sidebars: | ||
| - docs_sidebar | ||
| - tutorial_sidebar |
| {% endfor %} | ||
| {% endfor %} | ||
|
|
||
| {% for entry in tutorial_sidebar %} |
There was a problem hiding this comment.
Before the Docs and before the Tutorials, some part separator is needed. Right now, all sections are rendered the one after the other, as if Docs and Tutorials are in the same part.
the-matrixneo
left a comment
There was a problem hiding this comment.
I have made the necessary changes told by you @MakisH . Please have a look!
I have tested the implementation locally by ensuring the generated prince-list.txt correctly populates with URIs for both documentation and tutorials. The logic supports the full nested structure of the tutorial sidebar.
Please review the merge request
Issue no: #468