From baab1a3036f03d4e88fcb2dc716a0eec43b1234b Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 2 Feb 2023 07:07:54 +0100 Subject: [PATCH] now also builds from DOCs, but no link check there --- package-lock.json | 25 ++- package.json | 7 +- website/docs/contributing/gettingStarted.html | 27 +++ website/docs/nav.html | 4 +- website/docs/plugins/extras.html | 20 +- website/docs/plugins/goto.html | 20 +- website/docs/plugins/help.html | 20 +- website/docs/plugins/impressConsole.html | 20 +- website/docs/plugins/mobile.html | 20 +- website/docs/plugins/mouse-timeout.html | 20 +- website/docs/plugins/navigation-ui.html | 20 +- website/docs/plugins/progress.html | 20 +- website/docs/plugins/rel.html | 20 +- website/docs/plugins/skip.html | 20 +- website/docs/plugins/stop.html | 20 +- website/docs/plugins/substep.html | 20 +- website/docs/plugins/toolbar.html | 20 +- website/docs/reference/CSS.html | 78 +++++++ website/docs/reference/HTML.html | 193 ++++++++++++++++++ website/docs/reference/JavaScript.html | 113 ++++++++++ website/docs/reference/Plugins.html | 27 +++ website/docs/src/build.js | 87 +++++--- website/js/docs/nav.js | 66 ++++-- 23 files changed, 707 insertions(+), 180 deletions(-) create mode 100644 website/docs/reference/CSS.html create mode 100644 website/docs/reference/HTML.html create mode 100644 website/docs/reference/JavaScript.html create mode 100644 website/docs/reference/Plugins.html diff --git a/package-lock.json b/package-lock.json index da691da..2e6d21b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "impress.js", "version": "2.1.0", "license": "MIT", + "dependencies": { + "prompt-sync": "^4.2.0" + }, "devDependencies": { "eslint": "^6.8.0", "jscs": "^2.1.1", @@ -5143,6 +5146,14 @@ "node": ">= 0.6.6" } }, + "node_modules/prompt-sync": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz", + "integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==", + "dependencies": { + "strip-ansi": "^5.0.0" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -6800,7 +6811,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, "dependencies": { "ansi-regex": "^4.1.0" }, @@ -6812,7 +6822,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, "engines": { "node": ">=6" } @@ -11819,6 +11828,14 @@ "winston": "0.8.x" } }, + "prompt-sync": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz", + "integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==", + "requires": { + "strip-ansi": "^5.0.0" + } + }, "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -13172,7 +13189,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, "requires": { "ansi-regex": "^4.1.0" }, @@ -13180,8 +13196,7 @@ "ansi-regex": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==" } } }, diff --git a/package.json b/package.json index 0442d9c..3e680dc 100644 --- a/package.json +++ b/package.json @@ -38,11 +38,14 @@ "karma-firefox-launcher": "^1.3.0", "karma-qunit": "^4.0.0", "ls": "^0.2.1", + "markdown-it": "^13.0.1", "puppeteer": "^2.1.1", "qunit": "^2.9.3", "qunit-assert-close": "^2.1.2", "syn": "^0.14.1", - "terser": "^4.6.7", - "markdown-it": "^13.0.1" + "terser": "^4.6.7" + }, + "dependencies": { + "prompt-sync": "^4.2.0" } } diff --git a/website/docs/contributing/gettingStarted.html b/website/docs/contributing/gettingStarted.html index e69de29..deb17ac 100644 --- a/website/docs/contributing/gettingStarted.html +++ b/website/docs/contributing/gettingStarted.html @@ -0,0 +1,27 @@ + + + + Contributing :: Docs - impress.js + + + + + + + + + + +
+ +
+
+
+

Getting Started - Contributing

+

So, you'd like to contribute to this project?

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/nav.html b/website/docs/nav.html index 7c8f05a..00fc1d3 100644 --- a/website/docs/nav.html +++ b/website/docs/nav.html @@ -13,9 +13,7 @@ Getting Started API reference + HomeCSS.htmlHTML.htmlJavaScript.htmlPlugins.html Plugins diff --git a/website/docs/plugins/extras.html b/website/docs/plugins/extras.html index 403ccdb..563d4e9 100644 --- a/website/docs/plugins/extras.html +++ b/website/docs/plugins/extras.html @@ -1,7 +1,7 @@ - Docs - impress.js + extras :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Extras Plugin

+ + +
+ +
+
+
+

Extras Plugin

The Extras plugin will initialize the optional addon plugins from extras/ directory, if they were loaded.

Generally, for an extras plugin to have been loaded, 2 things must have happened:

@@ -36,7 +36,7 @@ there's nothing to do here.

Author

Henrik Ingo (@henrikingo), 2016

-
+
diff --git a/website/docs/plugins/goto.html b/website/docs/plugins/goto.html index fddd052..c989740 100644 --- a/website/docs/plugins/goto.html +++ b/website/docs/plugins/goto.html @@ -1,7 +1,7 @@ - Docs - impress.js + goto :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Goto Plugin

+ + +
+ +
+
+
+

Goto Plugin

The goto plugin is a pre-stepleave plugin. It is executed before impress:stepleave event, and will alter the destination where to transition next.

Example:

@@ -37,7 +37,7 @@ of what strings to use for each key.

Copyright 2016 Henrik Ingo (@henrikingo) Released under the MIT license.

-
+
diff --git a/website/docs/plugins/help.html b/website/docs/plugins/help.html index 2b5bbb9..07d0b62 100644 --- a/website/docs/plugins/help.html +++ b/website/docs/plugins/help.html @@ -1,7 +1,7 @@ - Docs - impress.js + help :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Help screen plugin

+ + +
+ +
+
+
+

Help screen plugin

Shows a help popup when a presentation is loaded, as well as when 'H' is pressed.

To enable the help popup, add following div to your presentation:

<div id="impress-help"></div>
@@ -46,7 +46,7 @@
 

Copyright Henrik Ingo (@henrikingo), 2016 MIT License

-
+
diff --git a/website/docs/plugins/impressConsole.html b/website/docs/plugins/impressConsole.html index 3715580..a79906a 100644 --- a/website/docs/plugins/impressConsole.html +++ b/website/docs/plugins/impressConsole.html @@ -1,7 +1,7 @@ - Docs - impress.js + impressConsole :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Impress Console Plugin

+ + +
+ +
+
+
+

Impress Console Plugin

Press 'P' to show a speaker console window.

  • View of current slide
  • @@ -44,7 +44,7 @@

MIT License

-
+
diff --git a/website/docs/plugins/mobile.html b/website/docs/plugins/mobile.html index ff4d53d..92bb92a 100644 --- a/website/docs/plugins/mobile.html +++ b/website/docs/plugins/mobile.html @@ -1,7 +1,7 @@ - Docs - impress.js + mobile :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Mobile devices support

+ + +
+ +
+
+
+

Mobile devices support

Presentations with a lot of 3D effects and graphics can consume a lot of resources, especially on mobile devices. This plugin provides some CSS classes that can be used to hide most of the slides, only showing the current, previous and next slide.

@@ -43,7 +43,7 @@ steps will probably not look correct.

Author

Kurt Zenisek (@KZeni)

-
+
diff --git a/website/docs/plugins/mouse-timeout.html b/website/docs/plugins/mouse-timeout.html index fc419a5..f0db6e9 100644 --- a/website/docs/plugins/mouse-timeout.html +++ b/website/docs/plugins/mouse-timeout.html @@ -1,7 +1,7 @@ - Docs - impress.js + mouse-timeout :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Mouse timeout plugin

+ + +
+ +
+
+
+

Mouse timeout plugin

After 3 seconds of mouse inactivity, add the css class body.impress-mouse-timeout. On mousemove, click or touch, remove the class.

@@ -36,7 +36,7 @@ body.impress-mouse-timeout div#impress-toolbar {

Copyright 2016 Henrik Ingo (@henrikingo) Released under the MIT license.

-
+
diff --git a/website/docs/plugins/navigation-ui.html b/website/docs/plugins/navigation-ui.html index 8ac729a..2b3d43e 100644 --- a/website/docs/plugins/navigation-ui.html +++ b/website/docs/plugins/navigation-ui.html @@ -1,7 +1,7 @@ - Docs - impress.js + navigation-ui :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Navigation UI plugin

+ + +
+ +
+
+
+

Navigation UI plugin

This plugin provides UI elements "back", "forward" and a list to select a specific slide number.

Element attribut title is used for select option content if available, it uses element id if no title is provided.

@@ -26,7 +26,7 @@ presentations, see toolbar plugin README.

Author

Henrik Ingo (@henrikingo), 2016

-
+
diff --git a/website/docs/plugins/progress.html b/website/docs/plugins/progress.html index 019609b..ce1b805 100644 --- a/website/docs/plugins/progress.html +++ b/website/docs/plugins/progress.html @@ -1,7 +1,7 @@ - Docs - impress.js + progress :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Progress plugin

+ + +
+ +
+
+
+

Progress plugin

Progressbar and pagexounter for impress.js presentations

Usage

Add a div for progressbar and/or progress as you can see it here:

@@ -53,7 +53,7 @@

Author

Copyright 2014: Matthias Bilger (@m42e)

-
+
diff --git a/website/docs/plugins/rel.html b/website/docs/plugins/rel.html index 8b3a336..d8c9231 100644 --- a/website/docs/plugins/rel.html +++ b/website/docs/plugins/rel.html @@ -1,7 +1,7 @@ - Docs - impress.js + rel :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Relative Positioning Plugin

+ + +
+ +
+
+
+

Relative Positioning Plugin

This plugin provides support for defining the coordinates of a step relative to previous steps. This is often more convenient when creating presentations, since as you add, remove or move steps, you may not need to edit the positions @@ -121,7 +121,7 @@ the pre-init stage.)

Author

Henrik Ingo (@henrikingo), 2016

-
+
diff --git a/website/docs/plugins/skip.html b/website/docs/plugins/skip.html index 3af4d81..70611e4 100644 --- a/website/docs/plugins/skip.html +++ b/website/docs/plugins/skip.html @@ -1,7 +1,7 @@ - Docs - impress.js + skip :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Skip Plugin

+ + +
+ +
+
+
+

Skip Plugin

Example:

    <!-- This slide is disabled in presentations, when moving with next()
          and prev() commands, but you can still move directly to it, for
@@ -31,7 +31,7 @@ set, it will set the next step to the one after that.

Copyright 2016 Henrik Ingo (@henrikingo) Released under the MIT license.

-
+
diff --git a/website/docs/plugins/stop.html b/website/docs/plugins/stop.html index 116c28f..f965441 100644 --- a/website/docs/plugins/stop.html +++ b/website/docs/plugins/stop.html @@ -1,7 +1,7 @@ - Docs - impress.js + stop :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Stop Plugin

+ + +
+ +
+
+
+

Stop Plugin

Example:

    <!-- Stop at this slide.
          (For example, when used on the last slide, this prevents the 
@@ -32,7 +32,7 @@ slide.

Copyright 2016 Henrik Ingo (@henrikingo) Released under the MIT license.

-
+
diff --git a/website/docs/plugins/substep.html b/website/docs/plugins/substep.html index 3db2bb9..664fe8d 100644 --- a/website/docs/plugins/substep.html +++ b/website/docs/plugins/substep.html @@ -1,7 +1,7 @@ - Docs - impress.js + substep :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Substep Plugin

+ + +
+ +
+
+
+

Substep Plugin

Reveal each substep (such as a bullet point) of the step separately. Just like in PowerPoint!

If the current step contains html elements with class="substep" then this plugin will prevent a prev() / next() call to leave the slide, and instead reveal the next substep (for next()) or @@ -53,7 +53,7 @@ use the appropriate CSS to make the substeps hidden and visible.

Copyright 2017 Henrik Ingo (@henrikingo) Released under the MIT license.

-
+
diff --git a/website/docs/plugins/toolbar.html b/website/docs/plugins/toolbar.html index d860e66..cbce802 100644 --- a/website/docs/plugins/toolbar.html +++ b/website/docs/plugins/toolbar.html @@ -1,7 +1,7 @@ - Docs - impress.js + toolbar :: plugins | DOCS - impress.js @@ -10,14 +10,14 @@ - - -
- -
-
-
-

Toolbar plugin

+ + +
+ +
+
+
+

Toolbar plugin

This plugin provides a generic graphical toolbar. Other plugins that want to expose a button or other widget, can add those to this toolbar.

Using a single consolidated toolbar for all GUI widgets makes it easier @@ -48,7 +48,7 @@ the toolbar from sight, and only make it visible when mouse is moved.

Author

Henrik Ingo (@henrikingo), 2016

-
+
diff --git a/website/docs/reference/CSS.html b/website/docs/reference/CSS.html new file mode 100644 index 0000000..1669831 --- /dev/null +++ b/website/docs/reference/CSS.html @@ -0,0 +1,78 @@ + + + + CSS :: reference | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

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.

+

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.

+

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.

+

Example:

+
.step {
+  opacity: 0.3;
+  transition: opacity 1s;
+}
+.step.active {
+  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.

+

Example:

+
.impress-on-overview .step {
+    opacity: 1;
+    cursor: pointer;
+}
+.impress-on-step-1,
+.impress-on-step-2,
+.impress-on-step-3 {
+  background: LightBlue;
+}
+
+

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.

+

Example:

+
.impress-not-supported .step {
+  display: inline-block;
+}
+
+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/reference/HTML.html b/website/docs/reference/HTML.html new file mode 100644 index 0000000..fb876c3 --- /dev/null +++ b/website/docs/reference/HTML.html @@ -0,0 +1,193 @@ + + + + HTML :: reference | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

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).

+

When authoring impress.js presentations, you should target some screen size, which you can define here. +The default is 1024 x 768. You should write your CSS as if this is the screen size used for the +presentation. When you present your presentation on a screen (or browser window) of different size, +impress.js will automatically scale the presentation to fit the screen. The minimum and maximum limits +to this scaling can also be defined here.

+

All impress.js steps are wrapped inside a div element of 0 size! This means that in your CSS you +can't use relative values for width and height (example: width: 100%) to define the size of step elements. +You need to use pixel values. The pixel values used here correspond to the data-width and data-height +given to the #impress root element. When the presentation is viewed on a larger or smaller screen, impress.js +will automatically scale the steps to fit the screen.

+

NOTE: The default width and height have been changed to target HD screens in v1.2.0. If you +don't set target width and height explicitly, layout and dimensions of your presentations are likely +to be affected. In order to get back the old target resolution, use:

+
<div id="impress" data-width="1024" data-height="768" data-max-scale="1" data-min-scale="0"
+
+

You can also control the perspective with data-perspective="500" giving it a number of pixels. +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.

+

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDefaultExplanation
data-transition-duration1000 (ms)Speed of transition between steps.
data-width1920 (px)Width of target screen size. When presentation is viewed on a larger or smaller screen, impress.js will scale all content automatically.
data-height1080 (px)Height of target screen size.
data-max-scale3Maximum scale factor. (Note that the default 1 will not increase content size on larger screens!)
data-min-scale0Minimum scale factor.
data-perspective1000Perspective for 3D rendering. See https://developer.mozilla.org/en/CSS/perspective
+

Example:

+
<div id="impress"
+    data-transition-duration="1000"
+
+    data-width="1024"
+    data-height="768"
+    data-max-scale="3"
+    data-min-scale="0"
+    data-perspective="1000"
+
+    data-autoplay="7">
+
+

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. +In the Step Element, you can define a specific set of default attributes and positioning, that are documented below.

+

Example:

+
<div id="bored" class="step" data-x="-1000">
+    <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.

+

Attributes

+ + + + + + + + + + + + + + + + + + + + +
AttributeDefaultExplanation
data-x0X coordinate for step position
data-y0Y coordinate for step position
+

Example:

+
<div id="bored" class="step" data-x="-1000" data-y="-1500">
+    <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.

+

Example:

+
<div id="title" class="step" data-x="0" data-y="0" data-scale="4">
+    <span class="try">then you should try</span>
+    <h1>impress.js<sup>*</sup></h1>
+    <span class="footnote"><sup>*</sup> no rhyme intended</span>
+</div>
+
+

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">
+    <p>
+      It’s a <strong>presentation tool</strong> <br>
+      inspired by the idea behind <a href="http://prezi.com">prezi.com</a> <br>
+      and based on the <strong>power of CSS3 transforms and transitions</strong> in modern browsers.
+    </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).

+

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. +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.

+

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).

+
<div id="its-in-3d" class="step" data-x="6200" data-y="4300" data-z="-100" data-rotate-x="-40" data-rotate-y="10" data-scale="2">
+    <p>
+      <span class="have">have</span>
+      <span class="you">you</span>
+      <span class="noticed">noticed</span>
+      <span class="its">it’s</span>
+      <span class="in">in</span>
+      <b>3D<sup>*</sup></b>?
+    </p>
+    <span class="footnote">* beat that, prezi ;)</span>
+</div>
+
+

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.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/reference/JavaScript.html b/website/docs/reference/JavaScript.html new file mode 100644 index 0000000..6b9e7de --- /dev/null +++ b/website/docs/reference/JavaScript.html @@ -0,0 +1,113 @@ + + + + JavaScript :: reference | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

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

+

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

+

.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.

+

Example:

+
var rootElement = document.getElementById( "impress" );
+rootElement.addEventListener( "impress:init", function() {
+  console.log( "Impress init" );
+});
+impress().init();
+
+

.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() +again. (In most cases, this will not cause flickering or other visible effects to the user, +beyond the intended dynamic changes.)

+

Example:

+
impress().tear();
+
+

.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.

+

Example:

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

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

+

Accepts a Number that represents the step index.

+

Navigates to the step given the provided step index.

+

Example:

+
var api = impress();
+api.init();
+api.goto(7);
+
+

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.

+

Example:

+
var overview = document.getElementById( "overview" );
+var api = impress();
+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.

+

Example:

+
var rootElement = document.getElementById( "impress" );
+rootElement.addEventListener( "impress:stepenter", function(event) {
+  var currentStep = event.target;
+  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.

+

Example:

+
var rootElement = document.getElementById( "impress" );
+rootElement.addEventListener( "impress:stepleave", function(event) {
+  var currentStep = event.target;
+  var nextStep = event.detail.next;
+  console.log( "Left the Step Element '" + currentStep.id + "' and about to enter '" + nextStep.id );
+});
+
+

Improve The Docs

+

Did you find something that can be improved? Then create an issue so that we can discuss it!

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/reference/Plugins.html b/website/docs/reference/Plugins.html new file mode 100644 index 0000000..a0888ec --- /dev/null +++ b/website/docs/reference/Plugins.html @@ -0,0 +1,27 @@ + + + + Plugins :: reference | DOCS - impress.js + + + + + + + + + + +
+ +
+
+
+

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.

+
+
+ +
+ + \ No newline at end of file diff --git a/website/docs/src/build.js b/website/docs/src/build.js index 1c7f8a2..0ea9502 100644 --- a/website/docs/src/build.js +++ b/website/docs/src/build.js @@ -17,6 +17,9 @@ const path = require( 'path' ); const mdhtml = require( 'markdown-it' ); const md2html = new mdhtml(); const docRoot = path.join( __dirname + '/../' ); +const prompt = require( 'prompt-sync' )( { + sigint: true +} ); const pluginsPath = path.join( __dirname + '/../../../src/plugins' ); @@ -29,16 +32,33 @@ for ( let item in plugins ) { 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] ); + storeHTML( findLinks( html, path.join( pluginsPath + '/' + plugins[item] ) ), plugins[item], 'plugins' ); }; } ); } +if ( prompt( 'Do you want to regenerate the API reference? (y/n) ' ).toLowerCase() == 'y' ) { + console.log( 'Regenerating API reference' ); + parseDocumentationMD(); +} + +if ( prompt( 'Do you want to regenerate the Getting Started Guide? (y/n) ' ).toLowerCase() == 'y' ) { + console.log( 'Regenerating Getting Started Guide' ); + storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), '/gettingStarted.html', '' ); +} + +let docPages = fs.readdirSync( __dirname + '/../../../website/docs/reference' ); +for ( let obj in docPages ) { + if ( docPages[obj] == 'index.html' ) { + delete docPages[obj]; + }; +} + generateNav (); -parseDocumentationMD(); -storeHTML( md2html.render( '' + fs.readFileSync( path.join( __dirname + '/../../../GettingStarted.md' ) ) ), path.join( __dirname + '/../gettingStarted.html' ) ); - +/* + This function finds links. The reason for this is possible incompatibilities with links on the website +*/ function findLinks ( html, path ) { let returnHTML = html; for ( let letter in html ) { @@ -55,8 +75,11 @@ function findLinks ( html, path ) { return returnHTML; }; +/* + 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 ) { - console.log( link ); let filepath = fpath; let pos = 0; if ( link.slice( parseInt( link.length ) - 9, parseInt( link.length ) ) === 'README.md' ) { @@ -93,18 +116,17 @@ function checkLinks ( link, fpath ) { let fpSlice = filepath.slice( parseInt( filepath.length ) - fsPos, parseInt( filepath.length ) ); return ''; } else if ( link.slice( 0, 7 ) === 'http://' || link.slice( 0, 8 ) === 'https://' ) { - console.log( 'hi' ); return ''; } else { throw Error( 'Invalid link found! Link is: "' + link + '" in file: ' + filepath + '/README.md' ); }; }; -function storeHTML ( html, path ) { +function storeHTML ( html, path, type ) { let fileOut = ` - Docs - impress.js + ${path} :: ${type} | DOCS - impress.js @@ -113,21 +135,21 @@ function storeHTML ( html, path ) { - - - Plugins