MCPcopy
hub / github.com/hakimel/reveal.js / getSlideNotes

Method getSlideNotes

js/controllers/notes.js:103–118  ·  view source on GitHub ↗

* Retrieves the speaker notes from a slide. Notes can be * defined in two ways: * 1. As a data-notes attribute on the slide * 2. With elements inside the slide * * @param {HTMLElement} [slide=currentSlide] * @return {(string|null)}

( slide = this.Reveal.getCurrentSlide() )

Source from the content-addressed store, hash-verified

101 * @return {(string|null)}
102 */
103 getSlideNotes( slide = this.Reveal.getCurrentSlide() ) {
104
105 // Notes can be specified via the data-notes attribute...
106 if( slide.hasAttribute( 'data-notes' ) ) {
107 return slide.getAttribute( 'data-notes' );
108 }
109
110 // ... or using <aside class="notes"> elements
111 let notesElements = slide.querySelectorAll( 'aside.notes' );
112 if( notesElements ) {
113 return Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\n' );
114 }
115
116 return null;
117
118 }
119
120 destroy() {
121

Callers 1

updateMethod · 0.95

Calls 1

getCurrentSlideMethod · 0.80

Tested by

no test coverage detected