Bladeren bron

print notes to pdf when is enabled #304

Hakim El Hattab 8 jaren geleden
bovenliggende
commit
b0b2ce1fe3
4 gewijzigde bestanden met toevoegingen van 25 en 1 verwijderingen
  1. 8 0
      css/print/pdf.css
  2. 3 1
      css/reveal.css
  3. 2 0
      css/reveal.scss
  4. 12 0
      js/reveal.js

+ 8 - 0
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 {

+ 3 - 1
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; }

+ 2 - 0
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) {

+ 12 - 0
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 );
+					}
+				}
 			}
 
 		} );