From b0b2ce1fe310ae9009c710509d1afc2bb2f39e50 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 10 Sep 2015 08:50:55 +0200 Subject: [PATCH] print notes to pdf when is enabled #304 --- css/print/pdf.css | 8 ++++++++ css/reveal.css | 4 +++- css/reveal.scss | 2 ++ js/reveal.js | 12 ++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/css/print/pdf.css b/css/print/pdf.css index 2eb4cf23..04b4d656 100644 --- a/css/print/pdf.css +++ b/css/print/pdf.css @@ -61,6 +61,14 @@ h1,h2,h3,h4,h5,h6 { font-family: Courier, 'Courier New', monospace !important; } +.reveal .speaker-notes { + display: block; + width: 100%; + max-height: none; + left: auto; + top: auto; +} + /* SECTION 5: more reveal.js specific additions by @skypanther */ ul, ol, div, p { diff --git a/css/reveal.css b/css/reveal.css index 1aaa9b61..2b0486e9 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -1178,7 +1178,9 @@ body { background-color: rgba(0, 0, 0, 0.5); overflow: auto; -moz-box-sizing: border-box; - box-sizing: border-box; } + box-sizing: border-box; + text-align: left; + font-family: Helvetica, sans-serif; } .reveal .speaker-notes.visible:not(:empty) { display: block; } diff --git a/css/reveal.scss b/css/reveal.scss index 9bd570e9..f9e2facc 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -1314,6 +1314,8 @@ body { background-color: rgba(0,0,0,0.5); overflow: auto; box-sizing: border-box; + text-align: left; + font-family: Helvetica, sans-serif; } .reveal .speaker-notes.visible:not(:empty) { diff --git a/js/reveal.js b/js/reveal.js index 2b8fec7d..e517b33f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -573,6 +573,18 @@ background.style.top = -top + 'px'; background.style.left = -left + 'px'; } + + // If we're configured to `showNotes`, inject them into each slide + if( config.showNotes ) { + var notes = getSlideNotes( slide ); + if( notes ) { + var notesElement = document.createElement( 'div' ); + notesElement.classList.add( 'speaker-notes' ); + notesElement.innerHTML = notes; + notesElement.style.bottom = 40 - ( ( pageHeight - contentHeight ) / 2 ) + 'px'; + slide.appendChild( notesElement ); + } + } } } );