diff --git a/content/docs/docs-meta/docs-meta-publish-to-pdf.md b/content/docs/docs-meta/docs-meta-publish-to-pdf.md index 037636c88fe..7d4334439f8 100644 --- a/content/docs/docs-meta/docs-meta-publish-to-pdf.md +++ b/content/docs/docs-meta/docs-meta-publish-to-pdf.md @@ -17,7 +17,7 @@ On a Windows environment it makes sense to add the location of the Prince execut The bash script 'pdf-docs.sh' in root can be used to build the PDF. It goes through the following steps -### Build a web target with jekll +### Build a web target with jekyll First, let's kill all running instances of jekyll: @@ -73,7 +73,7 @@ http://localhost:4000/docs.html This list is consumed by Prince and converted into PDF: ```bash -prince --javascript --input-list=_site/pdfconfigs/prince-list.txt -o pdf/docs.pdf +prince --javascript --raster-dpi=150 --input-list=_site/pdfconfigs/prince-list.txt -o pdf/docs.pdf ``` The final PDF can be found in `pdf/docs.pdf` as specified. The `--javascript` option enables JavaScript support. @@ -106,10 +106,14 @@ For further reference consult the [documentation of documentation-theme-jekyll]( ## Contents, title page and table of contents -The PDF will contain every page of type `pdf` that is referenced in the sidebar `pdf_sidebar` in `pdfconfigs/config_docs_pdf.yml`. E.g. if +The PDF will contain every page of type `pdf` that is referenced in the sidebars configured in `pdfconfigs/config_docs_pdf.yml`. +You can configure a single sidebar via `pdf_sidebar` or multiple sidebars via `pdf_sidebars`. E.g. if ```yml -pdf_sidebar: docs_sidebar + +pdf_sidebars: + - docs_sidebar + - tutorial_sidebar ``` and `docs_sidebar.yml` is @@ -130,6 +134,8 @@ and `docs_sidebar.yml` is the PDF will contain `apples.html` but not `oranges.html`. +For `tutorial_sidebar`, all entries with output `web` are also included in the PDF build. + Furthermore two more pages have to be included in `docs_sidebar.yml`: ```yml diff --git a/pdf-docs.sh b/pdf-docs.sh index b534b5ec43b..a17c8bb5ae5 100644 --- a/pdf-docs.sh +++ b/pdf-docs.sh @@ -10,8 +10,7 @@ bundle exec jekyll serve --detach --config _config.yml,pdfconfigs/config_docs_pd echo "done"; echo "Building the PDF ..."; -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; echo "Done. Look in the pdf directory to see if it printed successfully." # bundle exec jekyll serve --config "_config.yml,pdfconfigs/config_docs_pdf.yml" diff --git a/pdfconfigs/config_docs_pdf.yml b/pdfconfigs/config_docs_pdf.yml index 333a229d08d..ed2c9207802 100644 --- a/pdfconfigs/config_docs_pdf.yml +++ b/pdfconfigs/config_docs_pdf.yml @@ -16,4 +16,7 @@ defaults: comments: true search: true -pdf_sidebar: docs_sidebar + +pdf_sidebars: + - docs_sidebar + - tutorial_sidebar diff --git a/pdfconfigs/docs_part_title.html b/pdfconfigs/docs_part_title.html new file mode 100644 index 00000000000..29f9cb41e13 --- /dev/null +++ b/pdfconfigs/docs_part_title.html @@ -0,0 +1,8 @@ +--- +layout: page_print +permalink: docs_part_title.html +search: exclude +--- +
+

Part I: Documentation

+
\ No newline at end of file diff --git a/pdfconfigs/prince-list.txt b/pdfconfigs/prince-list.txt index d8f3fd13608..9c773860f86 100644 --- a/pdfconfigs/prince-list.txt +++ b/pdfconfigs/prince-list.txt @@ -3,28 +3,53 @@ layout: none search: exclude --- - {% assign sidebar = site.data.sidebars[site.pdf_sidebar].entries %} + {% assign docs_sidebar = site.data.sidebars.docs_sidebar.entries %} + {% assign tutorial_sidebar = site.data.sidebars.tutorial_sidebar.entries %} - {% for entry in sidebar %} +{{site.url}}{{site.baseurl}}/docs_part_title.html - {% for folder in entry.folders %} - {% if folder.output contains "pdf" %} - {% for folderitem in folder.folderitems %} - {% if folderitem.output contains "pdf" %} - {{site.url}}{{site.baseurl}}{{folderitem.url}} - {% for subfolders in folderitem.subfolders %} - {% if subfolders.output contains "pdf" %} - {% for subfolderitem in subfolders.subfolderitems %} - {% if subfolderitem.output contains "pdf" %} - {{site.url}}{{site.baseurl}}{{subfolderitem.url}} + {% for entry in docs_sidebar %} + {% for folder in entry.folders %} + {% if folder.output contains "pdf" %} + {% for folderitem in folder.folderitems %} + {% if folderitem.output contains "pdf" %} + {{site.url}}{{site.baseurl}}{{folderitem.url}} + {% for subfolders in folderitem.subfolders %} + {% if subfolders.output contains "pdf" %} + {% for subfolderitem in subfolders.subfolderitems %} + {% if subfolderitem.output contains "pdf" %} + {{site.url}}{{site.baseurl}}{{subfolderitem.url}} + {% endif %} + {% endfor %} {% endif %} - {% endfor %} - {% endif %} - {% endfor %} - {% endif %} - {% endfor %} - {% endif %} - {% endfor %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endfor %} + +{{site.url}}{{site.baseurl}}/tutorials_part_title.html + + {% for entry in tutorial_sidebar %} + {% for folder in entry.folders %} + {% if folder.output contains "web" %} + {% for folderitem in folder.folderitems %} + {% if folderitem.output contains "web" %} + {{site.url}}{{site.baseurl}}{{folderitem.url}} + {% for subfolders in folderitem.subfolders %} + {% if subfolders.output contains "web" %} + {% for subfolderitem in subfolders.subfolderitems %} + {% if subfolderitem.output contains "web" %} + {{site.url}}{{site.baseurl}}{{subfolderitem.url}} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} + {% endif %} + {% endfor %} {% endfor %} @@ -77,4 +102,4 @@ search: exclude {% endif %} {% endfor %} {% endfor %} -{% endcomment %} +{% endcomment %} \ No newline at end of file diff --git a/pdfconfigs/tocpage.html b/pdfconfigs/tocpage.html index 61181965026..ca0216e8307 100644 --- a/pdfconfigs/tocpage.html +++ b/pdfconfigs/tocpage.html @@ -4,41 +4,76 @@ permalink: tocpage.html --- - + + \ No newline at end of file diff --git a/pdfconfigs/tutorials_part_title.html b/pdfconfigs/tutorials_part_title.html new file mode 100644 index 00000000000..0b015ac790c --- /dev/null +++ b/pdfconfigs/tutorials_part_title.html @@ -0,0 +1,8 @@ +--- +layout: page_print +permalink: tutorials_part_title.html +search: exclude +--- +
+

Part II: Tutorials

+
\ No newline at end of file