Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building and presenting slide decks with rst2pdf

Building and presenting slide decks with rst2pdf

I've recently used rst2pdf for building presentation slides. This short talk will show some examples of how I built and presented a slide deck using reStructuredText and rst2pdf.

https://www.oliverdavies.uk/talks/building-presenting-slide-decks-rst2pdf

71c9ebde850996d2533c5df4df2c93c6?s=128

Oliver Davies

January 28, 2021
Tweet

Transcript

  1. Building and presenting slide decks with rst2pdf Oliver Davies (@opdavies)

  2. What have I used before? • UI based: Keynote, Google

    Slides, slides.com • HTML/JavaScript: reveal.js • Markdown: Deckset, Marp, reveal-md @opdavies
  3. 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 @opdavies
  4. 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 @opdavies
  5. @opdavies

  6. Useful reStructuredText 1 Building and presenting slide decks with rst2pdf

    2 ################################################ 3 4 .. class:: titleslideinfo 5 6 Oliver Davies (@opdavies) 7 8 9 What is rst2pdf? 10 ================ 11 12 * "Use a text editor. Make a PDF." 13 * reStructuredText to PDF 14 * Each slide is a page @opdavies
  7. Useful reStructuredText 1 .. image:: images/editing.png 2 :width: 20cm 3

    4 5 .. code-block:: php 6 :startinline: true 7 :linenos: 8 9 echo 'Hello world!'; 10 11 12 .. raw:: pdf 13 14 TextAnnotation "This is a speaker note." @opdavies
  8. Page Templates main.style: pageTemplates: standardPage: frames: [] [3%, 3%, 92%,

    92%] showFooter: true showHeader: false slides.rst: .. raw:: pdf PageBreak standardPage @opdavies
  9. Keeping things organised Split slides into different sections: .. include::

    sections/intro.rst Including code snippets from separate files: .. code-block:: javascript :include: code/additional-config-options.txt :hl_lines: 2 3 4 :linenos: @opdavies
  10. Styling 1 linkColor: #24608a 2 3 styles: 4 normal: 5

    fontSize: 24 6 leading: 32 7 textColor: #383745 8 9 bodytext: 10 alignment: TA_LEFT 11 12 heading: 13 fontSize: 20 14 spaceAfter: 16 @opdavies
  11. 15 textColor: #24608a 16 17 title: 18 fontSize: 300% 19

    parent: heading 20 textColor: white 21 22 bullet-list: 23 commands: [] 24 [LEFTPADDING, [0, 0], [1, -1], 10] 25 [RIGHTPADDING, [0, 0], [1, -1], 0] 26 [VALIGN, [0, 0], [-1, -1], TOP] 27 colWidths: ["20", null] 28 textColor: #aaaaaa @opdavies
  12. Building 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 @opdavies
  13. Watching Re-compiling when something changes. nodemon --ext rst,style,txt --exec "

    rst2pdf slides.rst \ --output slides.pdf \ --stylesheets main \ --break-level 1 \ --fit-background-mode scale \ --extension-module preprocess " @opdavies
  14. Presenting pdfpc - PDF presenter console pdfpc slides.pdf @opdavies

  15. @opdavies

  16. @opdavies

  17. 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 @opdavies