diff --git a/website/css/docs/style.css b/website/css/docs/style.css index afa8339..e2db4a1 100644 --- a/website/css/docs/style.css +++ b/website/css/docs/style.css @@ -32,7 +32,7 @@ html, body { 'menu footer footer footer footer'; } -.docs-link { +#doc-container a { color: blue; } @@ -73,3 +73,6 @@ html, body { grid-area: header; } +code { + font-size: 85%; +} diff --git a/website/docs/plugins/autoplay.html b/website/docs/plugins/autoplay.html index 18ae57e..bd34d33 100644 --- a/website/docs/plugins/autoplay.html +++ b/website/docs/plugins/autoplay.html @@ -22,7 +22,7 @@
You first have to enable the plugin by setting a global data-autoplay value on the impress-div. Then you can change individual data-autoplay values on each step by adding data-autoplay to it. If this value is set to 0, there will be no more auto-advancing on this step. The value you enter is time in seconds to switch to the next slide.
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 Getting Started Guide
+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 Getting Started Guide
<div id=impress data-autoplay="5">
<div class="step" data-autoplay="0">
This slide will not auto-advance
diff --git a/website/docs/plugins/extras.html b/website/docs/plugins/extras.html
index 563d4e9..aaffdf2 100644
--- a/website/docs/plugins/extras.html
+++ b/website/docs/plugins/extras.html
@@ -19,7 +19,7 @@
Extras Plugin
The Extras plugin will initialize the optional addon plugins from
-extras/ directory, if they were loaded.
+extras/ directory, if they were loaded.
Generally, for an extras plugin to have been loaded, 2 things must have happened:
- The extras plugins must be present in extras/ directory, for example after
diff --git a/website/docs/plugins/rel.html b/website/docs/plugins/rel.html
index d8c9231..3c81d9e 100644
--- a/website/docs/plugins/rel.html
+++ b/website/docs/plugins/rel.html
@@ -99,7 +99,7 @@ cannot or don't want to add the explicit 0 values where needed, your last resort
remove the
rel.js plugin completely. You can either:
-
-
Remove rel.js from /build.js and recompile impress.js with: npm build
+Remove rel.js from /build.js and recompile impress.js with: npm build
-
Just open [/js/impress.js] in an editor and delete the rel.js code.
diff --git a/website/docs/plugins/toolbar.html b/website/docs/plugins/toolbar.html
index cbce802..5c5b046 100644
--- a/website/docs/plugins/toolbar.html
+++ b/website/docs/plugins/toolbar.html
@@ -44,7 +44,7 @@ the toolbar from sight, and only make it visible when mouse is moved.
}
If you're writing a plugin and would like to add a widget to the toolbar, see
-the top of the source file for further instructions.
+the top of the source file for further instructions.
Author
Henrik Ingo (@henrikingo), 2016
diff --git a/website/docs/src/build.js b/website/docs/src/build.js
index 4fd9a5e..73f56fc 100644
--- a/website/docs/src/build.js
+++ b/website/docs/src/build.js
@@ -96,8 +96,10 @@ if ( prompt( 'Do you want to regenerate the plugins documentation? (y/n) ' ).toL
if ( error ) {
console.log( 'NO README found for ' + path.join( pluginsPath + '/' + plugins[item] ) + ' PLEASE MAKE SURE YOU HAVE CREATED A README!' );
} else {
- let html = md2html.render( '' + data );
- storeHTML( findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item], 'plugins' );
+ ( async () => {
+ let html = md2html.render( '' + data );
+ storeHTML( await findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item], 'plugins' );
+ } );
};
} );
};
@@ -116,7 +118,7 @@ buildExamplesPage();
/*
This function finds links. The reason for this is possible incompatibilities with links on the website
*/
-function findLinks ( html, path ) {
+async function findLinks ( html, path ) {
let returnHTML = html;
for ( let letter in html ) {
if ( html[letter] === '<' ) {
@@ -125,7 +127,7 @@ function findLinks ( html, path ) {
while ( html.slice( parseInt( letter ) + i, parseInt( letter ) + i + 1 ) !== '"' ) {
i += 1;
};
- returnHTML = html.slice( 0, parseInt( letter ) ) + checkLinks( html.slice( parseInt( letter ) + 9, parseInt( letter ) + i ), path ) + html.slice( parseInt( letter ) + i + 2, parseInt( html.length ) );
+ 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 ) );
};
};
};
@@ -136,7 +138,7 @@ function findLinks ( html, path ) {
This function takes care of checking links. This is necessary, as documentation may contain links that will
not work on the website, as it has relative paths.
*/
-function checkLinks ( link, fpath ) {
+async function checkLinks ( link, fpath ) {
let filepath = fpath;
let pos = 0;
if ( link.slice( parseInt( link.length ) - 9, parseInt( link.length ) ) === 'README.md' ) {
@@ -160,22 +162,34 @@ function checkLinks ( link, fpath ) {
while ( filepath.slice( parseInt( filepath.length ) - fsPos - 10, parseInt( filepath.length ) - fsPos ) !== 'impress.js' ) {
fsPos += 1;
};
- let fpSlice = filepath.slice( parseInt( filepath.length ) - fsPos, parseInt( filepath.length ) );
+ let fpSlice = filepath.slice( parseInt( filepath.length ) - fsPos + 1, parseInt( filepath.length ) );
let linkSlice = link.slice( pos, link.length );
// now let's assemble a link and add it back into the html
- return '';
+ if ( link.slice( link.length - 3, link.length ).includes( '.' ) ) {
+ return '';
+ } else {
+ return '';
+ };
} else if ( link.slice( 0, 1 ) !== '.' && link.slice( 0, 1 ) !== '/' ) {
let fsPos = 0;
while ( filepath.slice( parseInt( filepath.length ) - fsPos - 10, parseInt( filepath.length ) - fsPos ) !== 'impress.js' ) {
fsPos += 1;
};
- let fpSlice = filepath.slice( parseInt( filepath.length ) - fsPos, parseInt( filepath.length ) );
- return '';
+ let fpSlice = filepath.slice( parseInt( filepath.length ) - fsPos + 1, parseInt( filepath.length ) ) + '/';
+ if ( link.slice( link.length - 3, link.length ).includes( '.' ) ) {
+ return '';
+ } else {
+ return '';
+ };
} else if ( link.slice( 0, 7 ) === 'http://' || link.slice( 0, 8 ) === 'https://' ) {
return '';
- } else if ( link.slice( 0, 1 ) === '/' ) {
- return '';
+ } else if ( link.slice( 0, 1 ) === '/' && link.slice( 1, 2 ) !== '.' ) {
+ if ( link.slice( link.length - 3, link.length ).includes( '.' ) ) {
+ return '';
+ } else {
+ return '';
+ };
} else {
throw Error( 'Invalid link found! Link is: "' + link + '" in file: ' + filepath + '/README.md' );
};
diff --git a/website/js/docs/loader.js b/website/js/docs/loader.js
index ff82840..5d55ded 100644
--- a/website/js/docs/loader.js
+++ b/website/js/docs/loader.js
@@ -19,7 +19,7 @@ function setTheme () {
$( '.nav-subitem' ).css( 'background-color', 'rgb(18, 18, 99)' );
$( '.navitem' ).css( 'background-color', 'rgb(12, 12, 60)' );
$( '.nav-container' ).css( 'background-color', 'rgb(0, 0, 100)' );
- $( '.docs-link' ).css( 'color', 'white' );
+ $( '#doc-container a' ).css( 'color', 'white' );
$( '#darkToggle' ).css( 'color', 'white' );
}
}
@@ -46,7 +46,7 @@ function toggleDarkMode () {
if ( theme == 'light' ) {
$( '.content' ).animate( { 'background-color': 'rgb(46, 46, 46)' } );
$( '.content' ).animate( { 'color': 'white' } );
- $( '.docs-link' ).animate( { 'color': 'white' } );
+ $( '#doc-container a' ).animate( { 'color': 'white' } );
$( '.top-container' ).animate( { 'background-color': 'rgb(100, 100, 100)' } );
$( '.nav-subitem' ).animate( { 'background-color': 'rgb(18, 18, 99)' } );
$( '.navitem' ).animate( { 'background-color': 'rgb(12, 12, 60)' } );
@@ -57,7 +57,7 @@ function toggleDarkMode () {
} else {
$( '.content' ).animate( { 'background-color': 'white' } );
$( '.content' ).animate( { 'color': 'black' } );
- $( '.docs-link' ).animate( { 'color': 'blue' } );
+ $( '#doc-container a' ).animate( { 'color': 'blue' } );
$( '.nav-subitem' ).animate( { 'background-color': 'rgb(27, 27, 165)' } );
$( '.navitem' ).animate( { 'background-color': 'rgb(22, 22, 117)' } );
$( '.nav-container' ).animate( { 'background-color': 'blue' } );