diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e95a2da..541b13e 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -319,7 +319,7 @@ impress().tear(); #### .next() -Navigates to the next step of the presentation using the [`goto()` function](#impressgotostepindexstepelementidstepelement-duration). +Navigates to the next step of the presentation using the [`goto()` function](#-goto-stepindex--stepelementid--stepelement---duration--). **Example:** @@ -331,7 +331,7 @@ api.next(); #### .prev() -Navigates to the previous step of the presentation using the [`goto()` function](#impressgotostepindexstepelementidstepelement-duration). +Navigates to the previous step of the presentation using the [`goto()` function](#-goto-stepindex--stepelementid--stepelement---duration--). **Example:** diff --git a/website/docs/reference/CSS.html b/website/docs/reference/CSS.html index 1669831..0f681aa 100644 --- a/website/docs/reference/CSS.html +++ b/website/docs/reference/CSS.html @@ -17,29 +17,29 @@
-

CSS

-

4D States (.past, .present and .future classes)

-

The .future class is added to all Step Elements that haven't been visited yet.

+

CSS

+

4D States (.past, .present and .future classes)

+

The .future class is added to all Step Elements that haven't been visited yet.

Example:

.future {
   display: none;
 }
 
-

The .present class is added to the Step Element that is currently at the center of the camera. This is useful to create animations inside the step once the camera navigates to it.

+

The .present class is added to the Step Element that is currently at the center of the camera. This is useful to create animations inside the step once the camera navigates to it.

Example:

.present .rotating {
   transform: rotate(-10deg);
   transition-delay: 0.25s;
 }
 
-

The .past class is added to all Step Elements that have been visited at least once.

+

The .past class is added to all Step Elements that have been visited at least once.

Example:

.past {
   display: none;
 }
 
-

Current Active Step (.active class)

-

The .active class is added to the Step Element that is currently visible at the center of the camera.

+

Current Active Step (.active class)

+

The .active class is added to the Step Element that is currently visible at the center of the camera.

Example:

.step {
   opacity: 0.3;
@@ -49,7 +49,7 @@
   opacity: 1
 }
 
-

At the same time, the impress-on-* class is added to the body element, the class name represents the active Step Element id. This allows for custom global styling, since you can't match a CSS class backwards from the active Step Element to the body.

+

At the same time, the impress-on-* class is added to the body element, the class name represents the active Step Element id. This allows for custom global styling, since you can't match a CSS class backwards from the active Step Element to the body.

Example:

.impress-on-overview .step {
     opacity: 1;
@@ -61,7 +61,7 @@
   background: LightBlue;
 }
 
-

Progressive Enhancement (.impress-not-supported class)

+

Progressive Enhancement (.impress-not-supported class)

The .impress-not-supported class is added to the body element if the browser doesn't support the features required by impress.js to work, it is useful to apply some fallback styles in the CSS.

It's not necessary to add it manually on the body element. If the script detects that the browser lacks important features it will add this class.

It is recommended to add the class manually to the body element though, because that means that users without JavaScript will also get fallback styles. When impress.js script detects that the browser supports all required features, the .impress-not-support class will be removed from the body element.

diff --git a/website/docs/reference/HTML.html b/website/docs/reference/HTML.html index a141da4..411102a 100644 --- a/website/docs/reference/HTML.html +++ b/website/docs/reference/HTML.html @@ -17,8 +17,8 @@
-

HTML

-

Root Element

+

HTML

+

Root Element

impress.js requires a Root Element. All the content of the presentation will be created inside that element. It is not recommended to manipulate any of the styles, attributes or classes that are created by impress.js inside the Root Element after initialization.

To change the duration of the transition between slides use data-transition-duration="2000" giving it a number of ms. It defaults to 1000 (1s).

@@ -41,7 +41,7 @@ to be affected. In order to get back the old target resolution, use:

It defaults to 1000. You can set it to 0 if you don't want any 3D effects. If you are willing to change this value make sure you understand how CSS perspective works: https://developer.mozilla.org/en/CSS/perspective

-

See also the plugin README for documentation on data-autoplay.

+

See also the plugin README for documentation on data-autoplay.

Attributes

@@ -96,7 +96,7 @@ https://developer.mozilla.org/en/CSS/perspective

data-autoplay="7"> -

Step Element

+

Step Element

A Step Element is an element that contains metadata that defines how it is going to be presented in the screen. A Step Element should contain a .step class and an optional id attribute. The content represents an html fragment that will be positioned at the center of the camera. @@ -106,8 +106,8 @@ In the Step Element, you can define a specific set of default attributes and pos <q>Aren’t you just <b>bored</b> with all those slides-based presentations?</q> </div> -

2D Coordinates Positioning (data-x, data-y)

-

Define the pixel based position in which the center of the Step Element will be positioned inside the infinite canvas.

+

2D Coordinates Positioning (data-x, data-y)

+

Define the pixel based position in which the center of the Step Element will be positioned inside the infinite canvas.

Attributes

@@ -135,8 +135,8 @@ In the Step Element, you can define a specific set of default attributes and pos <q>Aren’t you just <b>bored</b> with all those slides-based presentations?</q> </div> -

2D Scaling (data-scale)

-

Defines the scaling multiplier of the Step Element relative to other Step Elements. For example, data-scale="4" means that the element will appear to be 4 times larger than the others. From the presentation and transitions point of view, it means that it will have to be scaled down (4 times) to make it back to its correct size.

+

2D Scaling (data-scale)

+

Defines the scaling multiplier of the Step Element relative to other Step Elements. For example, data-scale="4" means that the element will appear to be 4 times larger than the others. From the presentation and transitions point of view, it means that it will have to be scaled down (4 times) to make it back to its correct size.

Example:

<div id="title" class="step" data-x="0" data-y="0" data-scale="4">
     <span class="try">then you should try</span>
@@ -144,7 +144,7 @@ In the Step Element, you can define a specific set of default attributes and pos
     <span class="footnote"><sup>*</sup> no rhyme intended</span>
 </div>
 
-

2D Rotation (data-rotate)

+

2D Rotation (data-rotate)

Represents the amount of clockwise rotation of the element relative to 360 degrees.

Example:

<div id="its" class="step" data-x="850" data-y="3000" data-rotate="90" data-scale="5">
@@ -155,18 +155,18 @@ In the Step Element, you can define a specific set of default attributes and pos
     </p>
 </div>
 
-

3D Coordinates Positioning (data-z)

-

Define the pixel based position in which the center of the Step Element will be positioned inside the infinite canvas on the third dimension (Z) axis. For example, if we use data-z="-3000", it means that the Step Element will be positioned far away from the camera (by 3000px).

+

3D Coordinates Positioning (data-z)

+

Define the pixel based position in which the center of the Step Element will be positioned inside the infinite canvas on the third dimension (Z) axis. For example, if we use data-z="-3000", it means that the Step Element will be positioned far away from the camera (by 3000px).

Example:

<div id="tiny" class="step" data-x="2825" data-y="2325" data-z="-3000" data-rotate="300" data-scale="1">
     <p>and <b>tiny</b> ideas</p>
 </div>
 
-

Note: The introduction of the rel plugin includes a slight backward incompatible change. +

Note: The introduction of the rel plugin includes a slight backward incompatible change. Previously the default value for data-x, data-y and data-z was zero. The rel plugin changes the default to inherit the value of the previous slide. This means, you need to explicitly set these values to zero, if they ever were non-zero.

-

3D Rotation (data-rotate-x, data-rotate-y, data-rotate-z)

-

You can not only position a Step Element in 3D, but also rotate it around any axis.

+

3D Rotation (data-rotate-x, data-rotate-y, data-rotate-z)

+

You can not only position a Step Element in 3D, but also rotate it around any axis.

Example:

The example below will get rotated by -40 degrees (40 degrees anticlockwise) around X axis and 10 degrees (clockwise) around Y axis.

You can of course rotate it around Z axis with data-rotate-z - it has exactly the same effect as data-rotate (these two are basically aliases).

@@ -182,9 +182,9 @@ the value of the previous slide. This means, you need to explicitly set these va <span class="footnote">* beat that, prezi ;)</span> </div> -

3D Rotation Order (data-rotate-order)

+

3D Rotation Order (data-rotate-order)

The order in which the CSS rotateX(), rotateY(), rotateZ() transforms are applied matters. This is because each rotation is relative to the then current position of the element.

-

By default the rotation order is data-rotate-order="xyz". For some advanced uses you may need to change it. The demo presentation 3D rotations sets this attribute to rotate some steps into positions that are impossible to reach with the default order.

diff --git a/website/docs/reference/JavaScript.html b/website/docs/reference/JavaScript.html index 6b9e7de..5b1db02 100644 --- a/website/docs/reference/JavaScript.html +++ b/website/docs/reference/JavaScript.html @@ -17,21 +17,21 @@
-

JavaScript

-

impress( [ id ] )

-

A factory function that creates the ImpressAPI.

+

JavaScript

+

impress( [ id ] )

+

A factory function that creates the ImpressAPI.

Accepts a String that represents the id of the root element in the page. If omitted, impress.js will lookup for the element with the id "impress" by default.

Example:

var impressAPI = impress( "root" );
 
-

ImpressAPI

+

ImpressAPI

The main impress.js API that handles common operations of impress.js, listed below.

-

.init()

+

.init()

Initializes impress.js globally in the page. Only one instance of impress.js is supported per document.

Example:

impress().init();
 
-

Triggers the impress:init event in the Root Element after the presentation is initialized.

+

Triggers the impress:init event in the Root Element after the presentation is initialized.

Example:

var rootElement = document.getElementById( "impress" );
 rootElement.addEventListener( "impress:init", function() {
@@ -39,7 +39,7 @@ rootElement.addEventListener( "impress:init", function() {
 });
 impress().init();
 
-

.tear()

+

.tear()

Resets the DOM to its original state, as it was before init() was called.

This can be used to "unload" impress.js. A particular use case for this is, if you want to do dynamic changes to the presentation, you can do a teardown, apply changes, then call init() @@ -48,21 +48,21 @@ beyond the intended dynamic changes.)

Example:

impress().tear();
 
-

.next()

-

Navigates to the next step of the presentation using the goto() function.

+

.next()

+

Navigates to the next step of the presentation using the goto() function.

Example:

var api = impress();
 api.init();
 api.next();
 
-

.prev()

-

Navigates to the previous step of the presentation using the goto() function.

+

.prev()

+

Navigates to the previous step of the presentation using the goto() function.

Example:

var api = impress();
 api.init();
 api.prev();
 
-

.goto( stepIndex | stepElementId | stepElement, [ duration ] )

+

.goto( stepIndex | stepElementId | stepElement, [ duration ] )

Accepts a Number that represents the step index.

Navigates to the step given the provided step index.

Example:

@@ -70,15 +70,15 @@ api.prev(); api.init(); api.goto(7); -

Accepts a String that represents the Step Element id.

-

Navigates to the step given the provided Step Element id.

+

Accepts a String that represents the Step Element id.

+

Navigates to the step given the provided Step Element id.

Example:

var api = impress();
 api.init();
 api.goto( "overview" );
 
-

Accepts an HTMLElement that represents the Step Element.

-

Navigates to the step given the provided Step Element.

+

Accepts an HTMLElement that represents the Step Element.

+

Navigates to the step given the provided Step Element.

Example:

var overview = document.getElementById( "overview" );
 var api = impress();
@@ -86,7 +86,7 @@ api.init();
 api.goto( overview );
 

Accepts an optional Number in the last argument that represents the duration of the transition in milliseconds. If not provided, the default transition duration for the presentation will be used.

-

Triggers the impress:stepenter event in the Root Element when the presentation navigates to the target Step Element.

+

Triggers the impress:stepenter event in the Root Element when the presentation navigates to the target Step Element.

Example:

var rootElement = document.getElementById( "impress" );
 rootElement.addEventListener( "impress:stepenter", function(event) {
@@ -94,7 +94,7 @@ rootElement.addEventListener( "impress:stepenter", function(event) {
   console.log( "Entered the Step Element '" + currentStep.id + "'" );
 });
 
-

Triggers the impress:stepleave event in the Root Element when the presentation navigates away from the current Step Element.

+

Triggers the impress:stepleave event in the Root Element when the presentation navigates away from the current Step Element.

Example:

var rootElement = document.getElementById( "impress" );
 rootElement.addEventListener( "impress:stepleave", function(event) {
diff --git a/website/docs/reference/Plugins.html b/website/docs/reference/Plugins.html
index 9647f78..220107f 100644
--- a/website/docs/reference/Plugins.html
+++ b/website/docs/reference/Plugins.html
@@ -17,8 +17,8 @@
                 
-

Plugins

-

Many new features are implemented as plugins. The Plugins documentation is the starting place to learn about those, as well as the README.md of Plugins +

Many new features are implemented as plugins. The Plugins documentation is the starting place to learn about those, as well as the README.md of each plugin.

diff --git a/website/docs/src/build.js b/website/docs/src/build.js index 288e730..d3ed4cc 100644 --- a/website/docs/src/build.js +++ b/website/docs/src/build.js @@ -43,17 +43,20 @@ if ( prompt( 'Do you want to regenerate the API reference? (y/n) ' ).toLowerCase parseDocumentationMD(); } -if ( prompt( 'Do you want to regenerate the Getting Started Guide? (y/n) ' ).toLowerCase() == 'y' ) { +if ( prompt( 'Do you want to regenerate the getting started guide? (y/n) ' ).toLowerCase() == 'y' ) { console.log( 'Regenerating Getting Started Guide' ); storeHTML( generateGettingStarted( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ) ), 'gettingStarted', '' ); } -console.log( 'regenerating plugins documentation' ); let docPages = fs.readdirSync( __dirname + '/../../../website/docs/reference' ); -for ( let obj in docPages ) { - if ( docPages[obj] == 'index.html' ) { - delete docPages[obj]; - }; + +if ( prompt( 'Do you want to regenerate the plugins documentation? (y/n) ' ).toLowerCase() == 'y' ) { + console.log( 'regenerating plugins documentation' ); + for ( let obj in docPages ) { + if ( docPages[obj] == 'index.html' ) { + delete docPages[obj]; + }; + } } console.log( 'regenerating Nav' ); @@ -221,6 +224,9 @@ function parseDocumentationMD () { lastHashtagPos = parseInt( letter ); }; }; + + let titles = {}; + for ( let item in posArray ) { let titleArea = doc.slice( parseInt( posArray[item] ), parseInt( posArray[item] + 20 ) ); let title = ''; @@ -232,9 +238,45 @@ function parseDocumentationMD () { }; let page = md2html.render( doc.slice( parseInt( posArray[parseInt( item )] ), parseInt( posArray[parseInt( item ) + 1] ) || parseInt( doc.length ) ) ); - let updatedPage = page; for ( let letter in page ) { + let titleTag = page.slice( parseInt( letter ), parseInt( letter ) + 4 ); + if ( titleTag === '

' || titleTag === '

' || titleTag === '

' || titleTag === '

' ) { + let i = 4; + while ( page.slice( parseInt( letter ) + i, parseInt( letter ) + i + 1 ) !== '<' ) { + i += 1; + }; + let heading = '' + page.slice( parseInt( letter ) + 4, parseInt( letter ) + i ); + let output = ''; + for ( let pos in heading ) { + let letter = heading[ pos ]; + if ( letter === ' ' || letter === '.' || letter === ',' ) { + output += '-'; + } else if ( letter === '(' || letter === ')' || letter === '[' || letter === ']' || letter === '|' ) { + + } else { + output += letter; + }; + }; + titles[ output.toLowerCase() ] = title; + }; + }; + } + + for ( let item in posArray ) { + let titleArea = doc.slice( parseInt( posArray[item] ), parseInt( posArray[item] + 20 ) ); + let title = ''; + for ( let pos in titleArea ) { + if ( titleArea[pos] === '\n' ) { + title = titleArea.slice( 3, pos ); + break; + }; + }; + + let page = md2html.render( doc.slice( parseInt( posArray[parseInt( item )] ), parseInt( posArray[parseInt( item ) + 1] ) || parseInt( doc.length ) ) ); + + for ( let letter in page ) { + let titleTag = page.slice( parseInt( letter ), parseInt( letter ) + 4 ); if ( page[letter] === '<' ) { if ( page.slice( parseInt( letter ), parseInt( letter ) + 9 ) === '' + page.slice( parseInt( letter ) + 4, parseInt( page.length ) ); + }; }; - storeHTML( updatedPage, title, 'reference' ); + storeHTML( page, title, 'reference' ); }; }; } diff --git a/website/js/docs/nav.js b/website/js/docs/nav.js index bfa5145..e41e4ad 100644 --- a/website/js/docs/nav.js +++ b/website/js/docs/nav.js @@ -1,7 +1,6 @@ let bannedIDs = []; function highlightPath () { - console.log( 'highlighting' ); if ( $( location ).attr( 'pathname' ).slice( 6, location.pathname.length ) === '' ) { $( '#home' ).animate( { 'background-color': 'black' }, 200 ); bannedIDs.push( 'home' ); @@ -22,7 +21,6 @@ function highlightPath () { }; function highlightSubPath ( sliceStart ) { - console.log( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) ); if ( $( location ).attr( 'pathname' ).slice( sliceStart, parseInt( location.pathname.length ) - 5 ) === '' ) { $( '#root' ).animate( { 'background-color': 'black' }, 200 ); bannedIDs.push( 'root' );