diff --git a/building-presenting-slide-decks-rst2pdf/README.rst b/building-presenting-slide-decks-rst2pdf/README.rst new file mode 100644 index 0000000..c7a72cb --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/README.rst @@ -0,0 +1,4 @@ +Building and presenting slide decks with rst2pdf +################################################ + +https://www.oliverdavies.uk/talks/building-presenting-slide-decks-rst2pdf diff --git a/building-presenting-slide-decks-rst2pdf/code/building.txt b/building-presenting-slide-decks-rst2pdf/code/building.txt new file mode 100644 index 0000000..b5d6d61 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/building.txt @@ -0,0 +1,12 @@ +rst2pdf slides.rst + + +rst2pdf slides.rst --break-level 1 --stylesheets main + + +rst2pdf slides.rst \ + --output slides.pdf \ + --stylesheets main \ + --break-level 1 \ + --fit-background-mode scale \ + --extension-module preprocess \ No newline at end of file diff --git a/building-presenting-slide-decks-rst2pdf/code/includes-code.txt b/building-presenting-slide-decks-rst2pdf/code/includes-code.txt new file mode 100644 index 0000000..3fe9f72 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/includes-code.txt @@ -0,0 +1,4 @@ +.. code-block:: javascript + :include: code/additional-config-options.txt + :hl_lines: 2 3 4 + :linenos: diff --git a/building-presenting-slide-decks-rst2pdf/code/includes-sections.txt b/building-presenting-slide-decks-rst2pdf/code/includes-sections.txt new file mode 100644 index 0000000..8ea82ab --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/includes-sections.txt @@ -0,0 +1 @@ +.. include:: sections/intro.rst diff --git a/building-presenting-slide-decks-rst2pdf/code/page-templates-rst.txt b/building-presenting-slide-decks-rst2pdf/code/page-templates-rst.txt new file mode 100644 index 0000000..16895b3 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/page-templates-rst.txt @@ -0,0 +1,3 @@ +.. raw:: pdf + + PageBreak standardPage diff --git a/building-presenting-slide-decks-rst2pdf/code/page-templates-style.txt b/building-presenting-slide-decks-rst2pdf/code/page-templates-style.txt new file mode 100644 index 0000000..75e2771 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/page-templates-style.txt @@ -0,0 +1,6 @@ +pageTemplates: + standardPage: + frames: [] + [3%, 3%, 92%, 92%] + showFooter: true + showHeader: false diff --git a/building-presenting-slide-decks-rst2pdf/code/styling.txt b/building-presenting-slide-decks-rst2pdf/code/styling.txt new file mode 100644 index 0000000..e9c77e2 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/styling.txt @@ -0,0 +1,29 @@ +linkColor: #24608a + +styles: + normal: + fontSize: 24 + leading: 32 + textColor: #383745 + + bodytext: + alignment: TA_LEFT + + heading: + fontSize: 20 + spaceAfter: 16 + textColor: #24608a + + title: + fontSize: 300% + parent: heading + textColor: white + + bullet-list: + commands: [] + [LEFTPADDING, [0, 0], [1, -1], 10] + [RIGHTPADDING, [0, 0], [1, -1], 0] + [VALIGN, [0, 0], [-1, -1], TOP] + colWidths: ["20", null] + textColor: #aaaaaa + diff --git a/building-presenting-slide-decks-rst2pdf/code/useful-rst-1.txt b/building-presenting-slide-decks-rst2pdf/code/useful-rst-1.txt new file mode 100644 index 0000000..e634b96 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/useful-rst-1.txt @@ -0,0 +1,14 @@ +Building and presenting slide decks with rst2pdf +################################################ + +.. class:: titleslideinfo + +Oliver Davies (@opdavies) + + +What is rst2pdf? +================ + +* "Use a text editor. Make a PDF." +* reStructuredText to PDF +* Each slide is a page diff --git a/building-presenting-slide-decks-rst2pdf/code/useful-rst-2.txt b/building-presenting-slide-decks-rst2pdf/code/useful-rst-2.txt new file mode 100644 index 0000000..f48ea1a --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/useful-rst-2.txt @@ -0,0 +1,14 @@ +.. image:: images/editing.png + :width: 20cm + + +.. code-block:: php + :startinline: true + :linenos: + + echo 'Hello world!'; + + +.. raw:: pdf + + TextAnnotation "This is a speaker note." diff --git a/building-presenting-slide-decks-rst2pdf/code/watching.txt b/building-presenting-slide-decks-rst2pdf/code/watching.txt new file mode 100644 index 0000000..555a827 --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/code/watching.txt @@ -0,0 +1,8 @@ +nodemon --ext rst,style,txt --exec " + rst2pdf slides.rst \ + --output slides.pdf \ + --stylesheets main \ + --break-level 1 \ + --fit-background-mode scale \ + --extension-module preprocess +" diff --git a/building-presenting-slide-decks-rst2pdf/images/editing.png b/building-presenting-slide-decks-rst2pdf/images/editing.png new file mode 100644 index 0000000..4921f56 Binary files /dev/null and b/building-presenting-slide-decks-rst2pdf/images/editing.png differ diff --git a/building-presenting-slide-decks-rst2pdf/images/pdfpc-1.png b/building-presenting-slide-decks-rst2pdf/images/pdfpc-1.png new file mode 100644 index 0000000..ef05896 Binary files /dev/null and b/building-presenting-slide-decks-rst2pdf/images/pdfpc-1.png differ diff --git a/building-presenting-slide-decks-rst2pdf/images/pdfpc-2.png b/building-presenting-slide-decks-rst2pdf/images/pdfpc-2.png new file mode 100644 index 0000000..3e37a29 Binary files /dev/null and b/building-presenting-slide-decks-rst2pdf/images/pdfpc-2.png differ diff --git a/building-presenting-slide-decks-rst2pdf/main.style b/building-presenting-slide-decks-rst2pdf/main.style new file mode 100644 index 0000000..aae8f6f --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/main.style @@ -0,0 +1,122 @@ +pageSetup: + firstTemplate: coverPage + height: 18cm + margin-bottom: 0cm + margin-gutter: 0cm + margin-left: 0cm + margin-right: 0cm + margin-top: 0cm + size: null + spacing-footer: 2mm + spacing-header: 2mm + width: 32cm + +pageTemplates: + coverPage: + # background: images/title.png + frames: [] + [12%, 10%, 76%, 75%] + showFooter: false + showHeader: false + + titlePage: + alignment: TA_CENTER + frames: [] + [8%, 8%, 85%, 65%] + showFooter: true + showHeader: false + + standardPage: + frames: [] + [3%, 3%, 92%, 92%] + showFooter: true + showHeader: false + + imagePage: + alignment: TA_CENTER + frames: [] + [12%, 10%, 76%, 80%] + showFooter: true + showHeader: false + + outputPage: + frames: [] + [8%, 10%, 82%, 65%] + showFooter: false + showHeader: false + +linkColor: #24608a + +styles: + normal: + fontSize: 24 + leading: 32 + textColor: #383745 + + bodytext: + alignment: TA_LEFT + + heading: + fontSize: 20 + spaceAfter: 16 + textColor: #24608a + + title: + fontSize: 300% + parent: heading + + bullet-list: + commands: [] + [LEFTPADDING, [0, 0], [1, -1], 10] + [RIGHTPADDING, [0, 0], [1, -1], 0] + [VALIGN, [0, 0], [-1, -1], TOP] + colWidths: ["20", null] + textColor: #aaaaaa + + bullet-list-item: + spaceBefore: 14 + spaceAfter: 0 + + titleslideinfo: + alignment: TA_CENTER + fontSize: 140% + parent: normal + + footer: + alignment: TA_RIGHT + fontName: stdMono + fontSize: 20 + textColor: #24608a + rightIndent: 16 + spaceBefore: 0 + + literal: + backColor: #eeeeee + fontName: stdMono + + code: + backColor: #eeeeee + borderWidth: 0 + fontSize: 20 + leading: 24 + parent: literal + spaceBefore: 4 + + blockquote: + parent: normal + fontName: stdItalic + leading: 36 + + attribution: + parent: normal + textColor: #66666 + + centered: + alignment: TA_CENTER + + centredtitle: + alignment: TA_CENTER + fontName: stdBold + fontSize: 48 + leading: 64 + parent: heading diff --git a/building-presenting-slide-decks-rst2pdf/slides.rst b/building-presenting-slide-decks-rst2pdf/slides.rst new file mode 100644 index 0000000..020e11a --- /dev/null +++ b/building-presenting-slide-decks-rst2pdf/slides.rst @@ -0,0 +1,167 @@ +.. footer:: @opdavies + +Building and presenting slide decks with rst2pdf +################################################ + +| + +.. class:: titleslideinfo + +Oliver Davies (@opdavies) + +.. raw:: pdf + + TextAnnotation "Gave my first talk in 2012." + TextAnnotation "A talk about a tool (rst2pdf) that I've been using for the last couple of talks." + +.. page:: standardPage + +What have I used before? +======================== + +* **UI based:** Keynote, Google Slides, slides.com +* **HTML/JavaScript:** reveal.js +* **Markdown:** Deckset, Marp, reveal-md + +What is rst2pdf? +================ + +* "Use a text editor. Make a PDF." +* reStructuredText to PDF +* Each slide is a page +* Page templates for layouts +* Not just for slide decks +* Table of contents, page numbers, headers, footers + +.. raw:: pdf + + TextAnnotation "Use the tools you're familiar with." + TextAnnotation "Similar to Markdown." + TextAnnotation "Primarily used for technical documentation within the Python community." + TextAnnotation "Now maintained by PHPers Rob Allen and Lorna Jane Mitchell." + TextAnnotation "Breaks at titles automatically, or you can add manual page breaks." + +Advantages +========== + +* Easy to start a new presentation, or update an existing one +* Version controllable +* Portable +* Content is searchable +* Easy to re-use content and/or styling +* Slides uploaded to SpeakerDeck straight away + +.. page:: imagePage + +.. image:: images/editing.png + :width: 23cm + +.. page:: standardPage + +Useful reStructuredText +======================= + +.. code-block:: rst + :include: code/useful-rst-1.txt + :linenos: + +Useful reStructuredText +======================= + +.. code-block:: rst + :include: code/useful-rst-2.txt + :linenos: + +Page Templates +============== + +main.style: + +.. code-block:: yaml + :include: code/page-templates-style.txt + +slides.rst: + +.. code-block:: rst + :include: code/page-templates-rst.txt + +Keeping things organised +======================== + +Split slides into different sections: + +.. code-block:: rst + :include: code/includes-sections.txt + +| + +Including code snippets from separate files: + +.. code-block:: rst + :include: code/includes-code.txt + +.. raw:: pdf + + TextAnnotation "Includes!" + +Styling +======= + +.. code-block:: yaml + :include: code/styling.txt + :linenos: + +Building +======== + +.. code-block:: + :include: code/building.txt + +Watching +======== + +Re-compiling when something changes. + +| + +.. code-block:: bash + :include: code/watching.txt + +Presenting +========== + +``pdfpc`` - PDF presenter console + +| + +.. code-block:: + + pdfpc slides.pdf + +.. page:: imagePage + +.. image:: images/pdfpc-1.png + :width: 23cm + +.. page:: + +.. image:: images/pdfpc-2.png + :width: 23cm + +.. page:: standardPage + +Thanks! +======= + +References: + +* https://rst2pdf.org +* https://github.com/rst2pdf/rst2pdf +* https://github.com/opdavies/talks +* https://oliverdavies.link/lorna-rst2pdf-talk + +| + +Me: + +* https://www.oliverdavies.uk