From cbeeec900837cf6fa75bbc9a617e2d00a693be4a Mon Sep 17 00:00:00 2001
From: goodger
Date: Thu, 8 Dec 2005 04:43:13 +0000
Subject: merged branches/s5 changes r4011:4155 into trunk/docutils
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4156 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
---
docutils/COPYING.txt | 6 +
docutils/HISTORY.txt | 39 +-
docutils/MANIFEST.in | 2 +-
docutils/THANKS.txt | 1 +
docutils/docs/dev/testing.txt | 19 +-
docutils/docs/index.txt | 5 +-
docutils/docs/ref/rst/definitions.txt | 180 ++++
docutils/docs/ref/rst/directives.txt | 8 +-
docutils/docs/ref/rst/substitutions.txt | 162 ----
docutils/docs/user/config.txt | 68 +-
docutils/docs/user/images/big-black.png | Bin 0 -> 19823 bytes
docutils/docs/user/images/big-white.png | Bin 0 -> 25697 bytes
docutils/docs/user/images/default.png | Bin 0 -> 59358 bytes
docutils/docs/user/images/happy_monkey.png | Bin 0 -> 5202 bytes
docutils/docs/user/images/medium-black.png | Bin 0 -> 24021 bytes
docutils/docs/user/images/medium-white.png | Bin 0 -> 33756 bytes
docutils/docs/user/images/rsp-all.png | Bin 0 -> 32565 bytes
docutils/docs/user/images/rsp-breaks.png | Bin 0 -> 17754 bytes
docutils/docs/user/images/rsp-covers.png | Bin 0 -> 19080 bytes
docutils/docs/user/images/rsp-cuts.png | Bin 0 -> 20751 bytes
docutils/docs/user/images/rsp-empty.png | Bin 0 -> 4900 bytes
docutils/docs/user/images/rsp-objects.png | Bin 0 -> 21291 bytes
docutils/docs/user/images/rsp.svg | 636 +++++++++++++
docutils/docs/user/images/s5-files.png | Bin 0 -> 25404 bytes
docutils/docs/user/images/s5-files.svg | 639 +++++++++++++
docutils/docs/user/images/small-black.png | Bin 0 -> 41144 bytes
docutils/docs/user/images/small-white.png | Bin 0 -> 41120 bytes
docutils/docs/user/slide-shows.txt | 984 +++++++++++++++++++++
docutils/docs/user/tools.txt | 142 ++-
docutils/docutils/frontend.py | 8 +-
.../docutils/parsers/rst/directives/references.py | 4 +
docutils/docutils/parsers/rst/include/s5defs.txt | 49 +
docutils/docutils/transforms/references.py | 15 +-
docutils/docutils/writers/__init__.py | 3 +-
docutils/docutils/writers/html4css1.py | 53 +-
docutils/docutils/writers/s5_html.py | 314 +++++++
.../docutils/writers/support/s5_html/README.txt | 6 +
.../writers/support/s5_html/big-black/__base__ | 2 +
.../s5_html/big-black/big_inverse/framing.css | 25 +
.../writers/support/s5_html/big-black/framing.css | 25 +
.../writers/support/s5_html/big-black/pretty.css | 111 +++
.../writers/support/s5_html/big-white/framing.css | 24 +
.../writers/support/s5_html/big-white/pretty.css | 109 +++
.../writers/support/s5_html/default/blank.gif | Bin 0 -> 49 bytes
.../writers/support/s5_html/default/framing.css | 25 +
.../writers/support/s5_html/default/iepngfix.htc | 42 +
.../writers/support/s5_html/default/opera.css | 8 +
.../writers/support/s5_html/default/outline.css | 21 +
.../writers/support/s5_html/default/pretty.css | 122 +++
.../writers/support/s5_html/default/print.css | 33 +
.../writers/support/s5_html/default/s5-core.css | 11 +
.../writers/support/s5_html/default/slides.css | 10 +
.../writers/support/s5_html/default/slides.js | 559 ++++++++++++
.../writers/support/s5_html/medium-black/__base__ | 2 +
.../support/s5_html/medium-black/pretty.css | 117 +++
.../support/s5_html/medium-white/framing.css | 24 +
.../support/s5_html/medium-white/pretty.css | 115 +++
.../writers/support/s5_html/small-black/__base__ | 2 +
.../writers/support/s5_html/small-black/pretty.css | 118 +++
.../support/s5_html/small-white/framing.css | 24 +
.../writers/support/s5_html/small-white/pretty.css | 116 +++
docutils/setup.py | 6 +-
.../expected/standalone_rst_html4css1.html | 2 +-
.../expected/standalone_rst_s5_html_1.html | 148 ++++
.../expected/standalone_rst_s5_html_2.html | 144 +++
.../test/functional/expected/ui/default/blank.gif | Bin 0 -> 49 bytes
.../functional/expected/ui/default/framing.css | 25 +
.../functional/expected/ui/default/iepngfix.htc | 42 +
.../test/functional/expected/ui/default/opera.css | 8 +
.../functional/expected/ui/default/outline.css | 21 +
.../test/functional/expected/ui/default/pretty.css | 122 +++
.../test/functional/expected/ui/default/print.css | 33 +
.../functional/expected/ui/default/s5-core.css | 11 +
.../test/functional/expected/ui/default/slides.css | 10 +
.../test/functional/expected/ui/default/slides.js | 559 ++++++++++++
.../functional/expected/ui/small-black/blank.gif | Bin 0 -> 49 bytes
.../functional/expected/ui/small-black/framing.css | 24 +
.../expected/ui/small-black/iepngfix.htc | 42 +
.../functional/expected/ui/small-black/opera.css | 8 +
.../functional/expected/ui/small-black/outline.css | 21 +
.../functional/expected/ui/small-black/pretty.css | 118 +++
.../functional/expected/ui/small-black/print.css | 33 +
.../functional/expected/ui/small-black/s5-core.css | 11 +
.../functional/expected/ui/small-black/slides.css | 10 +
.../functional/expected/ui/small-black/slides.js | 559 ++++++++++++
.../functional/input/standalone_rst_s5_html.txt | 126 +++
.../functional/tests/standalone_rst_s5_html_1.py | 44 +
.../functional/tests/standalone_rst_s5_html_2.py | 7 +
docutils/test/test_functional.py | 50 +-
.../test_rst/test_directives/test_target_notes.py | 64 ++
docutils/test/test_transforms/test_target_notes.py | 84 ++
docutils/tools/rst2s5.py | 26 +
92 files changed, 7104 insertions(+), 242 deletions(-)
create mode 100644 docutils/docs/ref/rst/definitions.txt
delete mode 100644 docutils/docs/ref/rst/substitutions.txt
create mode 100644 docutils/docs/user/images/big-black.png
create mode 100644 docutils/docs/user/images/big-white.png
create mode 100644 docutils/docs/user/images/default.png
create mode 100644 docutils/docs/user/images/happy_monkey.png
create mode 100644 docutils/docs/user/images/medium-black.png
create mode 100644 docutils/docs/user/images/medium-white.png
create mode 100644 docutils/docs/user/images/rsp-all.png
create mode 100644 docutils/docs/user/images/rsp-breaks.png
create mode 100644 docutils/docs/user/images/rsp-covers.png
create mode 100644 docutils/docs/user/images/rsp-cuts.png
create mode 100644 docutils/docs/user/images/rsp-empty.png
create mode 100644 docutils/docs/user/images/rsp-objects.png
create mode 100644 docutils/docs/user/images/rsp.svg
create mode 100644 docutils/docs/user/images/s5-files.png
create mode 100644 docutils/docs/user/images/s5-files.svg
create mode 100644 docutils/docs/user/images/small-black.png
create mode 100644 docutils/docs/user/images/small-white.png
create mode 100644 docutils/docs/user/slide-shows.txt
create mode 100644 docutils/docutils/parsers/rst/include/s5defs.txt
create mode 100644 docutils/docutils/writers/s5_html.py
create mode 100644 docutils/docutils/writers/support/s5_html/README.txt
create mode 100644 docutils/docutils/writers/support/s5_html/big-black/__base__
create mode 100644 docutils/docutils/writers/support/s5_html/big-black/big_inverse/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/big-black/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/big-black/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/big-white/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/big-white/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/blank.gif
create mode 100644 docutils/docutils/writers/support/s5_html/default/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/iepngfix.htc
create mode 100644 docutils/docutils/writers/support/s5_html/default/opera.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/outline.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/print.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/s5-core.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/slides.css
create mode 100644 docutils/docutils/writers/support/s5_html/default/slides.js
create mode 100644 docutils/docutils/writers/support/s5_html/medium-black/__base__
create mode 100644 docutils/docutils/writers/support/s5_html/medium-black/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/medium-white/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/medium-white/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/small-black/__base__
create mode 100644 docutils/docutils/writers/support/s5_html/small-black/pretty.css
create mode 100644 docutils/docutils/writers/support/s5_html/small-white/framing.css
create mode 100644 docutils/docutils/writers/support/s5_html/small-white/pretty.css
create mode 100644 docutils/test/functional/expected/standalone_rst_s5_html_1.html
create mode 100644 docutils/test/functional/expected/standalone_rst_s5_html_2.html
create mode 100644 docutils/test/functional/expected/ui/default/blank.gif
create mode 100644 docutils/test/functional/expected/ui/default/framing.css
create mode 100644 docutils/test/functional/expected/ui/default/iepngfix.htc
create mode 100644 docutils/test/functional/expected/ui/default/opera.css
create mode 100644 docutils/test/functional/expected/ui/default/outline.css
create mode 100644 docutils/test/functional/expected/ui/default/pretty.css
create mode 100644 docutils/test/functional/expected/ui/default/print.css
create mode 100644 docutils/test/functional/expected/ui/default/s5-core.css
create mode 100644 docutils/test/functional/expected/ui/default/slides.css
create mode 100644 docutils/test/functional/expected/ui/default/slides.js
create mode 100644 docutils/test/functional/expected/ui/small-black/blank.gif
create mode 100644 docutils/test/functional/expected/ui/small-black/framing.css
create mode 100644 docutils/test/functional/expected/ui/small-black/iepngfix.htc
create mode 100644 docutils/test/functional/expected/ui/small-black/opera.css
create mode 100644 docutils/test/functional/expected/ui/small-black/outline.css
create mode 100644 docutils/test/functional/expected/ui/small-black/pretty.css
create mode 100644 docutils/test/functional/expected/ui/small-black/print.css
create mode 100644 docutils/test/functional/expected/ui/small-black/s5-core.css
create mode 100644 docutils/test/functional/expected/ui/small-black/slides.css
create mode 100644 docutils/test/functional/expected/ui/small-black/slides.js
create mode 100644 docutils/test/functional/input/standalone_rst_s5_html.txt
create mode 100755 docutils/test/functional/tests/standalone_rst_s5_html_1.py
create mode 100755 docutils/test/functional/tests/standalone_rst_s5_html_2.py
create mode 100755 docutils/test/test_parsers/test_rst/test_directives/test_target_notes.py
create mode 100755 docutils/test/test_transforms/test_target_notes.py
create mode 100755 docutils/tools/rst2s5.py
(limited to 'docutils')
diff --git a/docutils/COPYING.txt b/docutils/COPYING.txt
index c90da5189..6411688bc 100644
--- a/docutils/COPYING.txt
+++ b/docutils/COPYING.txt
@@ -65,6 +65,12 @@ Exceptions
The exceptions to the `Public Domain Dedication`_ above are:
+* docutils/writers/support/s5_html/default/iepngfix.htc:
+
+ IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull
+ . Free usage permitted as long as
+ this notice remains intact.
+
* extras/optparse.py, copyright by Gregory P. Ward, released under a
BSD-style license (which can be found in the module's source code).
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index 822a098aa..ba3d38eec 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -102,9 +102,15 @@ Changes Since 0.3.9
- Added support for image width and height units.
- Fixed bug with image "target" options.
+* docutils/parsers/rst/directives/references.py:
+
+ - Added "class" attribute to "target-notes" directive, for
+ footnote_reference classes.
+
* docutils/parsers/rst/include/: Directory added to project; contains
standard data files for the "include" directive. Initial contents:
- character entity substitution definition sets.
+ character entity substitution definition sets, and a set of
+ definitions for S5/HTML presentations.
* docutils/parsers/rst/languages/ja.py: Added to project: Japanese
mappings by Hisashi Morita.
@@ -137,6 +143,7 @@ Changes Since 0.3.9
- Added references.DanglingReferences transform, extracted from
universal.FinalChecks.
- Fixed bug with doubly-indirect substitutions.
+ - Added footnote_reference classes attribute to "TargetNotes".
* docutils/transforms/universal.py:
@@ -180,20 +187,23 @@ Changes Since 0.3.9
- Made cloaking of email addresses with ``--cloak-email-addresses``
less obtrusive.
- Fixed support for centered images.
+ - Added support for class="compact" & class="open" lists.
* docutils/writers/latex2e.py:
- Underscores in citekeys are no longer escaped.
+* docutils/writers/s5_html.py: Added to project; writer for S5-format
+ slide shows.
+
* docutils/writers/support/: Directory added to project. Modules and
data files that support writers have been moved here.
- * The stylesheets are now installed along with the code, the code
- now knows where to find them, and the default is now to use
- (actually, to embed) the built-in stylesheets. Some adjustments
- to configuration files may be necessary. The easiest way to
- obtain the new default behavior is to remove all settings whose
- name includes "stylesheet".
+ The stylesheets are now installed along with the code, the code
+ knows where to find them, and the default is to use (actually, to
+ embed) the built-in stylesheets. Some adjustments to configuration
+ files may be necessary. The easiest way to obtain the new default
+ behavior is to remove all settings whose name includes "stylesheet".
* docutils/writers/support/newlatex2e/unicode_map.py: Added to
project; mapping of Unicode characters to LaTeX equivalents.
@@ -223,8 +233,11 @@ Changes Since 0.3.9
* docs/user/mailing-lists.txt: Added to project; information about
Docutils-related mailing lists and how to access them.
-* docs/ref/rst/substitutions.txt: "reStructuredText Standard
- Substitution Definition Sets", added to project.
+* docs/user/slide-shows.txt: Added to project; example of and docs for
+ the S5/HTML writer (``rst2s5.py`` front end).
+
+* docs/ref/rst/definitions.txt: "reStructuredText Standard Definition
+ Files", added to project.
* test/coverage.sh: Added to project; test coverage script.
@@ -232,6 +245,14 @@ Changes Since 0.3.9
- Added support for specifying runtime settings at the suite level.
+* test/test_functional.py:
+
+ - Added the ``clear_output_directory`` function.
+ - Added support for ``_test_more`` functions in functional test
+ config files.
+
+* tools/rst2s5.py: Added to project; front end for the S5/HTML writer.
+
* tools/rstpep2html.py: Renamed from pep.py.
* tools/dev/create_unimap.py: Added to project; script to create the
diff --git a/docutils/MANIFEST.in b/docutils/MANIFEST.in
index 5b627650c..9b9c4968d 100644
--- a/docutils/MANIFEST.in
+++ b/docutils/MANIFEST.in
@@ -6,4 +6,4 @@ recursive-include extras *
recursive-include licenses *
recursive-include test *
recursive-include tools *
-recursive-exclude * .cvsignore *.pyc *~
+recursive-exclude * .cvsignore *.pyc *~ .DS_Store
diff --git a/docutils/THANKS.txt b/docutils/THANKS.txt
index 2c0218922..d5ead0f83 100644
--- a/docutils/THANKS.txt
+++ b/docutils/THANKS.txt
@@ -86,6 +86,7 @@ donations, tasty treats, and related projects:
* Daniel Larsson
* Marc-Andre Lemburg
* Julien Letessier
+* Chris Liechti
* Wolfgang Lipp
* Edward Loper
* Dallas Mahrt
diff --git a/docutils/docs/dev/testing.txt b/docutils/docs/dev/testing.txt
index 6963f6541..82e9ed31c 100644
--- a/docutils/docs/dev/testing.txt
+++ b/docutils/docs/dev/testing.txt
@@ -193,12 +193,21 @@ file name (relative to ``functional/output/`` and
arbitrarily. However, the file names in ``functional/output/`` *must*
match the file names in ``functional/expected/``.
-All other variables are passed as keyword arguments to
-``docutils.core.publish_file``, so you can set reader, parser,
-writer and anything else you want to configure.
+If defined, ``_test_more`` must be a function with the following
+signature::
-Note that ``settings_overrides`` is already initialized as a
-dictionary *before* the execution of the config file.
+ def _test_more(expected_dir, output_dir, test_case, parameters):
+
+This function is called from the test case to perform tests beyond the
+simple comparison of expected and actual output files.
+
+``test_source`` and ``test_destination`` are removed from the
+namespace, as are all variables whose names begin with an underscore
+("_"). The remaining names are passed as keyword arguments to
+``docutils.core.publish_file``, so you can set reader, parser, writer
+and anything else you want to configure. Note that
+``settings_overrides`` is already initialized as a dictionary *before*
+the execution of the config file.
Creating New Tests
diff --git a/docutils/docs/index.txt b/docutils/docs/index.txt
index 69cceb717..e25d66e07 100644
--- a/docutils/docs/index.txt
+++ b/docutils/docs/index.txt
@@ -79,6 +79,7 @@ top level of the Docutils project directory.
Docutils-general:
* `Docutils Front-End Tools `__
+* `Easy Slide Shows With reStructuredText & S5 `__
* `Docutils Configuration Files `__
* `Docutils LaTeX Writer `__
* `Docutils Mailing Lists `__
@@ -128,8 +129,8 @@ reStructuredText_:
* `reStructuredText Markup Specification [`__
* `reStructuredText Directives ][`__
* `reStructuredText Interpreted Text Roles ][`__
-* `reStructuredText Standard Substitution Definition Sets
- ][`_
+* `reStructuredText Standard Definition Files
+ ][`_
Prehistoric:
diff --git a/docutils/docs/ref/rst/definitions.txt b/docutils/docs/ref/rst/definitions.txt
new file mode 100644
index 000000000..78a2bf8da
--- /dev/null
+++ b/docutils/docs/ref/rst/definitions.txt
@@ -0,0 +1,180 @@
+============================================
+ reStructuredText Standard Definition Files
+============================================
+:Author: David Goodger
+:Contact: goodger@python.org
+:Revision: $Revision$
+:Date: $Date$
+:Copyright: This document has been placed in the public domain.
+
+.. contents::
+
+
+This document describes standard definition files, such as sets of
+substitution definitions and interpreted text roles, that can be
+included in reStructuredText documents. The `"include" directive`__
+has a special syntax for these standard definition files, angle
+brackets around the file name::
+
+ .. include:: ]
+
+__ directives.html#include
+
+The individual data files are stored with the Docutils source code in
+the "docutils" package, in the ``docutils/parsers/rst/include``
+directory.
+
+
+Substitution Definitions
+========================
+
+Many of the standard definition files contain sets of `substitution
+definitions`__, which can be used in documents via `substitution
+references`__. For example, the copyright symbol is defined in
+``isonum.txt`` as "copy"::
+
+ .. include::
+
+ Copyright |copy| 2003 by John Q. Public, all rights reserved.
+
+__ restructuredtext.html#substitution-definitions
+__ restructuredtext.html#substitution-references
+
+Individual substitution definitions can also be copied from definition
+files and pasted into documents. This has two advantages: it removes
+dependencies, and it saves processing of unused definitions. However,
+multiple substitution definitions add clutter to the document.
+
+Substitution references require separation from the surrounding text
+with whitespace or punctuation. To use a substitution without
+intervening whitespace, you can use the disappearing-whitespace escape
+sequence, backslash-space::
+
+ .. include:: isonum.txt
+
+ Copyright |copy| 2003, BogusMegaCorp\ |trade|.
+
+Custom substitution definitions may use the `"unicode" directive`__.
+Whitespace is ignored and removed, effectively sqeezing together the
+text::
+
+ .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN
+ .. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122
+ .. with trademark sign
+
+ Copyright |copy| 2003, |BogusMegaCorp (TM)|.
+
+__ directives.html#unicode
+
+In addition, the "ltrim", "rtrim", and "trim" options may be used with
+the "unicode" directive to automatically trim spaces from the left,
+right, or both sides (respectively) of substitution references::
+
+ .. |---| unicode:: U+02014 .. em dash
+ :trim:
+
+
+Character Entity Sets
+---------------------
+
+The following files contain substitution definitions corresponding to
+XML character entity sets, from the following standards: ISO 8879 &
+ISO 9573-13 (combined), MathML, and XHTML1. They were generated by
+the ``tools/dev/unicode2rstsubs.py`` program from the input file
+unicode.xml__, which is maintained as part of the MathML 2
+Recommentation XML source.
+
+__ http://www.w3.org/2003/entities/xml/
+
+=================== =================================================
+Entity Set File Description
+=================== =================================================
+isoamsa.txt_ Added Mathematical Symbols: Arrows
+isoamsb.txt_ Added Mathematical Symbols: Binary Operators
+isoamsc.txt_ Added Mathematical Symbols: Delimiters
+isoamsn.txt_ Added Mathematical Symbols: Negated Relations
+isoamso.txt_ Added Mathematical Symbols: Ordinary
+isoamsr.txt_ Added Mathematical Symbols: Relations
+isobox.txt_ Box and Line Drawing
+isocyr1.txt_ Russian Cyrillic
+isocyr2.txt_ Non-Russian Cyrillic
+isodia.txt_ Diacritical Marks
+isogrk1.txt_ Greek Letters
+isogrk2.txt_ Monotoniko Greek
+isogrk3.txt_ Greek Symbols
+isogrk4.txt_ [1]_ Alternative Greek Symbols
+isolat1.txt_ Added Latin 1
+isolat2.txt_ Added Latin 2
+isomfrk.txt_ [1]_ Mathematical Fraktur
+isomopf.txt_ [1]_ Mathematical Openface (Double-struck)
+isomscr.txt_ [1]_ Mathematical Script
+isonum.txt_ Numeric and Special Graphic
+isopub.txt_ Publishing
+isotech.txt_ General Technical
+mmlalias.txt_ MathML aliases for entities from other sets
+mmlextra.txt_ [1]_ Extra names added by MathML
+xhtml1-lat1.txt_ XHTML Latin 1
+xhtml1-special.txt_ XHTML Special Characters
+xhtml1-symbol.txt_ XHTML Mathematical, Greek and Symbolic Characters
+=================== =================================================
+
+.. [1] There are ``*-wide.txt`` variants for each of these character
+ entity set files, containing characters outside of the Unicode
+ basic multilingual plane or BMP (wide-Unicode; code points greater
+ than U+FFFF). Most pre-built Python distributions are "narrow" and
+ do not support wide-Unicode characters. Python *can* be built with
+ wide-Unicode support though; consult the Python build instructions
+ for details.
+
+For example, the copyright symbol is defined as the XML character
+entity ``©``. The equivalent reStructuredText substitution
+reference (defined in both ``isonum.txt`` and ``xhtml1-lat1.txt``) is
+``|copy|``.
+
+.. _isoamsa.txt: ../../../docutils/parsers/rst/include/isoamsa.txt
+.. _isoamsb.txt: ../../../docutils/parsers/rst/include/isoamsb.txt
+.. _isoamsc.txt: ../../../docutils/parsers/rst/include/isoamsc.txt
+.. _isoamsn.txt: ../../../docutils/parsers/rst/include/isoamsn.txt
+.. _isoamso.txt: ../../../docutils/parsers/rst/include/isoamso.txt
+.. _isoamsr.txt: ../../../docutils/parsers/rst/include/isoamsr.txt
+.. _isobox.txt: ../../../docutils/parsers/rst/include/isobox.txt
+.. _isocyr1.txt: ../../../docutils/parsers/rst/include/isocyr1.txt
+.. _isocyr2.txt: ../../../docutils/parsers/rst/include/isocyr2.txt
+.. _isodia.txt: ../../../docutils/parsers/rst/include/isodia.txt
+.. _isogrk1.txt: ../../../docutils/parsers/rst/include/isogrk1.txt
+.. _isogrk2.txt: ../../../docutils/parsers/rst/include/isogrk2.txt
+.. _isogrk3.txt: ../../../docutils/parsers/rst/include/isogrk3.txt
+.. _isogrk4.txt: ../../../docutils/parsers/rst/include/isogrk4.txt
+.. _isolat1.txt: ../../../docutils/parsers/rst/include/isolat1.txt
+.. _isolat2.txt: ../../../docutils/parsers/rst/include/isolat2.txt
+.. _isomfrk.txt: ../../../docutils/parsers/rst/include/isomfrk.txt
+.. _isomopf.txt: ../../../docutils/parsers/rst/include/isomopf.txt
+.. _isomscr.txt: ../../../docutils/parsers/rst/include/isomscr.txt
+.. _isonum.txt: ../../../docutils/parsers/rst/include/isonum.txt
+.. _isopub.txt: ../../../docutils/parsers/rst/include/isopub.txt
+.. _isotech.txt: ../../../docutils/parsers/rst/include/isotech.txt
+.. _mmlalias.txt: ../../../docutils/parsers/rst/include/mmlalias.txt
+.. _mmlextra.txt: ../../../docutils/parsers/rst/include/mmlextra.txt
+.. _xhtml1-lat1.txt: ../../../docutils/parsers/rst/include/xhtml1-lat1.txt
+.. _xhtml1-special.txt: ../../../docutils/parsers/rst/include/xhtml1-special.txt
+.. _xhtml1-symbol.txt: ../../../docutils/parsers/rst/include/xhtml1-symbol.txt
+
+
+S5/HTML Definitions
+===================
+
+The "s5defs.txt_" standard definition file contains interpreted text
+roles (classes) and other definitions for documents destined to become
+`S5/HTML slide shows`_.
+
+.. _s5defs.txt: ../../../docutils/parsers/rst/include/s5defs.txt
+.. _S5/HTML slide shows: ../../user/slide-shows.html
+
+
+..
+ Local Variables:
+ mode: indented-text
+ indent-tabs-mode: nil
+ sentence-end-double-space: t
+ fill-column: 70
+ End:
diff --git a/docutils/docs/ref/rst/directives.txt b/docutils/docs/ref/rst/directives.txt
index 58fa324cf..12959e86d 100644
--- a/docutils/docs/ref/rst/directives.txt
+++ b/docutils/docs/ref/rst/directives.txt
@@ -1065,7 +1065,7 @@ Target Footnotes
:Directive Type: "target-notes"
:Doctree Elements: pending, footnote, footnote_reference
:Directive Arguments: None.
-:Directive Options: None.
+:Directive Options: Possible.
:Directive Content: None.
The "target-notes" directive creates a footnote for each external
@@ -1074,6 +1074,12 @@ reference. For every explicit target (of the form, ``.. _target name:
URL``) in the text, a footnote will be generated containing the
visible URL as content.
+The following option is recognized:
+
+``class`` : text
+ Set a "class" attribute value on all footnote_reference elements.
+ See the class_ directive below.
+
Footnotes
=========
diff --git a/docutils/docs/ref/rst/substitutions.txt b/docutils/docs/ref/rst/substitutions.txt
deleted file mode 100644
index 5ea9562f2..000000000
--- a/docutils/docs/ref/rst/substitutions.txt
+++ /dev/null
@@ -1,162 +0,0 @@
-========================================================
- reStructuredText Standard Substitution Definition Sets
-========================================================
-:Author: David Goodger
-:Contact: goodger@python.org
-:Revision: $Revision$
-:Date: $Date$
-:Copyright: This document has been placed in the public domain.
-
-.. contents::
-
-
-The data files described below contain sets of reStructuredText
-`substitution definitions`__. They can be included in documents using
-the `"include" directive's`__ special syntax for standard data files,
-angle brackets around the file name::
-
- .. include::
-
-__ restructuredtext.html#substitution-definitions
-__ directives.html#include
-
-The definitions can then be used in documents using `substitution
-references`__. For example, the copyright symbol is defined in
-``isonum.txt`` as "copy"::
-
- .. include::
-
- Copyright |copy| 2003 by John Q. Public, all rights reserved.
-
-__ restructuredtext.html#substitution-references
-
-Individual definitions can also be copied from these data files and
-pasted into documents. This has two advantages: it removes
-dependencies, and it saves processing of unused definitions. However,
-multiple substitution definitions add clutter to the document.
-
-Substitution references require separation from the surrounding text
-with whitespace or punctuation. To use a substitution without
-intervening whitespace, you can use the disappearing-whitespace escape
-sequence, backslash-space::
-
- .. include:: isonum.txt
-
- Copyright |copy| 2003, BogusMegaCorp\ |trade|.
-
-Custom definitions may use the `"unicode" directive`__. Whitespace is
-ignored and removed, effectively sqeezing together the text::
-
- .. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN
- .. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122
- .. with trademark sign
-
- Copyright |copy| 2003, |BogusMegaCorp (TM)|.
-
-__ directives.html#unicode
-
-In addition, the "ltrim", "rtrim", and "trim" options may be used with
-the "unicode" directive to automatically trim spaces from the left,
-right, or both sides (respectively) of substitution references::
-
- .. |---| unicode:: U+02014 .. em dash
- :trim:
-
-The individual data files are stored with the Docutils source code in
-the "docutils" package, in the ``docutils/parsers/rst/include``
-directory.
-
-
-Character Entity Sets
-=====================
-
-The following files contain substitution definitions corresponding to
-XML character entity sets, from the following standards: ISO 8879 &
-ISO 9573-13 (combined), MathML, and XHTML1. They were generated by
-the ``tools/dev/unicode2rstsubs.py`` program from the input file
-unicode.xml__, which is maintained as part of the MathML 2
-Recommentation XML source.
-
-__ http://www.w3.org/2003/entities/xml/
-
-=================== =================================================
-Entity Set File Description
-=================== =================================================
-isoamsa.txt_ Added Mathematical Symbols: Arrows
-isoamsb.txt_ Added Mathematical Symbols: Binary Operators
-isoamsc.txt_ Added Mathematical Symbols: Delimiters
-isoamsn.txt_ Added Mathematical Symbols: Negated Relations
-isoamso.txt_ Added Mathematical Symbols: Ordinary
-isoamsr.txt_ Added Mathematical Symbols: Relations
-isobox.txt_ Box and Line Drawing
-isocyr1.txt_ Russian Cyrillic
-isocyr2.txt_ Non-Russian Cyrillic
-isodia.txt_ Diacritical Marks
-isogrk1.txt_ Greek Letters
-isogrk2.txt_ Monotoniko Greek
-isogrk3.txt_ Greek Symbols
-isogrk4.txt_ [1]_ Alternative Greek Symbols
-isolat1.txt_ Added Latin 1
-isolat2.txt_ Added Latin 2
-isomfrk.txt_ [1]_ Mathematical Fraktur
-isomopf.txt_ [1]_ Mathematical Openface (Double-struck)
-isomscr.txt_ [1]_ Mathematical Script
-isonum.txt_ Numeric and Special Graphic
-isopub.txt_ Publishing
-isotech.txt_ General Technical
-mmlalias.txt_ MathML aliases for entities from other sets
-mmlextra.txt_ [1]_ Extra names added by MathML
-xhtml1-lat1.txt_ XHTML Latin 1
-xhtml1-special.txt_ XHTML Special Characters
-xhtml1-symbol.txt_ XHTML Mathematical, Greek and Symbolic Characters
-=================== =================================================
-
-.. [1] There are ``*-wide.txt`` variants for each of these character
- entity set files, containing characters outside of the Unicode
- basic multilingual plane or BMP (wide-Unicode; code points greater
- than U+FFFF). Most pre-built Python distributions are "narrow" and
- do not support wide-Unicode characters. Python *can* be built with
- wide-Unicode support though; consult the Python build instructions
- for details.
-
-For example, the copyright symbol is defined as the XML character
-entity ``©``. The equivalent reStructuredText substitution
-reference (defined in both ``isonum.txt`` and ``xhtml1-lat1.txt``) is
-``|copy|``.
-
-.. _isoamsa.txt: ../../../docutils/parsers/rst/include/isoamsa.txt
-.. _isoamsb.txt: ../../../docutils/parsers/rst/include/isoamsb.txt
-.. _isoamsc.txt: ../../../docutils/parsers/rst/include/isoamsc.txt
-.. _isoamsn.txt: ../../../docutils/parsers/rst/include/isoamsn.txt
-.. _isoamso.txt: ../../../docutils/parsers/rst/include/isoamso.txt
-.. _isoamsr.txt: ../../../docutils/parsers/rst/include/isoamsr.txt
-.. _isobox.txt: ../../../docutils/parsers/rst/include/isobox.txt
-.. _isocyr1.txt: ../../../docutils/parsers/rst/include/isocyr1.txt
-.. _isocyr2.txt: ../../../docutils/parsers/rst/include/isocyr2.txt
-.. _isodia.txt: ../../../docutils/parsers/rst/include/isodia.txt
-.. _isogrk1.txt: ../../../docutils/parsers/rst/include/isogrk1.txt
-.. _isogrk2.txt: ../../../docutils/parsers/rst/include/isogrk2.txt
-.. _isogrk3.txt: ../../../docutils/parsers/rst/include/isogrk3.txt
-.. _isogrk4.txt: ../../../docutils/parsers/rst/include/isogrk4.txt
-.. _isolat1.txt: ../../../docutils/parsers/rst/include/isolat1.txt
-.. _isolat2.txt: ../../../docutils/parsers/rst/include/isolat2.txt
-.. _isomfrk.txt: ../../../docutils/parsers/rst/include/isomfrk.txt
-.. _isomopf.txt: ../../../docutils/parsers/rst/include/isomopf.txt
-.. _isomscr.txt: ../../../docutils/parsers/rst/include/isomscr.txt
-.. _isonum.txt: ../../../docutils/parsers/rst/include/isonum.txt
-.. _isopub.txt: ../../../docutils/parsers/rst/include/isopub.txt
-.. _isotech.txt: ../../../docutils/parsers/rst/include/isotech.txt
-.. _mmlalias.txt: ../../../docutils/parsers/rst/include/mmlalias.txt
-.. _mmlextra.txt: ../../../docutils/parsers/rst/include/mmlextra.txt
-.. _xhtml1-lat1.txt: ../../../docutils/parsers/rst/include/xhtml1-lat1.txt
-.. _xhtml1-special.txt: ../../../docutils/parsers/rst/include/xhtml1-special.txt
-.. _xhtml1-symbol.txt: ../../../docutils/parsers/rst/include/xhtml1-symbol.txt
-
-
-..
- Local Variables:
- mode: indented-text
- indent-tabs-mode: nil
- sentence-end-double-space: t
- fill-column: 70
- End:
diff --git a/docutils/docs/user/config.txt b/docutils/docs/user/config.txt
index 2f6fa40c8..cbd874972 100644
--- a/docutils/docs/user/config.txt
+++ b/docutils/docs/user/config.txt
@@ -345,7 +345,8 @@ _`sectnum_xform`
Enable or disable the section numbering transform
(docutils.transforms.parts.SectNum).
- Default: enabled (1). Options: ``--no-section-numbering``.
+ Default: enabled (1). Options: ``--section-numbering``,
+ ``--no-section-numbering``.
_`source_link`
Include a "View document source" link in the document footer. URL
@@ -584,16 +585,18 @@ _`cloak_email_addresses`
_`compact_lists`
Remove extra vertical whitespace between items of bullet lists and
enumerated lists, when list items are "simple" (i.e., all items
- each contain one paragraph and/or one "simple" sublist only).
+ each contain one paragraph and/or one "simple" sublist only). The
+ behaviour can be specified directly via "class" attributes (values
+ "compact" and "open") in the document.
Default: enabled (1). Options: ``--compact-lists,
--no-compact-lists``.
_`compact_field_lists`
-
Remove extra vertical whitespace between items of field lists that
are "simple" (i.e., all field bodies each contain at most one
- paragraph).
+ paragraph). The behaviour can be specified directly via "class"
+ attributes (values "compact" and "open") in the document.
Default: enabled (1). Options: ``--compact-field-lists,
--no-compact-field-lists``.
@@ -643,9 +646,9 @@ _`option_limit`
.. _stylesheet [html4css1 writer]:
stylesheet
- CSS stylesheet URL, used verbatim. Overrides stylesheet_path
- [#override]_. Pass an empty string to deactivate stylesheet
- inclusion.
+ CSS stylesheet URL, used verbatim. Overrides the
+ "stylesheet_path" setting [#override]_. Pass an empty string to
+ deactivate stylesheet inclusion.
Default: None. Options: ``--stylesheet``.
@@ -656,10 +659,9 @@ stylesheet
.. _stylesheet_path [html4css1 writer]:
stylesheet_path
- Path to CSS stylesheet [#pwd]_. Overrides "stylesheet" URL
- setting (``--stylesheet``) [#override]_. Path is adjusted
- relative to the output HTML file. Also defined for the `LaTeX
- Writer`__.
+ Path to CSS stylesheet [#pwd]_. Overrides the "stylesheet" URL
+ setting [#override]_. Path is adjusted relative to the output
+ HTML file. Also defined for the `LaTeX Writer`__.
Default: "html4css1.css" in the docutils/writers/support directory
(installed automatically; for the exact machine-specific path, use
@@ -720,6 +722,50 @@ _`python_home`
Default: parent directory (".."). Options: ``--python-home``.
+[s5_html writer]
+.................
+
+The S5/HTML Writer derives from the standard HTML Writer, and shares
+all settings defined in the `[html4css1 writer]`_ section. The
+"[html4css1 writer]" section of configuration files is processed
+before the "[s5_html writer]" section.
+
+The S5/HTML Writer's default for the ``compact_lists`` setting differs
+from that of the standard HTML Writer: the default here is to disable
+compact lists.
+
+_`current_slide`
+
+ Enable or disable the current slide indicator ("1/15").
+
+ Default: disabled (None). Options: ``--current-slide``,
+ ``--no-current-slide``.
+
+_`overwrite_theme_files`
+ Allow or prevent the overwriting of existing theme files in the
+ ``ui/`` directory. This has no effect if "theme_url_" is
+ used.
+
+ Default: keep existing theme files (None). Options:
+ ``--keep-theme-files``, ``--overwrite-theme-files``.
+
+_`theme`
+ Name of an installed S5 theme, to be copied into a ``ui/``
+ subdirectory, beside the destination file (output HTML). Note
+ that existing theme files will not be overwritten; the existing
+ theme directory you must be deleted manually. Overrides the
+ "theme_url_" setting [#override]_.
+
+ Default: "default". Option: ``--theme``.
+
+_`theme-url`
+ The URL of an S5 theme directory. The destination file (output
+ HTML) will link to this theme; nothing will be copied. Overrides
+ the "theme_" setting [#override]_.
+
+ Default: None. Option: ``--theme-url``.
+
+
[latex2e writer]
````````````````
diff --git a/docutils/docs/user/images/big-black.png b/docutils/docs/user/images/big-black.png
new file mode 100644
index 000000000..869a0cf9f
Binary files /dev/null and b/docutils/docs/user/images/big-black.png differ
diff --git a/docutils/docs/user/images/big-white.png b/docutils/docs/user/images/big-white.png
new file mode 100644
index 000000000..1ce6d7d7d
Binary files /dev/null and b/docutils/docs/user/images/big-white.png differ
diff --git a/docutils/docs/user/images/default.png b/docutils/docs/user/images/default.png
new file mode 100644
index 000000000..509eeddad
Binary files /dev/null and b/docutils/docs/user/images/default.png differ
diff --git a/docutils/docs/user/images/happy_monkey.png b/docutils/docs/user/images/happy_monkey.png
new file mode 100644
index 000000000..2164c06dd
Binary files /dev/null and b/docutils/docs/user/images/happy_monkey.png differ
diff --git a/docutils/docs/user/images/medium-black.png b/docutils/docs/user/images/medium-black.png
new file mode 100644
index 000000000..f851e679e
Binary files /dev/null and b/docutils/docs/user/images/medium-black.png differ
diff --git a/docutils/docs/user/images/medium-white.png b/docutils/docs/user/images/medium-white.png
new file mode 100644
index 000000000..e5a465a56
Binary files /dev/null and b/docutils/docs/user/images/medium-white.png differ
diff --git a/docutils/docs/user/images/rsp-all.png b/docutils/docs/user/images/rsp-all.png
new file mode 100644
index 000000000..3e5f5ede3
Binary files /dev/null and b/docutils/docs/user/images/rsp-all.png differ
diff --git a/docutils/docs/user/images/rsp-breaks.png b/docutils/docs/user/images/rsp-breaks.png
new file mode 100644
index 000000000..f2a31b098
Binary files /dev/null and b/docutils/docs/user/images/rsp-breaks.png differ
diff --git a/docutils/docs/user/images/rsp-covers.png b/docutils/docs/user/images/rsp-covers.png
new file mode 100644
index 000000000..597c2c2a8
Binary files /dev/null and b/docutils/docs/user/images/rsp-covers.png differ
diff --git a/docutils/docs/user/images/rsp-cuts.png b/docutils/docs/user/images/rsp-cuts.png
new file mode 100644
index 000000000..aa46b3876
Binary files /dev/null and b/docutils/docs/user/images/rsp-cuts.png differ
diff --git a/docutils/docs/user/images/rsp-empty.png b/docutils/docs/user/images/rsp-empty.png
new file mode 100644
index 000000000..f6b93c38b
Binary files /dev/null and b/docutils/docs/user/images/rsp-empty.png differ
diff --git a/docutils/docs/user/images/rsp-objects.png b/docutils/docs/user/images/rsp-objects.png
new file mode 100644
index 000000000..43ce276f1
Binary files /dev/null and b/docutils/docs/user/images/rsp-objects.png differ
diff --git a/docutils/docs/user/images/rsp.svg b/docutils/docs/user/images/rsp.svg
new file mode 100644
index 000000000..03445d3bc
--- /dev/null
+++ b/docutils/docs/user/images/rsp.svg
@@ -0,0 +1,636 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ image/svg+xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docutils/docs/user/images/s5-files.png b/docutils/docs/user/images/s5-files.png
new file mode 100644
index 000000000..53cbbf250
Binary files /dev/null and b/docutils/docs/user/images/s5-files.png differ
diff --git a/docutils/docs/user/images/s5-files.svg b/docutils/docs/user/images/s5-files.svg
new file mode 100644
index 000000000..a3e644a22
--- /dev/null
+++ b/docutils/docs/user/images/s5-files.svg
@@ -0,0 +1,639 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ image/svg+xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ s5-core .css
+
+
+
+
+
+
+ framing .css
+
+
+
+
+
+
+ pretty .css
+
+
+
+
+
+
+
+
+ iepngfix .htc
+
+
+
+
+
+
+ blank .gif
+
+
+
+
+
+
+
+
+ outline .css
+
+
+
+
+
+
+ print .css
+
+
+
+
+
+
+ opera .css
+
+
+
+
+
+
+ slides .js
+
+
+
+
+
+
+ slides .css
+
+
+
+
+
+
+
+ *.htmloutput
+
+
+
+
+
diff --git a/docutils/docs/user/images/small-black.png b/docutils/docs/user/images/small-black.png
new file mode 100644
index 000000000..f8d80d387
Binary files /dev/null and b/docutils/docs/user/images/small-black.png differ
diff --git a/docutils/docs/user/images/small-white.png b/docutils/docs/user/images/small-white.png
new file mode 100644
index 000000000..65f96895d
Binary files /dev/null and b/docutils/docs/user/images/small-white.png differ
diff --git a/docutils/docs/user/slide-shows.txt b/docutils/docs/user/slide-shows.txt
new file mode 100644
index 000000000..1fdd8398b
--- /dev/null
+++ b/docutils/docs/user/slide-shows.txt
@@ -0,0 +1,984 @@
+.. include::
+
+=============================================
+ Easy Slide Shows With reStructuredText & S5
+=============================================
+
+:Authors: David Goodger & Chris Liechti
+:Date: $Date$
+
+.. This document has been placed in the public domain.
+
+.. class:: handout
+
+ This document serves both as a user manual and as a usage example
+ of the s5_html.py writer and the rst2s5.py front end.
+
+.. contents::
+ :class: handout
+
+How to create quick, good-looking presentation slide shows with
+Docutils_/reStructuredText_ and S5_.
+
+.. class:: small
+
+* Use the arrow keys to navigate.
+
+* Click the "|mode|" button to switch between presentation &
+ handout/outline modes.
+
+.. container:: handout
+
+ In presentation mode, mouse over to the lower right-hand corner to
+ display the controls.
+
+ The first slide of a presentation consists of all visible text up
+ to the first section title. The document title is also added to
+ the footer of all slides.
+
+ The "footer" directive is used to specify part of the slide footer
+ text. It is currently limited to one short line (one paragraph).
+
+ There is no support for the "header" directive in the themes
+ included with Docutils.
+
+.. _Docutils: http://docutils.sourceforge.net/
+.. _reStructuredText: http://docutils.sourceforge.net/rst.html
+.. _S5: http://meyerweb.com/eric/tools/s5/
+.. |bullet| unicode:: U+02022
+.. |mode| unicode:: U+00D8 .. capital o with stroke
+.. footer:: Location |bullet| Date
+
+
+Introduction
+============
+
+.. class:: handout
+
+ ``rst2s5.py`` is a Docutils_ front end that outputs HTML for use
+ with S5_, a "Simple Standards-based Slide Show System" by Eric
+ Meyer.
+
+.. topic:: Installation
+ :class: handout
+
+ Prerequisites: Python and the Docutils_ package have to be
+ installed. See the `Docutils README`__ file for installation
+ instructions.
+
+ __ http://docutils.sourceforge.net/README.html
+
+* reStructuredText
+
+ .. class:: handout
+
+ Uses normal reStructuredText as input.
+
+* One section per slide
+
+ .. class:: handout
+
+ Each first-level section is converted into a single slide.
+
+* (X)HTML output
+
+ .. class:: handout
+
+ Presentations can be viewed using any modern graphical web browser.
+ The browser must support CSS, JavaScript, and XHTML. S5 even works
+ with IE!
+
+* Themes
+
+ .. class:: handout
+
+ A variety of themes are available. See `Example Themes`_, below.
+
+* ``rst2s5.py``
+
+ .. class:: handout
+
+ The front-end tool to generate S5 slide shows.
+
+.. topic:: Keyboard Controls
+ :class: handout
+
+ The following apply in any supporting browser besides Opera, which
+ uses the default Opera Show controls instead.
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Action
+ - Key(s)
+ * - Go to the next slide
+ - * [Space bar]
+ * [Return]
+ * [Enter]
+ * [Right arrow]
+ * [Down arrow]
+ * [Page down]
+ * Click the left mouse button outside of the control area,
+ Flash object, or movie
+ * - Go to the previous slide
+ - * [Left arrow]
+ * [Up arrow]
+ * [Page up]
+ * - Go to the title (first) slide
+ - [Home]
+ * - Go to the last slide
+ - [End]
+ * - Jump directly to a slide
+ - Type the slide number, then hit [Return] or [Enter]
+ * - Skip forward *n* slides
+ - Type the number of slides to skip, then hit any "go to next"
+ key (except [Return] or [Enter])
+ * - Skip backward *n* slides
+ - Type the number of slides to skip, then hit any "go to
+ previous" key
+ * - Switch between slideshow and outline view
+ - * [T]
+ * Click the |mode| button
+ * - Show/hide slide controls
+ - * [C]
+ * Move the mouse pointer over the control area
+
+ Further details of the S5 user interface can be found at `Eric
+ Meyer's S5 page`__.
+
+ __ S5_
+
+
+Features (1)
+============
+
+.. container:: handout
+
+ The S5/HTML Writer supports all the standard Docutils HTML
+ features.
+
+S5-specific features:
+
+.. class:: incremental
+
+* The document title is duplicated on each slide in the S5 footer.
+
+* The ``footer`` directive may be used to define additional text in
+ the S5 footer.
+
+ .. container:: handout
+
+ But it is limited to one line of text.
+
+ This is useful for information such as the date of the
+ presentation and/or the location. The field in the footer is
+ left blank if no ``footer`` directive is used.
+
+ Example::
+
+ .. footer:: Location - Date
+
+* Incremental display.
+
+ .. class:: handout
+
+ An "incremental" class can be assigned to lists and other elements
+ to get one-item-at-a-time behavior (like this list).
+
+
+Features (2): Handouts
+======================
+
+````
+
+.. container:: handout
+
+ The contents of any element with a "class" attribute value of
+ "handout" are hidden in the slide presentation, and are only
+ visible when the presentation is printed, or viewed in outline
+ mode. "Handout"-class elements can appear anywhere in the text, as
+ often as needed.
+
+ This means that the slides and extra handout material can be
+ combined in one document. The handout can be printed directly from
+ the browser, and it will contain more than just silly framed
+ slides. This can be used to provide more detailed information, or
+ for speaker's notes.
+
+.. class:: incremental
+
+* Use the "class" directive::
+
+ .. class:: handout
+
+ .. container:: handout
+
+ The ``.. class:: handout`` directive can be used to tag
+ individual paragraphs and other elements. The "class" directive
+ applies to the first element immediately following::
+
+ .. class:: handout
+
+ This paragraph will get a ``class="handout"`` attribute.
+
+ This paragraph will not be affected.
+
+ It also applies to multiple elements in the directive content::
+
+ .. class:: handout
+
+ These paragraphs are the content of the "class" directive.
+ And as such...
+
+ Both paragraphs will *individually* receive
+ ``class="handout"`` attributes.
+
+* Use the "container" directive::
+
+ .. container:: handout
+
+ .. container:: handout
+
+ Arbitrary handout blocks can be created using the ``container``
+ directive. The content is treated as one.
+
+* Add a "class" option to certain directives::
+
+ .. topic:: Extra Material For Handouts
+ :class: handout
+
+.. container:: handout
+
+ The following directives support "class" options:
+
+ * all admonition directives ("admonition", "note", "hint", etc.)
+ * "image" & "figure"
+ * "topic"
+ * "sidebar"
+ * "line-block"
+ * "parsed-literal"
+ * "rubric"
+ * "compound"
+ * "table", "csv-table", & "list-table"
+ * "target-notes" (more about that below)
+ * "role" (pre-defined; more below)
+
+ Handout contents are also visible on the screen if the S5 view mode
+ is toggled from "slide show" to "outline" mode.
+
+
+Caveats
+=======
+
+.. class:: incremental
+
+1. Some Docutils features are not supported by some themes.
+
+ .. container:: handout
+
+ For example, header rendering is not supported by the themes
+ supplied with Docutils.
+
+ The "header" directive is used to set header text. S5
+ automatically inserts section/slide titles into the "header"
+ area of a slide. If both Docutils headers and S5 headers (slide
+ titles) exist simultaneously, they interfere with each other.
+
+2. Care must be taken with the "contents" directive.
+
+ .. container:: handout
+
+ The ``--no-toc-backlinks`` option is the default for the S5/HTML
+ writer (``toc_backlinks=0`` setting). Other values for this
+ setting will change the CSS class of headings such that they
+ won't show up correctly in the slide show.
+
+ Use the ``:class: handout`` option on the "contents" directive
+ to limit the table of contents to the handout/outline mode
+ only::
+
+ .. contents::
+ :class: handout
+
+
+.. class:: incremental
+
+3. Subsections ...
+------------------
+
+... may be used, sparingly.
+
+.. container:: handout
+
+ Only first-level sections become slides. Not many levels of
+ subsections can fit on a slide.
+
+ Subsections (of any level) work normally in handouts though. Add
+ "``.. class:: handout``" before a subsection (or sub-subsection, or
+ ...), and the entire subsection will only appear in the handout.
+
+
+Generating a Slide Show (1)
+===========================
+
+.. class:: incremental
+
+1. Open a console (terminal, command shell) and go to the folder
+ containing your file, ``presentation.txt``.
+
+2. Run the command::
+
+ rst2s5.py presentation.txt \
+ presentation.html
+
+3. Specify an S5 theme with the ``--theme`` option.
+
+ .. class:: handout
+
+ Docutils will copy the S5 theme files into a ``ui/`` folder
+ beside the output HTML file. A slide show can also link to an
+ existing theme using the ``--theme-url`` option.
+
+
+Generating a Slide Show (2)
+===========================
+
+.. class:: incremental
+
+4. Include a copy of any linked stylesheet.
+
+ .. class:: handout
+
+ The default Docutils stylesheet, ``html4css1.css``, will normally
+ be embedded in the output HTML. If you choose to link to a
+ stylesheet instead of embedding, you must include a copy (suggested
+ location: in the ``ui/`` directory).
+
+5. Open ``presentation.html`` in a web browser.
+
+6. Expand the browser window to full-screen mode, and speak.
+
+ .. class:: handout
+
+ The `Web Developer`__ extension for Firefox is very useful. With
+ it, you can resize your browser window to the exact dimensions of
+ the projector you'll be using, so you can test beforehand. There
+ are many other useful features as well.
+
+ __ http://chrispederick.com/work/webdeveloper/
+
+7. Profit!
+
+
+Examples (1)
+============
+
+.. sidebar:: Hint
+
+ Admonitions, tables, sidebars, and other elements can be used in
+ on-screen presentations in handouts. Images too!
+
+ .. image:: images/happy_monkey.png
+ :alt: sample image
+
+===== ===== ======
+ A B A or B
+===== ===== ======
+False False False
+True False True
+False True True
+True True True
+===== ===== ======
+
+
+Examples (2): Incremental Text
+==============================
+
+.. class:: incremental
+
+ Paragraphs can be displayed one at a time...
+
+ .. container::
+
+ ... or a bunch at a time.
+
+ This second paragraph is displayed together with the previous
+ one by grouping them with the "container" directive.
+
+| `We can also display` `one` `word` `at` `a` `time,`
+| `or a phrase` `at a time,`
+| `or even` `o`\ `n`\ `e` `l`\ `e`\ `t`\ `t`\ `e`\ `r` `at a time!`
+|
+| `(But the markup ain't pretty.)`
+
+
+Examples (3): Incr. Graphics
+============================
+
+Let's play... Rock, Scissors, Paper
+
+.. container:: animation
+
+ .. image:: images/rsp-empty.png
+
+ .. class:: incremental
+
+ .. image:: images/rsp-objects.png
+ .. image:: images/rsp-cuts.png
+ .. image:: images/rsp-covers.png
+ .. image:: images/rsp-breaks.png
+ .. image:: images/rsp-all.png
+
+
+Themes
+======
+
+.. class:: incremental
+
+* Several themes are available, and they're easy to adapt.
+
+ .. container:: handout
+
+ Themes from the `S5 tutorial`__ can be used. These themes are in
+ the public domain and may be redistributed freely.
+
+ __ http://meyerweb.com/eric/tools/s5/s5blank.zip
+
+ Sites with other S5 themes:
+
+ * http://meyerweb.com/eric/tools/s5/themes/
+ * http://mozilla.wikicities.com/wiki/Firefox_S5:Designs
+ * http://lachy.id.au/dev/mozilla/firefox/s5/
+
+ S5 is becoming more popular every day. Do a web search for "S5
+ theme" and you're bound to find plenty of choices.
+
+* "``--theme``" option.
+
+ .. container:: handout
+
+ The theme can be specified with the "``--theme``" command-line
+ option.
+
+ Example::
+
+ rst2s5 --theme big-black presentation.txt presentation.html
+
+ The default theme is "default".
+
+* "``theme``" setting.
+
+ .. class:: handout
+
+ You can set the theme with the "``theme``" configuration file
+ setting.
+
+* Copied to ``./ui//``.
+
+ .. class:: handout
+
+ Themes are copied into a ``ui/`` folder inside the folder
+ containing the presentation.
+
+* Link with "``--theme-url``" option.
+
+ .. class:: handout
+
+ Link to a theme on the same or another web site, using the
+ "``--theme-url``" option or "``theme_url``" configuration file
+ setting.
+
+
+Example Themes
+==============
+
+.. class:: handout
+
+ The default theme, "default", is a simplified version of S5's
+ default theme. It accommodates up to 13 lines of text.
+
+.. class:: center
+
+ "default"
+
+ .. image:: images/default.png
+ :align: center
+
+
+Example Themes: Small Text
+==========================
+
+.. class:: handout
+
+ The "small-white" and "small-black" themes are simplifications of
+ the default theme (**small** black text on a **white** background,
+ and **small** black text on a **white** background, respectively).
+ They each accommodate up to 15 lines of text.
+
+.. list-table::
+ :class: borderless
+
+ * - "small-white"
+
+ .. image:: images/small-white.png
+
+ - "small-black"
+
+ .. image:: images/small-black.png
+
+
+Example Themes: Large Text
+==========================
+
+.. class:: handout
+
+ The "big-white" and "big-black" themes feature very large, bold
+ text, with no footers. Only five short lines of large text fits
+ per slide.
+
+.. list-table::
+ :class: borderless
+
+ * - "big-white"
+
+ .. image:: images/big-white.png
+
+ - "big-black"
+
+ .. image:: images/big-black.png
+
+
+Example Themes: Medium Text
+===========================
+
+.. class:: handout
+
+ The "medium-white" and "medium-black" themes feature medium-sized
+ text. Up to 8 lines of text are accommodated.
+
+.. list-table::
+ :class: borderless
+
+ * - "medium-white"
+
+ .. image:: images/medium-white.png
+
+ - "medium-black"
+
+ .. image:: images/medium-black.png
+
+
+S5 Theme Files
+==============
+
+An S5 theme consists of a directory containing several files --
+stylesheets, JavaScript, and graphics:
+
+.. image:: images/s5-files.png
+ :align: center
+
+.. container:: handout
+
+ The generated HTML contains the entire slide show text. It also
+ contains links to the following files:
+
+ * slides.css simply contains import links to:
+
+ - s5-core.css: Default styles critical to the proper functioning
+ of the slide show; don't touch this!
+
+ - framing.css: Sets the basic layout of slide components (header,
+ footer, controls, etc. This file is the often edited.
+
+ - pretty.css: Presentation styles that give the slide show a
+ unique look and feel. This is the file that you're most likely
+ to edit for a custom theme. You can make a whole new theme
+ just by editing this file, and not touching the others.
+
+ * outline.css: Styles for outline mode.
+
+ * print.css: Styles for printing; hides most layout elements, and
+ may display others.
+
+ * opera.css: Styles necessary for the proper functioning of S5 in
+ Opera Show.
+
+ * slides.js: the JavaScript that drives the dynamic side of the
+ slide show (actions and navigation controls). It automatically
+ IDs the slides when the document loads, builds the navigation
+ menu, handles the hiding and showing of slides, and so on. The
+ code also manages the fallback to Opera Show if you're using
+ the Opera web browser.
+
+ Two files are included to support PNG transparency (alpha
+ channels) in Internet Explorer:
+
+ - iepngfix.htc
+ - blank.gif
+
+
+Making a Custom Theme
+=====================
+
+.. class:: incremental
+
+1. Run "``rst2s5.py --theme .txt .html``".
+
+ .. class:: handout
+
+ This initializes the ``ui`` directory with the base theme files.
+
+2. Copy ``ui/`` to ``ui/``.
+
+3. Edit the styles.
+
+ .. class:: handout
+
+ Start with ``pretty.css``; edit ``framing.css`` if you need to make
+ layout changes.
+
+4. Run "``rst2s5.py --theme .txt .html``".
+
+ .. class:: handout
+
+ Open your ``.html`` in a browser to test the new theme.
+
+5. Rinse & repeat.
+
+ .. class:: handout
+
+ Repeat from step 3 until you're satisfied.
+
+.. TODO: What to do next:
+
+ * add a ``__base__`` file
+ * create a personal reusable theme (plugin)
+ * submit the new theme to Docutils
+
+ ``docutils/writers/support/s5_html/``
+
+.. container:: handout
+
+ Resources:
+
+ * W3C's `Learning CSS `__
+
+ * `Creating An S5 Theme `__
+
+ * A short tutorial on how to create themes (in German):
+ `Eigenes Theme erstellen `__
+
+
+Classes: Incremental (1)
+========================
+
+.. class:: handout
+
+ Several "class" attribute values have built-in support in the
+ themes supplied with Docutils.
+
+.. class:: incremental
+
+ As described earlier,
+
+ * ``.. class:: incremental``
+
+ * ``.. container:: incremental``
+
+ * ::
+
+ .. sidebar:: title
+ :class: incremental
+
+
+Classes: Incremental (2)
+========================
+
+The "incremental" interpreted text role is also supported:
+
+.. class:: incremental
+
+ ::
+
+ :incremental:`This will appear first,` `and
+ this will appear second.`:incremental:
+
+ Requires "``.. include:: ``".
+
+.. container:: handout
+
+ As you can see, this markup is not very convenient.
+
+.. class:: incremental
+
+ | But ``s5defs.txt`` includes this useful definition:
+ | "``.. default-role:: incremental``". So:
+
+ ::
+
+ `This` `is` `all` `we` `need`
+
+`This` `is` `all` `we` `need` `to mark up incremental text.`
+
+
+Classes: Incremental (3)
+========================
+
+.. class:: handout
+
+ The "animation" class is provided to support incremental graphics.
+ This is how the example earlier was done:
+
+::
+
+ .. container:: animation
+
+ .. image:: images/rsp-empty.png
+
+ .. class:: incremental
+
+ .. image:: images/rsp-objects.png
+ .. image:: images/rsp-cuts.png
+ .. image:: images/rsp-covers.png
+ .. image:: images/rsp-breaks.png
+ .. image:: images/rsp-all.png
+
+.. admonition:: Caveat
+ :class: handout
+
+ The animation effects are caused by placing successive images at
+ the same location, laying each image over the last. For best
+ results, all images should be the same size, and the positions of
+ image elements should be consistent. Use image transparency (alpha
+ channels) to get overlay effects.
+
+ Absolute positioning is used, which means that the images take up
+ no space in the flow. If you want text to follow the images, you
+ have to specify the image sizes. Otherwise, the images and any
+ following text will overlap.
+
+
+Classes: Text Size
+==================
+
+.. class:: incremental
+
+ * :tiny:`tiny` (class & role name: "tiny", e.g. "``:tiny:`text```")
+ * :small:`small` ("small")
+ * normal (unstyled)
+ * :big:`big` ("big")
+ * :huge:`huge` ("huge")
+
+ Requires "``.. include:: ``".
+
+
+Classes: Alignment
+==================
+
+.. class:: incremental
+
+ .. class:: left
+
+ Left (class name: "left")
+
+ .. class:: center
+
+ Center ("center" & "centre")
+
+ .. class:: right
+
+ Right ("right")
+
+.. class:: handout
+
+ These classes apply to block-level elements only. They cannot be
+ used for inline text (i.e., they're not interpreted text roles).
+
+.. class:: incremental
+
+ Example::
+
+ .. class:: center
+
+ Text to be centered.
+
+
+Classes: Text Colours
+=====================
+
+:black:`black` [black], :gray:`gray`, :silver:`silver`, :white:`white`
+[white], :maroon:`maroon`, :red:`red`, :magenta:`magenta`,
+:fuchsia:`fuchsia`, :pink:`pink`, :orange:`orange`, :yellow:`yellow`,
+:lime:`lime`, :green:`green`, :olive:`olive`, :teal:`teal`,
+:cyan:`cyan`, :aqua:`aqua`, :blue:`blue`, :navy:`navy`,
+:purple:`purple`
+
+The class names and role names are the same as the colour names. For
+example, "``:orange:`text```" produces ":orange:`text`".
+
+.. class:: incremental
+
+Requires "``.. include:: ``".
+
+
+Classes: Borderless Tables
+==========================
+
+.. class:: handout
+
+ Here's an ordinary, unstyled table:
+
+.. class:: incremental
+
+ ========= =======
+ Sometimes borders
+ --------- -------
+ are useful.
+ ========= =======
+
+ And after applying "``.. class:: borderless``":
+
+ .. class:: borderless
+
+ ======= ========== =======
+ But sometimes, borders
+ ------- ---------- -------
+ are **not** wanted.
+ ======= ========== =======
+
+
+Classes: Print-Only
+===================
+
+.. class:: handout
+
+ Two classes are provided that only display their contents in
+ hardcopy. The "print-block" class applies to block-level elements
+ (like paragraphs, lists, and topics). The "print-inline" class
+ applies to text within paragraphs.
+
+.. class:: incremental
+
+ | "print-block" for block elements
+ | "print-inline" for inline text
+
+ Example: the "target-notes" directive::
+
+ .. topic:: Links
+ :class: print-block
+
+ .. target-notes::
+ :class: print-inline
+
+.. container:: handout
+
+ One good example, used in this document, is the "target-notes"
+ directive. For each external target (hyperlink) in the text, this
+ directive generates a footnote containing the visible URL as
+ content. Footnote references are placed after each hyperlink
+ reference.
+
+ The "topic" directive is given a "class" attribute with value
+ "print-block"; the entire topic will only be displayed when
+ printed. The "target-notes" assigns a "class" attribute with value
+ "print-inline" to each of the footnote references it inserts
+ throughout the text; they will only show up when printed.
+
+.. class:: incremental
+
+ Other uses may require "``.. include:: ``".
+
+
+Chained Presentations
+=====================
+
+.. class:: handout
+
+ Presentation slide shows can be chained together. This is useful
+ for including all or part of one presentation in another, and for
+ changing themes. Slide numbers are not carried over, unless you
+ fake a continuous multi-themed presentation:
+
+ 1. Generate slide show HTML files with two different names from
+ different themes but from the same source text.
+
+ 2. Include a link to the **next** slide, in the **second** theme's
+ file.
+
+ 3. To return to the first theme, include a link to the **next**
+ slide, in the **first** theme.
+
+From one theme, `to another...`__
+
+__ slide-shows-alt.html#chained-presentations-2
+
+
+Chained Presentations (2)
+=========================
+
+... and `back again...`__
+
+__ slide-shows.html#chained-presentations-3
+
+
+Chained Presentations (3)
+=========================
+
+... back to the first theme.
+
+.. container:: handout
+
+ Now we're back where we started from, back in the first theme, but
+ two slides further on.
+
+ In this way, any number of themes can be chained together.
+
+`Or you could cheat.`
+
+.. container:: handout
+
+ Just prepare the browser in advance, with all the slide show files
+ set up at the right slide in separate tabs in your browser, in the
+ right order. Closing one tab will reveal the next.
+
+
+To Do
+=====
+
+.. class:: incremental
+
+ * Multi-display support:
+
+ - speaker's notes on the laptop screen
+ - slides on the projector
+ - two views stay in sync
+ - presentation controlled from either display
+
+ * Add timeout to incremental style.
+
+ .. class:: handout
+
+ I.e., incremental-specific style should go away (revert to
+ normal) after a certain interval.
+
+ These will require some serious JavaScript-fu!
+
+
+That's All, Folks!
+==================
+
+.. class:: huge
+
+ Further information:
+ http://docutils.sf.net
+
+ Docutils users' mailing list:
+ docutils-users@lists.sf.net
+
+ `Any questions?`
+
+
+.. topic:: Links
+ :class: print-block
+
+ .. target-notes:: :class: print-inline
diff --git a/docutils/docs/user/tools.txt b/docutils/docs/user/tools.txt
index 48105e1ba..6f39b5021 100644
--- a/docutils/docs/user/tools.txt
+++ b/docutils/docs/user/tools.txt
@@ -3,7 +3,7 @@
==========================
:Author: David Goodger
-:Contact: goodger@users.sourceforge.net
+:Contact: goodger@python.org
:Revision: $Revision$
:Date: $Date$
:Copyright: This document has been placed in the public domain.
@@ -11,8 +11,9 @@
.. contents::
-Introduction
-============
+--------------
+ Introduction
+--------------
Once the Docutils package is unpacked, you will discover a "``tools``"
directory containing several front ends for common Docutils
@@ -40,7 +41,7 @@ input (stdin) is used for the source as well.
Getting Help
-------------
+============
First, try the "``--help``" option each front-end tool has.
@@ -51,8 +52,12 @@ list.
.. _Docutils-users: mailing-lists.html#docutils-users
-The Tools
-=========
+-----------
+ The Tools
+-----------
+
+HTML-Generating Tools
+=====================
buildhtml.py
------------
@@ -154,6 +159,116 @@ For example, to process a PEP into HTML::
rstpep2html.py pep-0287.txt pep-0287.html
+rst2s5.py
+---------
+
+:Reader: Standalone
+:Parser: reStructuredText
+:Writer: S5/HTML
+
+The ``rst2s5.py`` front end reads standalone reStructuredText source
+files and produces (X)HTML output compatible with S5_, the "Simple
+Standards-based Slide Show System" by Eric Meyer. A theme is required
+for proper rendering; several are distributed with Docutils and others
+are available; see Themes_ below.
+
+For example, to process a reStructuredText file "``slides.txt``" into
+S5/HTML::
+
+ rst2s5.py slides.txt slides.html
+
+Now open the "``slides.html``" file in your favorite browser, switch
+to full-screen mode, and enjoy the results.
+
+.. _S5: http://meyerweb.com/eric/tools/s5/
+
+
+Themes
+``````
+
+Each S5 theme consists of a directory containing several files:
+stylesheets, JavaScript, and graphics. These are copied into a
+``ui/`` directory beside the generated HTML. A theme is chosen
+using the "``--theme``" option (for themes that come with Docutils) or
+the "``--theme-url``" option (for themes anywhere). For example, the
+"medium-black" theme can be specified as follows::
+
+ rst2s5.py --theme medium-black slides.txt slides.html
+
+The theme will be copied to the ``ui/medium-black`` directory.
+
+Several themes are included with Docutils:
+
+``default``
+ This is a simplified version of S5's default theme.
+
+ :Main content: black serif text on a white background
+ :Text capacity: about 13 lines
+ :Headers: light blue, bold sans-serif text on a dark blue
+ background; titles are limited to one line
+ :Footers: small, gray, bold sans-serif text on a dark blue
+ background
+
+``small-white``
+ (Small text on a white background.)
+
+ :Main content: black serif text on a white background
+ :Text capacity: about 15 lines
+ :Headers: black, bold sans-serif text on a white background;
+ titles wrap
+ :Footers: small, dark gray, bold sans-serif text on a white
+ background
+
+``small-black``
+ :Main content: white serif text on a black background
+ :Text capacity: about 15 lines
+ :Headers: white, bold sans-serif text on a black background;
+ titles wrap
+ :Footers: small, light gray, bold sans-serif text on a black
+ background
+
+``medium-white``
+ :Main content: black serif text on a white background
+ :Text capacity: about 9 lines
+ :Headers: black, bold sans-serif text on a white background;
+ titles wrap
+ :Footers: small, dark gray, bold sans-serif text on a white
+ background
+
+``medium-black``
+ :Main content: white serif text on a black background
+ :Text capacity: about 9 lines
+ :Headers: white, bold sans-serif text on a black background;
+ titles wrap
+ :Footers: small, light gray, bold sans-serif text on a black
+ background
+
+``big-white``
+ :Main content: black, bold sans-serif text on a white background
+ :Text capacity: about 5 lines
+ :Headers: black, bold sans-serif text on a white background;
+ titles wrap
+ :Footers: not displayed
+
+``big-black``
+ :Main content: white, bold sans-serif text on a black background
+ :Text capacity: about 5 lines
+ :Headers: white, bold sans-serif text on a black background;
+ titles wrap
+ :Footers: not displayed
+
+If a theme directory contains a file named ``__base__``, the name of
+the theme's base theme will be read from it. Files are accumulated
+from the named theme, any base themes, and the "default" theme (which
+is the implicit base of all themes).
+
+For details, please see `Easy Slide Shows With reStructuredText &
+S5 `_.
+
+
+LaTeX-Generating Tools
+======================
+
rst2latex.py
------------
@@ -181,6 +296,9 @@ Some limitations and difference apply:
- Not all constructs are possible, see `Generating LaTeX with Docutils`_.
+XML-Generating Tools
+====================
+
rst2xml.py
----------
@@ -193,6 +311,9 @@ This can be transformed with standard XML tools such as XSLT
processors into arbitrary final forms.
+Testing/Debugging Tools
+=======================
+
rst2pseudoxml.py
----------------
@@ -228,11 +349,12 @@ document. Various forms output are possible:
-Customization
-=============
+---------------
+ Customization
+---------------
Command-Line Options
---------------------
+====================
Each front-end tool supports command-line options for one-off
customization. For persistent customization, use `configuration
@@ -248,7 +370,7 @@ corresponding configuration file entry names are listed in the
.. _configuration file:
Configuration Files
--------------------
+===================
Configuration files are used for persistent customization; they can be
set once and take effect every time you use a front-end tool.
diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py
index 93506bce5..43750c30c 100644
--- a/docutils/docutils/frontend.py
+++ b/docutils/docutils/frontend.py
@@ -338,10 +338,14 @@ class OptionParser(optparse.OptionParser, docutils.SettingsSpec):
('Disable backlinks from footnotes and citations.',
['--no-footnote-backlinks'],
{'dest': 'footnote_backlinks', 'action': 'store_false'}),
- ('Disable Docutils section numbering',
+ ('Enable Docutils section numbering (default: enabled).',
+ ['--section-numbering'],
+ {'action': 'store_true', 'dest': 'sectnum_xform',
+ 'default': 1, 'validator': validate_boolean}),
+ ('Disable Docutils section numbering (default: enabled).',
['--no-section-numbering'],
{'action': 'store_false', 'dest': 'sectnum_xform',
- 'default': 1, 'validator': validate_boolean}),
+ 'validator': validate_boolean}),
('Set verbosity threshold; report system messages at or higher than '
' (by name or number: "info" or "1", warning/2, error/3, '
'severe/4; also, "none" or "5"). Default is 2 (warning).',
diff --git a/docutils/docutils/parsers/rst/directives/references.py b/docutils/docutils/parsers/rst/directives/references.py
index 92966140f..0406182b6 100644
--- a/docutils/docutils/parsers/rst/directives/references.py
+++ b/docutils/docutils/parsers/rst/directives/references.py
@@ -12,12 +12,16 @@ __docformat__ = 'reStructuredText'
from docutils import nodes
from docutils.transforms import references
+from docutils.parsers.rst import directives
def target_notes(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
"""Target footnote generation."""
pending = nodes.pending(references.TargetNotes)
+ pending.details.update(options)
state_machine.document.note_pending(pending)
nodelist = [pending]
return nodelist
+
+target_notes.options = {'class': directives.class_option}
diff --git a/docutils/docutils/parsers/rst/include/s5defs.txt b/docutils/docutils/parsers/rst/include/s5defs.txt
new file mode 100644
index 000000000..d5d3047ce
--- /dev/null
+++ b/docutils/docutils/parsers/rst/include/s5defs.txt
@@ -0,0 +1,49 @@
+.. Definitions of interpreted text roles (classes) for S5/HTML data.
+.. This data file has been placed in the public domain.
+
+.. Colours
+ =======
+
+.. role:: black
+.. role:: gray
+.. role:: silver
+.. role:: white
+
+.. role:: maroon
+.. role:: red
+.. role:: magenta
+.. role:: fuchsia
+.. role:: pink
+.. role:: orange
+.. role:: yellow
+.. role:: lime
+.. role:: green
+.. role:: olive
+.. role:: teal
+.. role:: cyan
+.. role:: aqua
+.. role:: blue
+.. role:: navy
+.. role:: purple
+
+
+.. Text Sizes
+ ==========
+
+.. role:: huge
+.. role:: big
+.. role:: small
+.. role:: tiny
+
+
+.. Print-Only
+ ==========
+
+.. role:: print-inline
+
+
+.. Incremental Display
+ ===================
+
+.. role:: incremental
+.. default-role:: incremental
diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py
index bcf33dfe5..c3de8e3f1 100644
--- a/docutils/docutils/transforms/references.py
+++ b/docutils/docutils/transforms/references.py
@@ -713,6 +713,12 @@ class TargetNotes(Transform):
"""The TargetNotes transform has to be applied after `IndirectHyperlinks`
but before `Footnotes`."""
+
+ def __init__(self, document, startnode):
+ Transform.__init__(self, document, startnode=startnode)
+
+ self.classes = startnode.details.get('class', [])
+
def apply(self):
notes = {}
nodelist = []
@@ -736,7 +742,8 @@ class TargetNotes(Transform):
if not ref.get('anonymous'):
continue
if ref.hasattr('refuri'):
- footnote = self.make_target_footnote(ref['refuri'], [ref], notes)
+ footnote = self.make_target_footnote(ref['refuri'], [ref],
+ notes)
if not notes.has_key(ref['refuri']):
notes[ref['refuri']] = footnote
nodelist.append(footnote)
@@ -765,12 +772,16 @@ class TargetNotes(Transform):
continue
refnode = nodes.footnote_reference(
refname=footnote_name, auto=1)
+ refnode['classes'] += self.classes
self.document.note_autofootnote_ref(refnode)
self.document.note_footnote_ref(refnode)
index = ref.parent.index(ref) + 1
reflist = [refnode]
if not utils.get_trim_footnote_ref_space(self.document.settings):
- reflist.insert(0, nodes.Text(' '))
+ if self.classes:
+ reflist.insert(0, nodes.inline(text=' ', Classes=self.classes))
+ else:
+ reflist.insert(0, nodes.Text(' '))
ref.parent.insert(index, reflist)
return footnote
diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py
index c020fbf62..fb4cbee0b 100644
--- a/docutils/docutils/writers/__init__.py
+++ b/docutils/docutils/writers/__init__.py
@@ -125,7 +125,8 @@ _writer_aliases = {
'pprint': 'pseudoxml',
'pformat': 'pseudoxml',
'pdf': 'rlpdf',
- 'xml': 'docutils_xml',}
+ 'xml': 'docutils_xml',
+ 's5': 's5_html'}
def get_writer_class(writer_name):
"""Return the Writer class from the `writer_name` module."""
diff --git a/docutils/docutils/writers/html4css1.py b/docutils/docutils/writers/html4css1.py
index a53bda2ca..065d90584 100644
--- a/docutils/docutils/writers/html4css1.py
+++ b/docutils/docutils/writers/html4css1.py
@@ -99,19 +99,23 @@ class Writer(writers.Writer):
('Remove extra vertical whitespace between items of bullet lists '
'and enumerated lists, when list items are "simple" (i.e., all '
'items each contain one paragraph and/or one "simple" sublist '
- 'only). Default: enabled.',
+ 'only). Default: enabled. Can be specified directly via "class" '
+ 'attributes (values "compact" and "open") in the document.',
['--compact-lists'],
{'default': 1, 'action': 'store_true',
'validator': frontend.validate_boolean}),
- ('Disable compact simple bullet and enumerated lists.',
+ ('Disable compact simple bullet and enumerated lists (except where '
+ 'specified directly via "class" attributes; see --compact-lists).',
['--no-compact-lists'],
{'dest': 'compact_lists', 'action': 'store_false'}),
('Remove extra vertical whitespace between items of simple field '
- 'lists. Default: enabled.',
+ 'lists. Default: enabled. Can be specified directly via "class" '
+ 'attributes (values "compact" and "open") in the document.',
['--compact-field-lists'],
{'default': 1, 'action': 'store_true',
'validator': frontend.validate_boolean}),
- ('Disable compact simple field lists.',
+ ('Disable compact simple field lists (except where specified '
+ 'directly via "class" attributes; see --compact-field-lists).',
['--no-compact-field-lists'],
{'dest': 'compact_field_lists', 'action': 'store_false'}),
('Omit the XML declaration. Use with caution.',
@@ -508,10 +512,12 @@ class HTMLTranslator(nodes.NodeVisitor):
old_compact_simple = self.compact_simple
self.context.append((self.compact_simple, self.compact_p))
self.compact_p = None
- self.compact_simple = (self.settings.compact_lists and
- (self.compact_simple
- or self.topic_classes == ['contents']
- or self.check_simple_list(node)))
+ self.compact_simple = ('compact' in node['classes']
+ or (self.settings.compact_lists
+ and 'open' not in node['classes']
+ and (self.compact_simple
+ or self.topic_classes == ['contents']
+ or self.check_simple_list(node))))
if self.compact_simple and not old_compact_simple:
atts['class'] = 'simple'
self.body.append(self.starttag(node, 'ul', **atts))
@@ -763,10 +769,12 @@ class HTMLTranslator(nodes.NodeVisitor):
old_compact_simple = self.compact_simple
self.context.append((self.compact_simple, self.compact_p))
self.compact_p = None
- self.compact_simple = (self.settings.compact_lists and
- (self.compact_simple
- or self.topic_classes == ['contents']
- or self.check_simple_list(node)))
+ self.compact_simple = ('compact' in node['classes']
+ or (self.settings.compact_lists
+ and 'open' not in node['classes']
+ and (self.compact_simple
+ or self.topic_classes == ['contents']
+ or self.check_simple_list(node))))
if self.compact_simple and not old_compact_simple:
atts['class'] = (atts.get('class', '') + ' simple').strip()
self.body.append(self.starttag(node, 'ol', **atts))
@@ -805,7 +813,10 @@ class HTMLTranslator(nodes.NodeVisitor):
def visit_field_list(self, node):
self.context.append((self.compact_field_list, self.compact_p))
self.compact_p = None
- if self.settings.compact_field_lists:
+ if 'compact' in node['classes']:
+ self.compact_field_list = 1
+ elif (self.settings.compact_field_lists
+ and 'open' not in node['classes']):
self.compact_field_list = 1
for field in node:
field_body = field[-1]
@@ -1440,7 +1451,7 @@ class HTMLTranslator(nodes.NodeVisitor):
def depart_tip(self, node):
self.depart_admonition()
- def visit_title(self, node):
+ def visit_title(self, node, move_ids=1):
"""Only 6 section levels are supported by HTML."""
check_id = 0
close_tag = '
\n'
@@ -1475,14 +1486,18 @@ class HTMLTranslator(nodes.NodeVisitor):
self.body.append(
self.starttag(node, 'h%s' % h_level, '', **atts))
atts = {}
- # !!! next 2 lines to be removed in Docutils 0.5:
- if node.parent['ids']:
- atts['ids'] = node.parent['ids']
+ # !!! conditional to be removed in Docutils 0.5:
+ if move_ids:
+ if node.parent['ids']:
+ atts['ids'] = node.parent['ids']
if node.hasattr('refid'):
atts['class'] = 'toc-backref'
atts['href'] = '#' + node['refid']
- self.body.append(self.starttag({}, 'a', '', **atts))
- self.context.append('\n' % (h_level))
+ if atts:
+ self.body.append(self.starttag({}, 'a', '', **atts))
+ self.context.append('\n' % (h_level))
+ else:
+ self.context.append('\n' % (h_level))
# !!! conditional to be removed in Docutils 0.5:
if check_id:
if node.parent['ids']:
diff --git a/docutils/docutils/writers/s5_html.py b/docutils/docutils/writers/s5_html.py
new file mode 100644
index 000000000..853787544
--- /dev/null
+++ b/docutils/docutils/writers/s5_html.py
@@ -0,0 +1,314 @@
+# Author: Chris Liechti
+# Contact: cliechti@gmx.net
+# Author: David Goodger
+# Contact: goodger@python.org
+# Revision: $Revision$
+# Date: $Date$
+# Copyright: This module has been placed in the public domain.
+
+"""
+S5/HTML Slideshow Writer.
+"""
+
+__docformat__ = 'reStructuredText'
+
+
+import sys
+import os
+import docutils
+from docutils import frontend, nodes, utils, writers
+from docutils.writers import html4css1
+from docutils.parsers.rst import directives
+
+support_path = utils.relative_path(
+ os.path.join(os.getcwd(), 'dummy'),
+ os.path.join(writers.support_path, 's5_html'))
+
+def find_theme(name):
+ # Where else to look for a theme?
+ # Check working dir? Destination dir? Config dir? Plugins dir?
+ path = os.path.join(support_path, name)
+ if not os.path.isdir(path):
+ raise docutils.ApplicationError('Theme directory not found: %r' % name)
+ return path
+
+
+class Writer(html4css1.Writer):
+
+ settings_spec = html4css1.Writer.settings_spec + (
+ 'S5 Slideshow Specific Options',
+ 'For the S5/HTML writer, the --no-toc-backlinks option '
+ '(defined in General Docutils Options above) is the default, '
+ 'and should not be changed.',
+ (('Specify an installed S5 theme by name. Overrides --theme-url. '
+ 'The default theme name is "default". The theme files will be '
+ 'copied into a "ui/" directory, in the same directory as the '
+ 'destination file (output HTML). Note that existing theme files '
+ 'will not be overwritten (unless --overwrite-theme-files is used).',
+ ['--theme'],
+ {'default': 'default', 'metavar': '',
+ 'overrides': 'theme_url'}),
+ ('Specify an S5 theme URL. The destination file (output HTML) will '
+ 'link to this theme; nothing will be copied. Overrides --theme.',
+ ['--theme-url'],
+ {'metavar': '', 'overrides': 'theme'}),
+ ('Allow existing theme files in the ``ui/`` directory to be '
+ 'overwritten. The default is not to overwrite theme files.',
+ ['--overwrite-theme-files'],
+ {'action': 'store_true'}),
+ ('Keep existing theme files in the ``ui/`` directory; do not '
+ 'overwrite any. This is the default.',
+ ['--keep-theme-files'],
+ {'dest': 'overwrite_theme_files', 'action': 'store_false'}),
+ ('Enable the current slide indicator ("1 / 15"). '
+ 'The default is to disable it.',
+ ['--current-slide'],
+ {'action': 'store_true'}),
+ ('Disable the current slide indicator. This is the default.',
+ ['--no-current-slide'],
+ {'dest': 'current_slide', 'action': 'store_false'}),))
+
+ settings_default_overrides = {'toc_backlinks': 0}
+
+ config_section = 's5_html writer'
+ config_section_dependencies = ('writers', 'html4css1 writer')
+
+ def __init__(self):
+ html4css1.Writer.__init__(self)
+ self.translator_class = S5HTMLTranslator
+
+
+class S5HTMLTranslator(html4css1.HTMLTranslator):
+
+ doctype = (
+ '\n')
+
+ s5_stylesheet_template = """\
+
+
+
+
+
+
+
+
+\n"""
+
+ disable_current_slide = """
+\n"""
+
+ layout_template = """\
+\n"""
+#
+#
+#
+#
+
+ default_theme = 'default'
+ """Name of the default theme."""
+
+ base_theme_file = '__base__'
+ """Name of the file containing the name of the base theme."""
+
+ direct_theme_files = (
+ 'slides.css', 'outline.css', 'print.css', 'opera.css', 'slides.js')
+ """Names of theme files directly linked to in the output HTML"""
+
+ indirect_theme_files = (
+ 's5-core.css', 'framing.css', 'pretty.css', 'blank.gif', 'iepngfix.htc')
+ """Names of files used indirectly; imported or used by files in
+ `direct_theme_files`."""
+
+ required_theme_files = indirect_theme_files + direct_theme_files
+ """Names of mandatory theme files."""
+
+ def __init__(self, *args):
+ html4css1.HTMLTranslator.__init__(self, *args)
+ #insert S5-specific stylesheet and script stuff:
+ self.theme_file_path = None
+ self.setup_theme()
+ self.stylesheet.append(self.s5_stylesheet_template
+ % {'path': self.theme_file_path})
+ if not self.document.settings.current_slide:
+ self.stylesheet.append(self.disable_current_slide)
+ self.add_meta(' \n')
+ self.s5_footer = []
+ self.s5_header = []
+ self.section_count = 0
+ self.theme_files_copied = None
+
+ def setup_theme(self):
+ if self.document.settings.theme:
+ self.copy_theme()
+ elif self.document.settings.theme_url:
+ self.theme_file_path = self.document.settings.theme_url
+ else:
+ raise docutils.ApplicationError(
+ 'No theme specified for S5/HTML writer.')
+
+ def copy_theme(self):
+ """
+ Locate & copy theme files.
+
+ A theme may be explicitly based on another theme via a '__base__'
+ file. The default base theme is 'default'. Files are accumulated
+ from the specified theme, any base themes, and 'default'.
+ """
+ settings = self.document.settings
+ path = find_theme(settings.theme)
+ theme_paths = [path]
+ self.theme_files_copied = {}
+ copied = {}
+ # This is a link (URL) in HTML, so we use "/", not os.sep:
+ self.theme_file_path = '%s/%s' % ('ui', settings.theme)
+ if settings._destination:
+ dest = os.path.join(
+ os.path.dirname(settings._destination), 'ui', settings.theme)
+ if not os.path.isdir(dest):
+ os.makedirs(dest)
+ else:
+ # no destination, so we can't copy the theme
+ return
+ default = 0
+ while path:
+ for f in os.listdir(path): # copy all files from each theme
+ if f == self.base_theme_file:
+ continue # ... except the "__base__" file
+ if ( self.copy_file(f, path, dest)
+ and f in self.required_theme_files):
+ copied[f] = 1
+ if default:
+ break # "default" theme has no base theme
+ # Find the "__base__" file in theme directory:
+ base_theme_file = os.path.join(path, self.base_theme_file)
+ # If it exists, read it and record the theme path:
+ if os.path.isfile(base_theme_file):
+ lines = open(base_theme_file).readlines()
+ for line in lines:
+ line = line.strip()
+ if line and not line.startswith('#'):
+ path = find_theme(line)
+ if path in theme_paths: # check for duplicates (cycles)
+ path = None # if found, use default base
+ else:
+ theme_paths.append(path)
+ break
+ else: # no theme name found
+ path = None # use default base
+ else: # no base theme file found
+ path = None # use default base
+ if not path:
+ path = find_theme(self.default_theme)
+ theme_paths.append(path)
+ default = 1
+ if len(copied) != len(self.required_theme_files):
+ # Some all required files weren't found & couldn't be copied.
+ required = list(self.required_theme_files)
+ for f in copied.keys():
+ required.remove(f)
+ raise docutils.ApplicationError(
+ 'Theme files not found: %s'
+ % ', '.join(['%r' % f for f in required]))
+
+ def copy_file(self, name, source_dir, dest_dir):
+ """
+ Copy file `name` from `source_dir` to `dest_dir`.
+ Return 1 if the file exists in either `source_dir` or `dest_dir`.
+ """
+ source = os.path.join(source_dir, name)
+ dest = os.path.join(dest_dir, name)
+ if self.theme_files_copied.has_key(dest):
+ return 1
+ else:
+ self.theme_files_copied[dest] = 1
+ if os.path.isfile(source):
+ settings = self.document.settings
+ if os.path.exists(dest) and not settings.overwrite_theme_files:
+ settings.record_dependencies.add(dest)
+ else:
+ src_file = open(source, 'rb')
+ src_data = src_file.read()
+ src_file.close()
+ dest_file = open(dest, 'wb')
+ dest_file.write(src_data.replace(
+ 'ui/default', dest_dir[dest_dir.rfind('ui/'):]))
+ dest_file.close()
+ settings.record_dependencies.add(source)
+ return 1
+ if os.path.isfile(dest):
+ return 1
+
+ def depart_document(self, node):
+ header = ''.join(self.s5_header)
+ footer = ''.join(self.s5_footer)
+ title = ''.join(self.html_title).replace('