| 1 |
.. include:: <s5defs.txt> |
| 2 |
|
| 3 |
================================= |
| 4 |
Easy Slide Shows With reST & S5 |
| 5 |
================================= |
| 6 |
|
| 7 |
:Authors: David Goodger & Chris Liechti |
| 8 |
:Date: $Date: 2024-12-04 14:32:20 +0100 (Mi, 04. Dez 2024) $ |
| 9 |
|
| 10 |
.. This document has been placed in the public domain. |
| 11 |
|
| 12 |
.. container:: handout |
| 13 |
|
| 14 |
How to create quick, good-looking presentation slide shows with |
| 15 |
Docutils_/reStructuredText_ and S5_. |
| 16 |
|
| 17 |
This document serves both as a user manual and as a usage example |
| 18 |
of the s5_html.py writer and the ``rst2s5`` front end. |
| 19 |
|
| 20 |
To view this document as a slide show see |
| 21 |
https://docutils.sourceforge.io/docs/user/slide-shows.s5.html or `your |
| 22 |
local copy <slide-shows.s5.html>`__. |
| 23 |
|
| 24 |
.. contents:: |
| 25 |
:class: handout |
| 26 |
|
| 27 |
.. class:: tiny |
| 28 |
|
| 29 |
* S5 themes are designed for full-screen display areas with a 4:3 |
| 30 |
aspect ratio. If the slide text doesn't fit in your browser window, |
| 31 |
try decreasing the text size. |
| 32 |
|
| 33 |
* Use the space bar to advance, Page Up/Down & arrow keys to navigate. |
| 34 |
|
| 35 |
* Best viewed in Firefox_, Safari, and Konqueror. Click the "|mode|" |
| 36 |
button to switch between presentation & handout/outline modes. Hit |
| 37 |
the "C" key to display the navigation controls, or mouse over the |
| 38 |
lower right-hand corner. |
| 39 |
|
| 40 |
* Functionality is limited in Opera. Switch to full-screen mode (F11 |
| 41 |
key) to activate Opera Show. |
| 42 |
|
| 43 |
* S5 works in Internet Explorer, but it may look ugly. |
| 44 |
|
| 45 |
.. container:: handout |
| 46 |
|
| 47 |
The first slide of a presentation consists of all visible text up |
| 48 |
to the first section title. The document title is also added to |
| 49 |
the footer of all slides. |
| 50 |
|
| 51 |
The "footer" directive is used to specify part of the slide footer |
| 52 |
text. It is currently limited to one short line (one paragraph). |
| 53 |
|
| 54 |
There is no support for the "header" directive in the themes |
| 55 |
included with Docutils. |
| 56 |
|
| 57 |
.. _Docutils: https://docutils.sourceforge.io/ |
| 58 |
.. _reStructuredText: https://docutils.sourceforge.io/rst.html |
| 59 |
.. _S5: http://meyerweb.com/eric/tools/s5/ |
| 60 |
.. _Firefox: http://www.mozilla.com/firefox/ |
| 61 |
.. |bullet| unicode:: U+02022 |
| 62 |
.. |mode| unicode:: U+00D8 .. capital o with stroke |
| 63 |
|
| 64 |
.. footer:: Location |bullet| Date |
| 65 |
|
| 66 |
|
| 67 |
Introduction |
| 68 |
============ |
| 69 |
|
| 70 |
.. class:: handout |
| 71 |
|
| 72 |
rst2s5_ is a Docutils_ front end that outputs HTML for use |
| 73 |
with S5_, a "Simple Standards-based Slide Show System" by Eric |
| 74 |
Meyer. |
| 75 |
|
| 76 |
.. topic:: Installation |
| 77 |
:class: handout |
| 78 |
|
| 79 |
Prerequisites: Python and the Docutils_ package have to be |
| 80 |
installed. See the `Docutils README`__ file for installation |
| 81 |
instructions. |
| 82 |
|
| 83 |
__ https://docutils.sourceforge.io/README.html |
| 84 |
|
| 85 |
* reStructuredText |
| 86 |
|
| 87 |
.. class:: handout |
| 88 |
|
| 89 |
Uses normal reStructuredText as input. |
| 90 |
|
| 91 |
* One section per slide |
| 92 |
|
| 93 |
.. class:: handout |
| 94 |
|
| 95 |
Each first-level section is converted into a single slide. |
| 96 |
|
| 97 |
* XHTML output |
| 98 |
|
| 99 |
.. container:: handout |
| 100 |
|
| 101 |
Presentations can be viewed using most modern graphical web |
| 102 |
browsers. The browser must support CSS, JavaScript, and XHTML. |
| 103 |
S5 even works with IE! |
| 104 |
|
| 105 |
S5 was designed to add the functionality of the `Opera Show`_ |
| 106 |
standard (without Opera Show's limitations) to non-Opera |
| 107 |
browsers. Unfortunately, most of S5's CSS and JavaScript |
| 108 |
extensions don't function in the Opera browser. |
| 109 |
|
| 110 |
.. _Opera Show: http://www.opera.com/support/tutorials/operashow/ |
| 111 |
|
| 112 |
* Themes |
| 113 |
|
| 114 |
.. class:: handout |
| 115 |
|
| 116 |
A variety of themes are available. See `Example Themes`_, below. |
| 117 |
|
| 118 |
* rst2s5_ |
| 119 |
|
| 120 |
.. class:: handout |
| 121 |
|
| 122 |
The console script to generate S5 slide shows. |
| 123 |
|
| 124 |
.. _rst2s5: tools.html#rst2s5 |
| 125 |
|
| 126 |
.. topic:: Keyboard Controls |
| 127 |
:class: handout |
| 128 |
|
| 129 |
The following apply in any supporting browser besides Opera, which |
| 130 |
uses the default Opera Show controls instead. |
| 131 |
|
| 132 |
.. list-table:: |
| 133 |
:header-rows: 1 |
| 134 |
|
| 135 |
* - Action |
| 136 |
- Key(s) |
| 137 |
* - Go to the next slide |
| 138 |
- * [Space bar] |
| 139 |
* [Return] |
| 140 |
* [Enter] |
| 141 |
* [Right arrow] |
| 142 |
* [Down arrow] |
| 143 |
* [Page down] |
| 144 |
* Click the left mouse button outside of the control area, |
| 145 |
Flash object, or movie |
| 146 |
* - Go to the previous slide |
| 147 |
- * [Left arrow] |
| 148 |
* [Up arrow] |
| 149 |
* [Page up] |
| 150 |
* - Go to the title (first) slide |
| 151 |
- [Home] |
| 152 |
* - Go to the last slide |
| 153 |
- [End] |
| 154 |
* - Jump directly to a slide |
| 155 |
- Type the slide number, then hit [Return] or [Enter] |
| 156 |
* - Skip forward *n* slides |
| 157 |
- Type the number of slides to skip, then hit any "go to next" |
| 158 |
key (except [Return] or [Enter]) |
| 159 |
* - Skip backward *n* slides |
| 160 |
- Type the number of slides to skip, then hit any "go to |
| 161 |
previous" key |
| 162 |
* - Switch between slideshow and outline view |
| 163 |
- * [T] |
| 164 |
* Click the |mode| button |
| 165 |
* - Show/hide slide controls |
| 166 |
- * [C] |
| 167 |
* Move the mouse pointer over the control area |
| 168 |
|
| 169 |
Further details of the S5 user interface can be found at `Eric |
| 170 |
Meyer's S5 page`__. |
| 171 |
|
| 172 |
__ S5_ |
| 173 |
|
| 174 |
|
| 175 |
Features (1) |
| 176 |
============ |
| 177 |
|
| 178 |
.. container:: handout |
| 179 |
|
| 180 |
The S5/HTML Writer supports all the standard Docutils HTML |
| 181 |
features. S5 has been released to the Public Domain. |
| 182 |
|
| 183 |
S5-specific features: |
| 184 |
|
| 185 |
.. class:: incremental |
| 186 |
|
| 187 |
* The document title is duplicated on each slide in the S5 footer. |
| 188 |
|
| 189 |
* The ``footer`` directive may be used to define additional text in |
| 190 |
the S5 footer. |
| 191 |
|
| 192 |
.. container:: handout |
| 193 |
|
| 194 |
But it is limited to one line of text. |
| 195 |
|
| 196 |
This is useful for information such as the date of the |
| 197 |
presentation and/or the location. The field in the footer is |
| 198 |
left blank if no ``footer`` directive is used. |
| 199 |
|
| 200 |
Example:: |
| 201 |
|
| 202 |
.. footer:: Location - Date |
| 203 |
|
| 204 |
There is also a progress indicator (slide counter) in the footer |
| 205 |
that can be enabled. It's disabled by default. |
| 206 |
|
| 207 |
* Incremental display. |
| 208 |
|
| 209 |
.. class:: handout |
| 210 |
|
| 211 |
An "incremental" class can be assigned to lists and other elements |
| 212 |
to get one-item-at-a-time behavior (like this list). Incremental |
| 213 |
display does not work in the Opera browser. |
| 214 |
|
| 215 |
* Text auto-scaling. |
| 216 |
|
| 217 |
.. class:: handout |
| 218 |
|
| 219 |
The text size adjusts relative to the size of your browser window |
| 220 |
automatically. You may need to reload the document after resizing |
| 221 |
the window. The browser and platform affect the font used; be sure |
| 222 |
to test the slide show on the presentation system. |
| 223 |
|
| 224 |
|
| 225 |
Features (2): Handouts |
| 226 |
====================== |
| 227 |
|
| 228 |
.. container:: handout |
| 229 |
|
| 230 |
The contents of any element with a "class" attribute value of |
| 231 |
"handout" are hidden in the slide presentation, and are only |
| 232 |
visible when the presentation is printed, or viewed in outline |
| 233 |
mode. "Handout"-class elements can appear anywhere in the text, as |
| 234 |
often as needed. |
| 235 |
|
| 236 |
This means that the slides and extra handout material can be |
| 237 |
combined in one document. The handout can be printed directly from |
| 238 |
the browser, and it will contain more than just silly framed |
| 239 |
slides. This can be used to provide more detailed information, or |
| 240 |
for speaker's notes. |
| 241 |
|
| 242 |
.. class:: incremental |
| 243 |
|
| 244 |
* Use the "class" directive:: |
| 245 |
|
| 246 |
.. class:: handout |
| 247 |
|
| 248 |
.. container:: handout |
| 249 |
|
| 250 |
The ``.. class:: handout`` directive can be used to tag |
| 251 |
individual paragraphs and other elements. The "class" directive |
| 252 |
applies to the first element immediately following:: |
| 253 |
|
| 254 |
.. class:: handout |
| 255 |
|
| 256 |
This paragraph will get a |
| 257 |
``class="handout"`` attribute. |
| 258 |
|
| 259 |
This paragraph will not be affected. |
| 260 |
|
| 261 |
It also applies to multiple elements in the directive content:: |
| 262 |
|
| 263 |
.. class:: handout |
| 264 |
|
| 265 |
These paragraphs are the content |
| 266 |
of the "class" directive. And as such... |
| 267 |
|
| 268 |
Both paragraphs will *individually* receive |
| 269 |
``class="handout"`` attributes. |
| 270 |
|
| 271 |
* Use the "container" directive:: |
| 272 |
|
| 273 |
.. container:: handout |
| 274 |
|
| 275 |
.. container:: handout |
| 276 |
|
| 277 |
Arbitrary handout blocks can be created using the ``container`` |
| 278 |
directive. The content is treated as one. |
| 279 |
|
| 280 |
* Use the "class" option of directives that support it:: |
| 281 |
|
| 282 |
.. topic:: Extra Material For Handouts |
| 283 |
:class: handout |
| 284 |
|
| 285 |
.. container:: handout |
| 286 |
|
| 287 |
The following directives support "class" options: |
| 288 |
|
| 289 |
* all admonition directives ("admonition", "note", "hint", etc.) |
| 290 |
* "image" & "figure" |
| 291 |
* "topic" |
| 292 |
* "sidebar" |
| 293 |
* "line-block" |
| 294 |
* "parsed-literal" |
| 295 |
* "rubric" |
| 296 |
* "compound" |
| 297 |
* "table", "csv-table", & "list-table" |
| 298 |
* "target-notes" (more about that below) |
| 299 |
* "role" (pre-defined; more below) |
| 300 |
|
| 301 |
Handout contents are also visible on the screen if the S5 view mode |
| 302 |
is toggled from "slide show" to "outline" mode. |
| 303 |
|
| 304 |
|
| 305 |
Caveats |
| 306 |
======= |
| 307 |
|
| 308 |
.. class:: incremental |
| 309 |
|
| 310 |
1. Some Docutils features are not supported by some themes. |
| 311 |
|
| 312 |
.. container:: handout |
| 313 |
|
| 314 |
For example, header rendering is not supported by the themes |
| 315 |
supplied with Docutils. |
| 316 |
|
| 317 |
The "header" directive is used to set header text. S5 |
| 318 |
automatically inserts section/slide titles into the "header" |
| 319 |
area of a slide. If both Docutils headers and S5 headers (slide |
| 320 |
titles) exist simultaneously, they interfere with each other. |
| 321 |
|
| 322 |
2. Care must be taken with the "contents" directive. |
| 323 |
|
| 324 |
.. container:: handout |
| 325 |
|
| 326 |
The ``--no-toc-backlinks`` option is the default for the S5/HTML |
| 327 |
writer (``toc_backlinks=False`` setting). Other values for this |
| 328 |
setting will change the CSS class of headings such that they |
| 329 |
won't show up correctly in the slide show. |
| 330 |
|
| 331 |
Use the ``:class: handout`` option on the "contents" directive |
| 332 |
to limit the table of contents to the handout/outline mode |
| 333 |
only:: |
| 334 |
|
| 335 |
.. contents:: |
| 336 |
:class: handout |
| 337 |
|
| 338 |
|
| 339 |
.. class:: incremental |
| 340 |
|
| 341 |
3. Subsections ... |
| 342 |
------------------ |
| 343 |
|
| 344 |
... may be used, sparingly. |
| 345 |
|
| 346 |
.. container:: handout |
| 347 |
|
| 348 |
Only first-level sections become slides. Not many levels of |
| 349 |
subsections can fit on a slide. |
| 350 |
|
| 351 |
Subsections (of any level) work normally in handouts though. Add |
| 352 |
"``.. class:: handout``" before a subsection (or sub-subsection, or |
| 353 |
...), and the entire subsection will only appear in the handout. |
| 354 |
|
| 355 |
|
| 356 |
Generating a Slide Show (1) |
| 357 |
=========================== |
| 358 |
|
| 359 |
.. class:: incremental |
| 360 |
|
| 361 |
1. Open a console (terminal, command shell) and go to the folder |
| 362 |
containing your file, ``slides.rst``. |
| 363 |
|
| 364 |
2. Run the command:: |
| 365 |
|
| 366 |
rst2s5 slides.rst --output=slides.html |
| 367 |
|
| 368 |
3. Optionally, specify an S5 theme with the ``--theme`` option. |
| 369 |
|
| 370 |
.. class:: handout |
| 371 |
|
| 372 |
Docutils will copy the S5 theme files into a ``ui/<theme>`` folder |
| 373 |
beside the output HTML file. [#copy-theme]_ A slide show can also link |
| 374 |
to an existing theme using the ``--theme-url`` option. |
| 375 |
|
| 376 |
.. [#copy-theme] Theme files can only be copied by Docutils, if the |
| 377 |
`output path`_ is specified. |
| 378 |
|
| 379 |
.. _output path: config.html#output-path |
| 380 |
|
| 381 |
|
| 382 |
Generating a Slide Show (2) |
| 383 |
=========================== |
| 384 |
|
| 385 |
.. class:: incremental |
| 386 |
|
| 387 |
4. Include a copy of any linked stylesheet. |
| 388 |
|
| 389 |
.. class:: handout |
| 390 |
|
| 391 |
The default Docutils stylesheet, ``html4css1.css``, will normally |
| 392 |
be embedded in the output HTML. If you choose to link to a |
| 393 |
stylesheet instead of embedding, you must include a copy (suggested |
| 394 |
location: in the ``ui/`` directory). |
| 395 |
|
| 396 |
5. Open ``slides.html`` in a web browser. |
| 397 |
|
| 398 |
6. Expand the browser window to full-screen mode, and speak. |
| 399 |
|
| 400 |
.. class:: handout |
| 401 |
|
| 402 |
The `Web Developer`__ extension for Firefox is very useful. With |
| 403 |
it, you can resize your browser window to the exact dimensions of |
| 404 |
the projector you'll be using, so you can test beforehand. There |
| 405 |
are many other useful features as well. |
| 406 |
|
| 407 |
__ http://chrispederick.com/work/webdeveloper/ |
| 408 |
|
| 409 |
7. Profit! |
| 410 |
|
| 411 |
|
| 412 |
Examples (1) |
| 413 |
============ |
| 414 |
|
| 415 |
.. sidebar:: Hint |
| 416 |
|
| 417 |
Admonitions, tables, sidebars, and other elements can be used in |
| 418 |
on-screen presentations in handouts. Images too! |
| 419 |
|
| 420 |
.. image:: images/happy_monkey.png |
| 421 |
:alt: sample image |
| 422 |
|
| 423 |
===== ===== ====== |
| 424 |
A B A or B |
| 425 |
===== ===== ====== |
| 426 |
False False False |
| 427 |
True False True |
| 428 |
False True True |
| 429 |
True True True |
| 430 |
===== ===== ====== |
| 431 |
|
| 432 |
|
| 433 |
Examples (2): Incremental Text |
| 434 |
============================== |
| 435 |
|
| 436 |
.. class:: incremental |
| 437 |
|
| 438 |
Paragraphs can be displayed one at a time... |
| 439 |
|
| 440 |
.. container:: |
| 441 |
|
| 442 |
... or a bunch at a time. |
| 443 |
|
| 444 |
This second paragraph is displayed together with the previous |
| 445 |
one by grouping them with the "container" directive. |
| 446 |
|
| 447 |
`We can also display` `one` `word` `at` `a` `time,` |
| 448 |
`or a phrase` `at a time,` |
| 449 |
`or even` `o`\ `n`\ `e` `l`\ `e`\ `t`\ `t`\ `e`\ `r` `at a time!` |
| 450 |
|
| 451 |
`(But the markup ain't pretty.)` |
| 452 |
|
| 453 |
|
| 454 |
Examples (3): Incr. Graphics |
| 455 |
============================ |
| 456 |
|
| 457 |
Let's play... Rock, Scissors, Paper |
| 458 |
|
| 459 |
.. container:: animation |
| 460 |
|
| 461 |
.. image:: images/rsp-empty.png |
| 462 |
:class: hidden slide-display |
| 463 |
|
| 464 |
.. class:: incremental hidden slide-display |
| 465 |
|
| 466 |
.. image:: images/rsp-objects.png |
| 467 |
.. image:: images/rsp-cuts.png |
| 468 |
.. image:: images/rsp-covers.png |
| 469 |
.. image:: images/rsp-breaks.png |
| 470 |
|
| 471 |
.. image:: images/rsp-all.png |
| 472 |
:class: incremental |
| 473 |
|
| 474 |
|
| 475 |
Themes |
| 476 |
====== |
| 477 |
|
| 478 |
.. class:: incremental |
| 479 |
|
| 480 |
* Several themes are available, and they're easy to adapt. |
| 481 |
|
| 482 |
.. container:: handout |
| 483 |
|
| 484 |
Sites with other S5 themes: |
| 485 |
|
| 486 |
* http://meyerweb.com/eric/tools/s5/themes/ |
| 487 |
* http://mozilla.wikicities.com/wiki/Firefox_S5:Designs |
| 488 |
* http://lachy.id.au/dev/mozilla/firefox/s5/ |
| 489 |
* http://www.openlight.com/Python-S5-Theme.tar.gz |
| 490 |
|
| 491 |
Do a web search for "S5 theme" and you're bound to find plenty |
| 492 |
of choices. |
| 493 |
|
| 494 |
* "``--theme``" option. |
| 495 |
|
| 496 |
.. container:: handout |
| 497 |
|
| 498 |
The theme can be specified with the "``--theme``" command-line |
| 499 |
option. |
| 500 |
|
| 501 |
Example:: |
| 502 |
|
| 503 |
rst2s5 --theme big-black slides.rst slides.html |
| 504 |
|
| 505 |
The default theme is "default". |
| 506 |
|
| 507 |
* "``theme``" setting. |
| 508 |
|
| 509 |
.. class:: handout |
| 510 |
|
| 511 |
You can set the theme with the "``theme``" configuration file |
| 512 |
setting. |
| 513 |
|
| 514 |
* Copied to ``./ui/<theme>/``. |
| 515 |
|
| 516 |
.. class:: handout |
| 517 |
|
| 518 |
Themes are copied into a ``ui/<theme>`` folder inside the folder |
| 519 |
containing the presentation. |
| 520 |
|
| 521 |
* Link with "``--theme-url``" option. |
| 522 |
|
| 523 |
.. class:: handout |
| 524 |
|
| 525 |
Link to a theme on the same or another web site, using the |
| 526 |
"``--theme-url``" option or "``theme_url``" configuration file |
| 527 |
setting. |
| 528 |
|
| 529 |
|
| 530 |
Example Themes |
| 531 |
============== |
| 532 |
|
| 533 |
.. class:: handout |
| 534 |
|
| 535 |
The default theme, "default", is a simplified version of S5's |
| 536 |
default theme. It accommodates up to 13 lines of text. |
| 537 |
|
| 538 |
.. class:: center |
| 539 |
|
| 540 |
"default" |
| 541 |
|
| 542 |
.. image:: images/default.png |
| 543 |
:align: center |
| 544 |
|
| 545 |
|
| 546 |
Example Themes: Small Text |
| 547 |
========================== |
| 548 |
|
| 549 |
.. class:: handout |
| 550 |
|
| 551 |
The "small-white" and "small-black" themes are simplifications of |
| 552 |
the default theme (**small** black text on a **white** background, |
| 553 |
and **small** black text on a **white** background, respectively). |
| 554 |
They each accommodate up to 15 lines of text. |
| 555 |
|
| 556 |
.. list-table:: |
| 557 |
:class: borderless |
| 558 |
|
| 559 |
* - "small-white" |
| 560 |
|
| 561 |
.. image:: images/small-white.png |
| 562 |
|
| 563 |
- "small-black" |
| 564 |
|
| 565 |
.. image:: images/small-black.png |
| 566 |
|
| 567 |
|
| 568 |
Example Themes: Large Text |
| 569 |
========================== |
| 570 |
|
| 571 |
.. class:: handout |
| 572 |
|
| 573 |
The "big-white" and "big-black" themes feature very large, bold |
| 574 |
text, with no footers. Only five short lines fit in a slide. |
| 575 |
|
| 576 |
.. list-table:: |
| 577 |
:class: borderless |
| 578 |
|
| 579 |
* - "big-white" |
| 580 |
|
| 581 |
.. image:: images/big-white.png |
| 582 |
|
| 583 |
- "big-black" |
| 584 |
|
| 585 |
.. image:: images/big-black.png |
| 586 |
|
| 587 |
|
| 588 |
Example Themes: Medium Text |
| 589 |
=========================== |
| 590 |
|
| 591 |
.. class:: handout |
| 592 |
|
| 593 |
The "medium-white" and "medium-black" themes feature medium-sized |
| 594 |
text. Up to 8 lines of text are accommodated. |
| 595 |
|
| 596 |
.. list-table:: |
| 597 |
:class: borderless |
| 598 |
|
| 599 |
* - "medium-white" |
| 600 |
|
| 601 |
.. image:: images/medium-white.png |
| 602 |
|
| 603 |
- "medium-black" |
| 604 |
|
| 605 |
.. image:: images/medium-black.png |
| 606 |
|
| 607 |
|
| 608 |
S5 Theme Files |
| 609 |
============== |
| 610 |
|
| 611 |
An S5 theme consists of a directory containing several files -- |
| 612 |
stylesheets, JavaScript, and graphics: |
| 613 |
|
| 614 |
.. image:: images/s5-files.png |
| 615 |
:align: center |
| 616 |
|
| 617 |
.. container:: handout |
| 618 |
|
| 619 |
The generated HTML contains the entire slide show text. It also |
| 620 |
contains links to the following files: |
| 621 |
|
| 622 |
* slides.css simply contains import links to: |
| 623 |
|
| 624 |
- s5-core.css: Default styles critical to the proper functioning |
| 625 |
of the slide show; don't touch this! |
| 626 |
|
| 627 |
- framing.css: Sets the basic layout of slide components (header, |
| 628 |
footer, controls, etc. This file is the often edited. |
| 629 |
|
| 630 |
- pretty.css: Presentation styles that give the slide show a |
| 631 |
unique look and feel. This is the file that you're most likely |
| 632 |
to edit for a custom theme. You can make a whole new theme |
| 633 |
just by editing this file, and not touching the others. |
| 634 |
|
| 635 |
* outline.css: Styles for outline mode. |
| 636 |
|
| 637 |
* print.css: Styles for printing; hides most layout elements, and |
| 638 |
may display others. |
| 639 |
|
| 640 |
* opera.css: Styles necessary for the proper functioning of S5 in |
| 641 |
Opera Show. |
| 642 |
|
| 643 |
* slides.js: the JavaScript that drives the dynamic side of the |
| 644 |
slide show (actions and navigation controls). It automatically |
| 645 |
IDs the slides when the document loads, builds the navigation |
| 646 |
menu, handles the hiding and showing of slides, and so on. The |
| 647 |
code also manages the fallback to Opera Show if you're using |
| 648 |
the Opera web browser. |
| 649 |
|
| 650 |
|
| 651 |
Making a Custom Theme |
| 652 |
===================== |
| 653 |
|
| 654 |
.. class:: incremental |
| 655 |
|
| 656 |
1. Run "``rst2s5 --theme <base-theme> <doc>.rst <doc>.html``". |
| 657 |
|
| 658 |
.. class:: handout |
| 659 |
|
| 660 |
This initializes the ``ui`` directory with the base theme files. |
| 661 |
|
| 662 |
2. Copy ``ui/<base-theme>`` to ``ui/<new-theme>``. |
| 663 |
|
| 664 |
3. Edit the styles (save in UTF-8 encoding). |
| 665 |
|
| 666 |
.. class:: handout |
| 667 |
|
| 668 |
Start with ``pretty.css``; edit ``framing.css`` if you need to make |
| 669 |
layout changes. |
| 670 |
|
| 671 |
4. Run "``rst2s5 --theme-url ui/<new-theme> <doc>.rst <doc>.html``". |
| 672 |
|
| 673 |
.. class:: handout |
| 674 |
|
| 675 |
We use the ``--theme-url`` option to refer to the new theme. Open |
| 676 |
your ``<doc>.html`` in a browser to test the new theme. |
| 677 |
|
| 678 |
5. Rinse & repeat. |
| 679 |
|
| 680 |
.. class:: handout |
| 681 |
|
| 682 |
Repeat from step 3 until you're satisfied. |
| 683 |
|
| 684 |
.. TODO: What to do next: |
| 685 |
|
| 686 |
* add a ``__base__`` file |
| 687 |
* create a personal reusable theme (plugin) |
| 688 |
* submit the new theme to Docutils |
| 689 |
|
| 690 |
``docutils/writers/s5_html/themes/<theme>`` |
| 691 |
|
| 692 |
.. container:: handout |
| 693 |
|
| 694 |
Resources: |
| 695 |
|
| 696 |
* W3C's `Learning CSS <https://www.w3.org/Style/CSS/learning>`__ |
| 697 |
|
| 698 |
* `Creating An S5 Theme <http://home.cogeco.ca/~ve3ll/s5themes.htm>`__ |
| 699 |
|
| 700 |
* A short tutorial on how to create themes (in German): |
| 701 |
`Eigenes Theme erstellen <http://yatil.de/s5/dokumentation/9/>`__ |
| 702 |
|
| 703 |
|
| 704 |
Classes: Incremental (1) |
| 705 |
======================== |
| 706 |
|
| 707 |
.. class:: handout |
| 708 |
|
| 709 |
Several "class" attribute values have built-in support in the |
| 710 |
themes supplied with Docutils. |
| 711 |
|
| 712 |
.. class:: incremental |
| 713 |
|
| 714 |
As described earlier, |
| 715 |
|
| 716 |
* ``.. class:: incremental`` |
| 717 |
|
| 718 |
* ``.. container:: incremental`` |
| 719 |
|
| 720 |
* :: |
| 721 |
|
| 722 |
.. sidebar:: title |
| 723 |
:class: incremental |
| 724 |
|
| 725 |
|
| 726 |
Classes: Incremental (2) |
| 727 |
======================== |
| 728 |
|
| 729 |
The "incremental" interpreted text role is also supported: |
| 730 |
|
| 731 |
.. class:: incremental |
| 732 |
|
| 733 |
:: |
| 734 |
|
| 735 |
:incremental:`This will appear first,` `and |
| 736 |
this will appear second.`:incremental: |
| 737 |
|
| 738 |
Requires "``.. include:: <s5defs.txt>``". |
| 739 |
|
| 740 |
.. container:: handout |
| 741 |
|
| 742 |
As you can see, this markup is not very convenient. |
| 743 |
|
| 744 |
.. class:: incremental |
| 745 |
|
| 746 |
| But ``s5defs.txt`` includes this useful definition: |
| 747 |
| "``.. default-role:: incremental``". So: |
| 748 |
|
| 749 |
:: |
| 750 |
|
| 751 |
`This` `is` `all` `we` `need` |
| 752 |
|
| 753 |
`This` `is` `all` `we` `need` `to mark up incremental text.` |
| 754 |
|
| 755 |
|
| 756 |
Classes: Incremental (3) |
| 757 |
======================== |
| 758 |
|
| 759 |
.. class:: small |
| 760 |
|
| 761 |
:: |
| 762 |
|
| 763 |
.. container:: animation |
| 764 |
|
| 765 |
.. image:: images/empty.png |
| 766 |
:class: hidden slide-display |
| 767 |
|
| 768 |
.. class:: incremental hidden slide-display |
| 769 |
|
| 770 |
.. image:: images/1.png |
| 771 |
.. image:: images/2.png |
| 772 |
|
| 773 |
.. image:: images/3.png |
| 774 |
:class: incremental |
| 775 |
|
| 776 |
.. container:: handout |
| 777 |
|
| 778 |
This is how the example works. |
| 779 |
|
| 780 |
The animation effects are caused by placing successive images at |
| 781 |
the same location, laying each image over the last. For best |
| 782 |
results, all images should be the same size, and the positions of |
| 783 |
image elements should be consistent. Use image transparency (alpha |
| 784 |
channels) to get overlay effects. |
| 785 |
|
| 786 |
Absolute positioning is used, which means that the images take up |
| 787 |
no space in the flow. If you want text to follow the images, you |
| 788 |
have to specify the total size of the container via a style. |
| 789 |
Otherwise, the images and any following text will overlap. |
| 790 |
|
| 791 |
These class values do the work: |
| 792 |
|
| 793 |
animation |
| 794 |
This wraps the container with styles that position the images |
| 795 |
absolutely, overlaying them over each other. Only useful on a |
| 796 |
container. |
| 797 |
|
| 798 |
hidden |
| 799 |
Unless overridden (by "slide-display", for example), these |
| 800 |
elements will not be displayed. Only the last image will be |
| 801 |
displayed in handout mode, when print, or when processed to |
| 802 |
ordinary HTML, because it does *not* carry a "hidden" class. |
| 803 |
|
| 804 |
slide-display |
| 805 |
In conjunction with "hidden", these elements will only appear |
| 806 |
on the slide, preventing clutter in the handout. |
| 807 |
|
| 808 |
incremental |
| 809 |
The second and subsequent images will appear one at a time. |
| 810 |
The first image will already be present when the slide is |
| 811 |
displayed, because it does *not* carry an "incremental" class. |
| 812 |
|
| 813 |
|
| 814 |
Classes: Text Size |
| 815 |
================== |
| 816 |
|
| 817 |
.. class:: incremental |
| 818 |
|
| 819 |
* :tiny:`tiny` (class & role name: "tiny", e.g. "``:tiny:`text```") |
| 820 |
* :small:`small` ("small") |
| 821 |
* normal (unstyled) |
| 822 |
* :big:`big` ("big") |
| 823 |
* :huge:`huge` ("huge") |
| 824 |
|
| 825 |
Requires "``.. include:: <s5defs.txt>``". |
| 826 |
|
| 827 |
|
| 828 |
Classes: Alignment |
| 829 |
================== |
| 830 |
|
| 831 |
.. class:: incremental |
| 832 |
|
| 833 |
.. class:: left |
| 834 |
|
| 835 |
Left (class name: "left") |
| 836 |
|
| 837 |
.. class:: center |
| 838 |
|
| 839 |
Center ("center" & "centre") |
| 840 |
|
| 841 |
.. class:: right |
| 842 |
|
| 843 |
Right ("right") |
| 844 |
|
| 845 |
.. class:: handout |
| 846 |
|
| 847 |
These classes apply to block-level elements only. They cannot be |
| 848 |
used for inline text (i.e., they're not interpreted text roles). |
| 849 |
|
| 850 |
.. class:: incremental |
| 851 |
|
| 852 |
Example:: |
| 853 |
|
| 854 |
.. class:: center |
| 855 |
|
| 856 |
Text to be centered. |
| 857 |
|
| 858 |
|
| 859 |
Classes: Text Colours |
| 860 |
===================== |
| 861 |
|
| 862 |
:black:`black` [black], :gray:`gray`, :silver:`silver`, :white:`white` |
| 863 |
[white], :maroon:`maroon`, :red:`red`, :magenta:`magenta`, |
| 864 |
:fuchsia:`fuchsia`, :pink:`pink`, :orange:`orange`, :yellow:`yellow`, |
| 865 |
:lime:`lime`, :green:`green`, :olive:`olive`, :teal:`teal`, |
| 866 |
:cyan:`cyan`, :aqua:`aqua`, :blue:`blue`, :navy:`navy`, |
| 867 |
:purple:`purple` |
| 868 |
|
| 869 |
The class names and role names are the same as the colour names. For |
| 870 |
example, "``:orange:`text```" produces ":orange:`text`". |
| 871 |
|
| 872 |
.. class:: incremental |
| 873 |
|
| 874 |
Requires "``.. include:: <s5defs.txt>``". |
| 875 |
|
| 876 |
|
| 877 |
Classes: Borderless Tables |
| 878 |
========================== |
| 879 |
|
| 880 |
.. class:: handout |
| 881 |
|
| 882 |
Here's an ordinary, unstyled table: |
| 883 |
|
| 884 |
.. class:: incremental |
| 885 |
|
| 886 |
========= ======= |
| 887 |
Sometimes borders |
| 888 |
--------- ------- |
| 889 |
are useful. |
| 890 |
========= ======= |
| 891 |
|
| 892 |
And after applying "``.. class:: borderless``": |
| 893 |
|
| 894 |
.. class:: borderless |
| 895 |
|
| 896 |
======= ========== ======= |
| 897 |
But sometimes, borders |
| 898 |
------- ---------- ------- |
| 899 |
are **not** wanted. |
| 900 |
======= ========== ======= |
| 901 |
|
| 902 |
|
| 903 |
Classes: Print-Only |
| 904 |
=================== |
| 905 |
|
| 906 |
.. class:: handout |
| 907 |
|
| 908 |
Elements with ``class="print"`` attributes display their contents |
| 909 |
when printed, overriding ``class="hidden"``. |
| 910 |
|
| 911 |
.. class:: incremental |
| 912 |
|
| 913 |
Example: the "target-notes" directive:: |
| 914 |
|
| 915 |
.. topic:: Links |
| 916 |
:class: hidden print |
| 917 |
|
| 918 |
.. target-notes:: |
| 919 |
:class: hidden print |
| 920 |
|
| 921 |
.. container:: handout |
| 922 |
|
| 923 |
One good example, used in this document, is the "target-notes" |
| 924 |
directive. For each external target (hyperlink) in the text, this |
| 925 |
directive generates a footnote containing the visible URL as |
| 926 |
content. Footnote references are placed after each hyperlink |
| 927 |
reference. |
| 928 |
|
| 929 |
The "topic" directive is given a "class" attribute with values |
| 930 |
"hidden" and "print", so the entire topic will only be displayed |
| 931 |
when printed. The "target-notes" directive also assigns a "class" |
| 932 |
attributes with values "hidden" and "print" to each of the footnote |
| 933 |
references it inserts throughout the text; they will only show up |
| 934 |
when printed. |
| 935 |
|
| 936 |
.. class:: incremental |
| 937 |
|
| 938 |
Other uses may require "``.. include:: <s5defs.txt>``". |
| 939 |
|
| 940 |
|
| 941 |
Useful Extensions For Firefox |
| 942 |
============================= |
| 943 |
|
| 944 |
* `Autohide`__ |
| 945 |
|
| 946 |
.. class:: handout |
| 947 |
|
| 948 |
Automatically hides toolbars in full-screen mode. |
| 949 |
|
| 950 |
__ http://www.krickelkrackel.de/autohide/autohide.htm |
| 951 |
|
| 952 |
* `Web Developer`__ |
| 953 |
|
| 954 |
.. class:: handout |
| 955 |
|
| 956 |
Adds a context submenu and a toolbar with a lot of useful |
| 957 |
functionality, including the viewing and live editing of |
| 958 |
stylesheets, and sizing the browser window. |
| 959 |
|
| 960 |
__ http://chrispederick.com/work/webdeveloper/ |
| 961 |
|
| 962 |
|
| 963 |
To Do |
| 964 |
===== |
| 965 |
|
| 966 |
.. class:: incremental |
| 967 |
|
| 968 |
* Multi-display support: |
| 969 |
|
| 970 |
- speaker's notes on the laptop screen |
| 971 |
- slides on the projector |
| 972 |
- two views stay in sync |
| 973 |
- presentation controlled from either display |
| 974 |
|
| 975 |
* Add timeout to incremental style. |
| 976 |
|
| 977 |
.. class:: handout |
| 978 |
|
| 979 |
I.e., incremental-specific style should go away (revert to |
| 980 |
normal) after a certain interval. |
| 981 |
|
| 982 |
These will require some serious JavaScript-fu! |
| 983 |
|
| 984 |
|
| 985 |
That's All, Folks! |
| 986 |
================== |
| 987 |
|
| 988 |
.. class:: huge |
| 989 |
|
| 990 |
Further information: |
| 991 |
https://docutils.sourceforge.io |
| 992 |
|
| 993 |
Docutils users' mailing list: |
| 994 |
[email protected] |
| 995 |
|
| 996 |
`Any questions?` |
| 997 |
|
| 998 |
|
| 999 |
.. topic:: Links |
| 1000 |
:class: hidden print |
| 1001 |
|
| 1002 |
.. target-notes:: :class: hidden print |