Slide 1

Slide 1 text

Create PDFs from Markup with rst2pdf Lorna Mitchell

Slide 2

Slide 2 text

Meet rst2pdf • http://rst2pdf.github.io • Open source, Python project • Accepts ReStructured Text format, outputs PDF • Useful for: reports, slide decks, ... all sorts @lornajane

Slide 3

Slide 3 text

PDF: Portable Document Format @lornajane

Slide 4

Slide 4 text

PDF: Portable Document Format PDF is my preferred file format for things that: • should be well presented • need not be edited It is an open format, fonts can be embedded, and there are loads of tools that work with it. @lornajane

Slide 5

Slide 5 text

ReStructured Text @lornajane

Slide 6

Slide 6 text

ReStructured Text A text-based markup format (like markdown, but better). Use your favourite text editor! Use source control (such as git) @lornajane

Slide 7

Slide 7 text

A note on source control Source control is for people who: • don't like losing work • sometimes make mistakes • might want to collaborate with others some day @lornajane

Slide 8

Slide 8 text

ReStructured Text Examples Meet ``rst2pdf`` ============== * http://rst2pdf.github.io * Open source, Python project * Accepts ReStructured Text format, outputs PDF * Useful for: reports, slide decks, ... all sorts .. raw:: pdf PageBreak titlePage @lornajane

Slide 9

Slide 9 text

rst2pdf @lornajane

Slide 10

Slide 10 text

Create a PDF Use rst2pdf like this: rst2pdf awesomeness.rst You can supply styles, layouts, output file name but ... this is basically it @lornajane

Slide 11

Slide 11 text

Separate Content and Style I love this approach! • Style is always consistent throughout document. • Styles can be re-used between documents. • Content can be re-used between documents. • Documents can VERY easily be re-styled (is my contrast OK?). • You can grep for content. Extra bonus: tool itself is also separate @lornajane

Slide 12

Slide 12 text

Code Samples It's python, and uses pygments: var iceCream = 'chocolate'; if (iceCream === 'chocolate') { alert('Yay, I love chocolate ice cream!'); } else { alert('Awwww, but chocolate is my favorite...'); } https://developer.mozilla.org/en-US/docs/Learn/Getting_started_wit h_the_web/JavaScript_basics @lornajane

Slide 13

Slide 13 text

How to rst2pdf @lornajane

Slide 14

Slide 14 text

How to rst2pdf Everything you need is here: https://rst2pdf.org/ pip install rst2pdf Ask questions, open issues, fix the tool ... all on GitHub https://github.com/rst2pdf/rst2pdf @lornajane