This commit is contained in:
janis
2023-03-06 16:05:08 +01:00
parent fec7ff974f
commit ba1c8153a9
3 changed files with 17 additions and 11 deletions

View File

@@ -18,11 +18,11 @@
<div id="docPage">
<div id="doc-container">
<h1>Autoplay</h1>
<p>The <a href="/src/plugins/autoplay/autoplay.js">autoplay</a> plugin automatically advances the presentation after a certain timeout expired.</p>
<p>The <a href="https://github.com/impress/impress.js/blob/master/src/plugins/autoplay/autoplay.js">autoplay</a> plugin automatically advances the presentation after a certain timeout expired.</p>
<h2>USAGE</h2>
<p>You first have to enable the plugin by setting a global <code>data-autoplay</code> value on the impress-div. Then you can change individual <code>data-autoplay</code> values on each <em>step</em> by adding <code>data-autoplay</code> to it. If this value is set to <code>0</code>, there will be no more auto-advancing on this <em>step</em>. The value you enter is time in seconds to switch to the next slide.</p>
<h2>EXAMPLE</h2>
<p>Note: This only shows part of the HTML. If you want to know how to set up a presentation, I highly recommend you read our <a href="https://github.com/impress/impress.js/blob/master/GettingStarted.md">Getting Started Guide</a></p>
<p>Note: This only shows part of the HTML. If you want to know how to set up a presentation, I highly recommend you read our <a href="/docs/gettingStarted.html">Getting Started Guide</a></p>
<pre><code>&lt;div id=impress data-autoplay=&quot;5&quot;&gt;
&lt;div class=&quot;step&quot; data-autoplay=&quot;0&quot;&gt;
This slide will not auto-advance

View File

@@ -37,7 +37,7 @@ of different divs.</p>
margin-right: 10px;
}
</code></pre>
<p>The <a href="../mouse-timeout/README.md">mouse-timeout</a> plugin can be leveraged to hide
<p>The <a href="/docs/plugins/mouse-timeout">mouse-timeout</a> plugin can be leveraged to hide
the toolbar from sight, and only make it visible when mouse is moved.</p>
<pre><code>body.impress-mouse-timeout div#impress-toolbar {
display: none;

View File

@@ -99,7 +99,7 @@ if ( prompt( 'Do you want to regenerate the plugins documentation? (y/n) ' ).toL
( async () => {
let html = md2html.render( '' + data );
storeHTML( await findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item], 'plugins' );
} );
} ) ();
};
} );
};
@@ -120,14 +120,14 @@ buildExamplesPage();
*/
async function findLinks ( html, path ) {
let returnHTML = html;
for ( let letter in html ) {
if ( html[letter] === '<' ) {
if ( html.slice( parseInt( letter ), parseInt( letter ) + 9 ) === '<a href="' ) {
for ( let letter in returnHTML ) {
if ( returnHTML[letter] === '<' ) {
if ( returnHTML.slice( parseInt( letter ), parseInt( letter ) + 9 ) === '<a href="' ) {
let i = 9;
while ( html.slice( parseInt( letter ) + i, parseInt( letter ) + i + 1 ) !== '"' ) {
while ( returnHTML.slice( parseInt( letter ) + i, parseInt( letter ) + i + 1 ) !== '"' ) {
i += 1;
};
returnHTML = html.slice( 0, parseInt( letter ) ) + await checkLinks( html.slice( parseInt( letter ) + 9, parseInt( letter ) + i ), path ) + html.slice( parseInt( letter ) + i + 2, parseInt( html.length ) );
returnHTML = returnHTML.slice( 0, parseInt( letter ) ) + await checkLinks( returnHTML.slice( parseInt( letter ) + 9, parseInt( letter ) + i ), path ) + returnHTML.slice( parseInt( letter ) + i + 2, parseInt( returnHTML.length ) );
};
};
};
@@ -186,7 +186,13 @@ async function checkLinks ( link, fpath ) {
return '<a href="' + link + '">';
} else if ( link.slice( 0, 1 ) === '/' && link.slice( 1, 2 ) !== '.' ) {
if ( link.slice( link.length - 3, link.length ).includes( '.' ) ) {
if ( link === '/GettingStarted.md' ) {
return '<a href="/docs/gettingStarted.html">';
} else if ( link === '/DOCUMENTATION.md' ) {
return '<a href="/docs/reference">';
} else {
return '<a href="https://github.com/impress/impress.js/blob/master' + link + '">';
}
} else {
return '<a href="https://github.com/impress/impress.js/tree/master' + link + '">';
};