S5SlideShow

From Wiki4Intranet
(Redirected from S5SlideShow/en)
Jump to: navigation, search


S5MW.svg

S5 or simply S5 is a cross-browser slide-show system using pure HTML and JavaScript. Its name is derived from Simple Standards-based Slide Show System — 5 times «S», or simply S5.

S5SlideShow is a MediaWiki extension.

Status for Mediawiki4Intranet distribution:

  • Inclusion date: 2010-02-09
  • Included version: newest available
  • Improvement status: Created by MediaWiki4Intranet project

Slide show example (russian language): User:StasFomin/VideoKnowHow.

Usage

S5SlideShow gives a simple, convenient and fast method for creating slide shows from plaintext. Of course, it supports the full range of MediaWiki features such as Flash video, Mindmaps, code highlighting and etc.

You can turn any wiki page into a slide show. To do so, put there a block (slide show definition) with following content:

<slideshow attribute="value" [attribute="value" ...]>
;attribute: Value
[;attribute: Value ...]
</slideshow>

I.e. attributes may be specified either as XML-like <slide> tag attributes, or as definition list items inside it. There are the following attributes:

Attribute Description
style 7 skins are available «out-of-the-box»: blue, default, custis, nobook, flower, yatil, pixel. You can also create your own styles using wiki pages. See #Skins.
headingmark A character sequence, which is searched inside all headings text (== Just a simple MediaWiki headings ==), and if it’s there, the heading will be mapped to slide in the slide show mode. If the heading includes this substring — it will be a slide. If the headingmark attribute value is empty, no headings will be mapped to slides, just lt;slides> tag will be used.
Example: ; headingmark: Slide:.
incmark A similar seq for selecting «step-by-step» slides. Step-by-step means that if there are any lists (ordered # or unordered *) on the slide, they will be shown grayed, and with each mouse or Enter key click, the next list item will be highlighted.
centermark This sequence is used to center the slide content without removing the heading.
scaled If this attribute’s value is 1, true or yes (case insensitive), then all slides' content is scaled automatically to fit the screen. Images, including SVG ones, are scaled too, and will always have size «relative» to the font size. This is not the basic S5 ability, but an our feature.
author Slide show author (for the first (title) slide). Can contain Wiki markup.
title Slide show title. Can contain Wiki markup.
subtitle Slide show subtitle (for the title slide). Can contain Wiki markup.
subfooter A string displayed in page footer on each slide. Can contain Wiki markup. Also, the word {{date}} is special inside it — it is replaced with last article edit timestamp.

After adding the slide show definition, you only need to click the skin preview image emerged in the place of the definition in article view. Then, if you’re in Opera, click F11, and if you’re in Firefox or Chrome, the presentation will begin itself.

So, slides are specified as article sections with «headingmark» in their titles. You can also specify slides using <slides> tag. Slides specified like this are shown as «live thumbnails» (html DIVs with scaled content). This mode is considered experimental and should not be used for the whole presentations, as the resulting presentation will be much less readable. You should use it only for generating slides for some «floating illustrations»:

<slides float="right" width="300">
[[File:Image.jpg]]
</slides>

Printing and PDF export

For added interoperability, S5 supports printing and PDF export. Of course all interactive element will be lost on printed page and PDFs — only static content will be printed. «Incremental» lists will be shown in whole; animations and media-features like MindMaps viewed in a Flash applet (see MMHandler) or inserted videos will not be shown at all.

Of course it doesn’t mean printing is useless — so the support is there. Printing instructions:

  • Use Firefox. Also you can use Chrome, but you’ll have neither background images, nor CSS3- and SVG-gradients (OK for printing, but not so good for PDF export).
  • While in slideshow mode, move the mouse into the bottom right screen corner and click the first icon (one with a printer).
  • Enter desired page size in millimeters (by default it’s A4, i.e 297x210 mm), click OK and wait for page to reload.

After the page is reloaded:

  • Select File → Print.
  • Be sure to select the page size identical to entered in previous step, and 100 % scale.
  • Clear header and footer in Firefox print settings, and select «Print Background Colors», «Print Background Images» if you want.
  • Use PDF printer for PDF export. It’s always available on Linux, and on MustDie (Window$) systems it should be installed separately (Ghostscript).
  • Click «print».

Skins

There are 7 different skins available:

custisnobookdefaultblue
preview.png preview.png preview.png preview.png
floweryatilpixel
preview.png preview.png preview.png

Creating your own skins

With the S5SlideShow extension you can easily create your own S5 skins, using only wiki-page editing. S5 skin is simply a file with CSS styles for specific HTML elements. To be correct, there are several CSS’s, but most of the time you need only one «pretty.css» to change how the slide show looks.

CSS styles can be put on Wiki pages with names like MediaWiki:S5/custis/pretty.css, where custis is the skin name (replace with yours), and pretty.css is the CSS stylesheet name. Most of the time you only need to edit pretty.css, but if you’ll need to change other builtin styles — you can also change core.css, base.css and framing.css. Builtin S5 skins can be changed in the same manner — the wiki page content overrides files from the extension distribution.

CSS styles could obviously use some images, and here, all is also simple — if you want to use your own image in the style, just upload it to MediaWiki (using only latin letters, numbers and '.', '-', and '_' characters in file name), and add it your CSS as following: url(filename.png). When S5SlideShow will generate CSS for your skin, this construction will be replaced with a correct path to your image.

After that, passing your skin name as <slide style=""> will work in all presentations.

Example style links — open them despite of they’re red (article does not exist), they’ll show you the default CSS stylesheets of blue skin:

Note.svg You can use custis’s pretty.css as a base for your own skin — just replace the logo :)

You can also upload the preview image for your newly created skin — use filenames like Media:S5-devconf-preview.png (where «devconf» is the skin name). It will be scaled to ~200px automatically.

Remarks

Duality
There are several features that make S5 in combination with MediaWiki a unique technology — firstly, slide shows are created very simply, and secondly, there is no more need to maintain two versions of presentation «with» and «without» remarks — «for slide show» and «for home reading». For «home reading» the normal article view mode can be used, because you can make its part non-mapped to slides. Moreover, such slide shows allow simple collaborative work, version control and other normal Wiki features.
Opera
As it was already mentioned, you need to press F11 to go into slideshow and fullscreen mode in Opera browser. It’s not required in Firefox and Chrome.
Control panel
If you move the mouse cursor over the lower-right corner of the slide show, you can see a simple slide show control panel.
Skin selection
Any slide show can be opened using any available skin without changing its definition — you only need to add &s5skin=NAME to slide show URL (where NAME is the skin name).
WISYWIM
In MediaWiki4Intranet, you can use «live auto-preview» to perform «almost WISYWIM» (What You See Is What You Mean) mode editing. To do so you need to check the «slides» checkbox below the edit area, select desired auto-refresh time (30 seconds by default) and click «Auto-preview» (FIXME checkboxes may be not translated from russian by now). A new browser tab or window will be opened, and you can place it at the right side of edit window or, for example, on the second display. It will contain the slideshow you are editing, and position within it (slide #) will be preserved, and it will refresh each XX seconds (30 by default).
Incremental (step-by-step) display
There are 3 ways to do it.
First: If the slide is marked with «incremental» mark (incmark attribute) all lists — ordered and unordered ones — will be displayed item-by-item.
Second: On any slide, the contents of any element with CSS class="anim" will be shown item-by-item (for example <div class="anim"><div>i.1</div><div>i.2</div></div> and etc).
Third: a single element can be marked with class="incremental" and it will become an «additional step» for display.
Step-by-step «animations»
If you mark some element (most commonly <div>) with class="anim over", then each next subelement with .incremental class will replace the previous one. Usage example: Test presentation.
Link to slide
If you want to make a link to specific slide, add the #slideN anchor to slide show URL. N is slide number, beginning with 0 which is the title slide. Also, our S5 version preserves the position (current slide number) on page reload (F5, Ctrl-R). And this is also our feature :)

Example

Slide show definition example (can be used as a stub for copy-paste):

<slide style="custis" headingmark="Slide:" incmark="(step)" scaled="true">
;author: Presentation Author
;title: Multithreading in Java (beginning)
;subtitle: Multithreading in Java (beginning)
;subfooter: {{date}}
</slide>

Installation

Please note that PHP DOM extension is required for S5SlideShow to work.

Installation is very simple. All you need is to get the code into /extensions/S5SlideShow subdirectory (you can’t use other path as it’s hardcoded by now) and add a line to LocalSettings.php:

require_once "$IP/extensions/S5SlideShow/S5SlideShow.php";

Also you can specify some configuration, but this is not required:

// headingmark attribute default value (false = turn nothing into slides, "" = turn all sections into slides)
$egS5SlideHeadingMark = false;
// incmark attribute default value
$egS5SlideIncMark = '\(step\)';
 
//Default Style for presentations. Useful for not redefining 'default' style but change all presentations by default to some "corporate" style.
$egDefaultStyle = 'default';

Changes

  • 2015-10-10: Subsections are no more included in slides. If anybody needs the old behaviour — please fill an issue on github.
  • 2015-10-03: Added support for MediaWiki 1.25.
  • 2014-05-28: Added the ability to turn all page sections into slides, enabled by headingmark equal to an empty string.
  • 2013-11-06: Fixed <tt>class="anim over"</tt>, i.e. — now slides with animations are scaled correctly, and only the last animation item is shown in print and normal article modes.
  • 2013-09-30: Added display of slideshow tag field values in a definition list.
  • 2013-05-21: Added printing and PDF export ability (for auto-scaled presentations).
  • 2013-05-15: Fixed SVG scaling on initially opened slide in Chrome.
  • 2013-05-15: Automatic slide content scaling now honors content width overflow (previously it scaled slides only based on its content height).
  • 2013-05-07: Committed 'nobook' style.
  • 2012-08-08: Added a check for PHP DOM extension and DOM MediaWiki preprocessor — they are required for this extension to work.
  • 2012-01-19: Smooth slide transitions using CSS3 animations.
  • 2011-11-01: Removed all warnings under E_STRICT. Removed register_globals vulnerabilities. Allow centered slides with titles (centermark).
  • 2011-09-19: Parser hack for better image quality in presentations ($egS5BrowserScaleHack). Images inserted with a specified width will be scaled by browser instead of MediaWiki software.
  • 2011-09-12: Fix SVG scaling errors.
  • 2011-06-17: Allow custom style previews to be stored as uploaded files.
  • 2011-06-15: «noslide» and «slideonly» CSS classes to allow hiding/showing certain elements.
  • 2011-06-10: Fix non-working «incmark» error.
  • 2011-06-06: Follow redirects in presentation mode.
  • 2011-05-29: Refactoring — totally new article parsing method, <slide> is renamed to <slideshow>, much better content scaler (+images +SVG +CSS3), always scales content relatively to the text. Also new optional experimental method for specifying slides — <slides> tag, allows «live thumbnails» mode when viewing article. «pagebreak» option is removed.
  • 2011-05-10: Allow to create own skins using Wiki pages.

Open issue(s)

  • FIXME remove hardcode extensions/S5SlideShow/
  • TODO cache generated stylesheets and flush the cache after saving style articles
  • TODO remove support for loading text from session object and replace it by support for save-staying-in-edit-mode extension