support for 'separate-page' layout for notes in PDF exports #1518
This commit is contained in:
		| @@ -890,7 +890,7 @@ This will only display in the notes window. | |||||||
|  |  | ||||||
| Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` config value set to `true`. Notes will appear along the bottom of the presentations. | Notes are only visible to the speaker inside of the speaker view. If you wish to share your notes with others you can initialize reveal.js with the `showNotes` config value set to `true`. Notes will appear along the bottom of the presentations. | ||||||
|  |  | ||||||
| When `showNotes` is enabled notes are also included when you [export to PDF](https://github.com/hakimel/reveal.js#pdf-export). | When `showNotes` is enabled notes are also included when you [export to PDF](https://github.com/hakimel/reveal.js#pdf-export). By default, notes are printed in a semi-transparent box on top of slide. If you'd rather print them on a separate page after the slide, set `showNotes: "separate-page"`. | ||||||
|  |  | ||||||
| ## Server Side Speaker Notes | ## Server Side Speaker Notes | ||||||
|  |  | ||||||
|   | |||||||
| @@ -145,11 +145,22 @@ ul, ol, div, p { | |||||||
| 	display: block; | 	display: block; | ||||||
| 	width: 100%; | 	width: 100%; | ||||||
| 	max-height: none; | 	max-height: none; | ||||||
| 	left: auto; |  | ||||||
| 	top: auto; | 	top: auto; | ||||||
|  | 	right: auto; | ||||||
|  | 	bottom: auto; | ||||||
|  | 	left: auto; | ||||||
| 	z-index: 100; | 	z-index: 100; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /* Layout option which makes notes appear on a separate page */ | ||||||
|  | .reveal .speaker-notes-pdf[data-layout="separate-page"] { | ||||||
|  | 	position: relative; | ||||||
|  | 	color: inherit; | ||||||
|  | 	background-color: transparent; | ||||||
|  | 	padding: 20px; | ||||||
|  | 	page-break-after: always; | ||||||
|  | } | ||||||
|  |  | ||||||
| /* Display slide numbers when 'slideNumber' is enabled */ | /* Display slide numbers when 'slideNumber' is enabled */ | ||||||
| .reveal .slide-number-pdf { | .reveal .slide-number-pdf { | ||||||
| 	display: block; | 	display: block; | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -624,18 +624,31 @@ | |||||||
|  |  | ||||||
| 				// Inject notes if `showNotes` is enabled | 				// Inject notes if `showNotes` is enabled | ||||||
| 				if( config.showNotes ) { | 				if( config.showNotes ) { | ||||||
|  |  | ||||||
|  | 					// Are there notes for this slide? | ||||||
| 					var notes = getSlideNotes( slide ); | 					var notes = getSlideNotes( slide ); | ||||||
| 					if( notes ) { | 					if( notes ) { | ||||||
|  |  | ||||||
| 						var notesSpacing = 8; | 						var notesSpacing = 8; | ||||||
|  | 						var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline'; | ||||||
| 						var notesElement = document.createElement( 'div' ); | 						var notesElement = document.createElement( 'div' ); | ||||||
| 						notesElement.classList.add( 'speaker-notes' ); | 						notesElement.classList.add( 'speaker-notes' ); | ||||||
| 						notesElement.classList.add( 'speaker-notes-pdf' ); | 						notesElement.classList.add( 'speaker-notes-pdf' ); | ||||||
|  | 						notesElement.setAttribute( 'data-layout', notesLayout ); | ||||||
| 						notesElement.innerHTML = notes; | 						notesElement.innerHTML = notes; | ||||||
|  |  | ||||||
|  | 						if( notesLayout === 'separate-page' ) { | ||||||
|  | 							page.parentNode.insertBefore( notesElement, page.nextSibling ); | ||||||
|  | 						} | ||||||
|  | 						else { | ||||||
| 							notesElement.style.left = ( notesSpacing - left ) + 'px'; | 							notesElement.style.left = ( notesSpacing - left ) + 'px'; | ||||||
| 							notesElement.style.bottom = ( notesSpacing - top ) + 'px'; | 							notesElement.style.bottom = ( notesSpacing - top ) + 'px'; | ||||||
| 							notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; | 							notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; | ||||||
| 							slide.appendChild( notesElement ); | 							slide.appendChild( notesElement ); | ||||||
| 						} | 						} | ||||||
|  |  | ||||||
|  | 					} | ||||||
|  |  | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				// Inject slide numbers if `slideNumbers` are enabled | 				// Inject slide numbers if `slideNumbers` are enabled | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user