diff options
author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-09 20:44:25 +0000 |
---|---|---|
committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-09 20:44:25 +0000 |
commit | d77fdfef70e08114f57cbef5d91707df8717ea9f (patch) | |
tree | 49444e3486c0c333cb7b33dfa721296c08ee4ece /test/functional | |
parent | 53cd16ca6ca5f638cbe5956988e88f9339e355cf (diff) | |
parent | 3993c4097756e9885bcfbd07cb1cc1e4e95e50e4 (diff) | |
download | docutils-0.4.tar.gz |
Release 0.4: tagging released revisiondocutils-0.4
git-svn-id: http://svn.code.sf.net/p/docutils/code/tags/docutils-0.4@4268 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'test/functional')
68 files changed, 8194 insertions, 0 deletions
diff --git a/test/functional/README.txt b/test/functional/README.txt new file mode 100644 index 000000000..fc104d52e --- /dev/null +++ b/test/functional/README.txt @@ -0,0 +1,5 @@ +This directory stores data files for functional tests. + +Please see the documentation on `functional testing`__ for details. + +__ ../../docs/dev/testing.html#functional diff --git a/test/functional/expected/compact_lists.html b/test/functional/expected/compact_lists.html new file mode 100644 index 000000000..a486f378a --- /dev/null +++ b/test/functional/expected/compact_lists.html @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<title></title> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +</head> +<body> +<div class="document"> +<ul class="simple"> +<li>This is an ordinary simple bullet list.</li> +<li>It should be made compact (<p> & </p> tags omitted).</li> +</ul> +<hr class="docutils" /> +<ul> +<li><p class="first">This is a bullet list that is not simple.</p> +<p>There are multiple paragraphs in some items.</p> +</li> +<li><p class="first">It should not be made compact.</p> +</li> +<li><p class="first">Even though some items may have only one paragraph.</p> +</li> +</ul> +<hr class="docutils" /> +<ul class="open"> +<li><p class="first">This is a simple bullet list, but class="open" is set.</p> +</li> +<li><p class="first">It should not be made compact.</p> +</li> +</ul> +<hr class="docutils" /> +<ul class="compact simple"> +<li>This is a bullet list that is not simple.<p>There are multiple paragraphs in some items.</p> +</li> +<li>However, the class="compact" setting will cause +all first paragraph's <p> & </p> tags to be omitted.</li> +<li>Items with multiple paragraphs will not appear changed.</li> +<li>Items may have one paragraph, or multiple.<p>Items with multiple paragraphs will still be followed +by vertical whitespace because of the later paragraphs.</p> +</li> +<li>The effect is interesting.</li> +</ul> +</div> +</body> +</html> diff --git a/test/functional/expected/dangerous.html b/test/functional/expected/dangerous.html new file mode 100644 index 000000000..bba9f3408 --- /dev/null +++ b/test/functional/expected/dangerous.html @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<title></title> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +</head> +<body> +<div class="document"> +<p>Potentially dangerous features (security holes):</p> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 3)</p> +<p>"include" directive disabled.</p> +<pre class="literal-block"> +.. include:: /etc/passwd +</pre> +</div> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 4)</p> +<p>"raw" directive disabled.</p> +<pre class="literal-block"> +.. raw:: html + :file: /etc/passwd +</pre> +</div> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 6)</p> +<p>"raw" directive disabled.</p> +<pre class="literal-block"> +.. raw:: html + :url: file:///etc/passwd +</pre> +</div> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 8)</p> +<p>"raw" directive disabled.</p> +<pre class="literal-block"> +.. raw:: html + + <script> + that does something really nasty + </script> +</pre> +</div> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 13)</p> +<p>File and URL access deactivated; ignoring "csv-table" directive.</p> +<pre class="literal-block"> +.. csv-table:: :file: /etc/passwd +</pre> +</div> +<div class="system-message"> +<p class="system-message-title">System Message: WARNING/2 (<tt class="docutils">functional/input/dangerous.txt</tt>, line 14)</p> +<p>File and URL access deactivated; ignoring "csv-table" directive.</p> +<pre class="literal-block"> +.. csv-table:: :url: file:///etc/passwd +</pre> +</div> +<div class="figure"> +<img alt="picture.png" src="picture.png" /> +</div> +</div> +</body> +</html> diff --git a/test/functional/expected/field_name_limit.html b/test/functional/expected/field_name_limit.html new file mode 100644 index 000000000..b4148c043 --- /dev/null +++ b/test/functional/expected/field_name_limit.html @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<title></title> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +</head> +<body> +<div class="document"> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">short:</th><td class="field-body">This field's name is short.</td> +</tr> +<tr class="field"><th class="field-name">medium-length:</th><td class="field-body">This field's name is medium-length.</td> +</tr> +<tr class="field"><th class="field-name">long field name:</th><td class="field-body">This field's name is long.</td> +</tr> +<tr class="field"><th class="field-name">very very long field name:</th><td class="field-body">This field's name is quite long.</td> +</tr> +</tbody> +</table> +</div> +</body> +</html> diff --git a/test/functional/expected/latex_docinfo.tex b/test/functional/expected/latex_docinfo.tex new file mode 100644 index 000000000..04d9438f7 --- /dev/null +++ b/test/functional/expected/latex_docinfo.tex @@ -0,0 +1,85 @@ +\documentclass[10pt,a4paper,english]{article} +\usepackage{babel} +\usepackage{ae} +\usepackage{aeguill} +\usepackage{shortvrb} +\usepackage[latin1]{inputenc} +\usepackage{tabularx} +\usepackage{longtable} +\setlength{\extrarowheight}{2pt} +\usepackage{amsmath} +\usepackage{graphicx} +\usepackage{color} +\usepackage{multirow} +\usepackage{ifthen} +\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} +\usepackage[DIV12]{typearea} +%% generator Docutils: http://docutils.sourceforge.net/ +\newlength{\admonitionwidth} +\setlength{\admonitionwidth}{0.9\textwidth} +\newlength{\docinfowidth} +\setlength{\docinfowidth}{0.9\textwidth} +\newlength{\locallinewidth} +\newcommand{\optionlistlabel}[1]{\bf #1 \hfill} +\newenvironment{optionlist}[1] +{\begin{list}{} + {\setlength{\labelwidth}{#1} + \setlength{\rightmargin}{1cm} + \setlength{\leftmargin}{\rightmargin} + \addtolength{\leftmargin}{\labelwidth} + \addtolength{\leftmargin}{\labelsep} + \renewcommand{\makelabel}{\optionlistlabel}} +}{\end{list}} +\newlength{\lineblockindentation} +\setlength{\lineblockindentation}{2.5em} +\newenvironment{lineblock}[1] +{\begin{list}{} + {\setlength{\partopsep}{\parskip} + \addtolength{\partopsep}{\baselineskip} + \topsep0pt\itemsep0.15\baselineskip\parsep0pt + \leftmargin#1} + \raggedright} +{\end{list}} +% begin: floats for footnotes tweaking. +\setlength{\floatsep}{0.5em} +\setlength{\textfloatsep}{\fill} +\addtolength{\textfloatsep}{3em} +\renewcommand{\textfraction}{0.5} +\renewcommand{\topfraction}{0.5} +\renewcommand{\bottomfraction}{0.5} +\setcounter{totalnumber}{50} +\setcounter{topnumber}{50} +\setcounter{bottomnumber}{50} +% end floats for footnotes +% some commands, that could be overwritten in the style file. +\newcommand{\rubric}[1]{\subsection*{~\hfill {\it #1} \hfill ~}} +\newcommand{\titlereference}[1]{\textsl{#1}} +% end of "some commands" +\title{} +\author{Foo Fred~\\ +Food Foomatics {\&} Friends~\\ +foo@food.example.info~\\ +Fox St 13~\\ +Foowood \and +Bar Barney~\\ +Bar-BQ Bar~\\ +1-800-BARBQBAR~\\ +Barbara St 16~\\ +South Barwell} +\date{} +\hypersetup{ +pdfauthor={Foo Fred;Bar Barney} +} +\raggedbottom +\begin{document} +\maketitle + +%___________________________________________________________________________ +\begin{center} +\begin{tabularx}{\docinfowidth}{lX} +\end{tabularx} +\end{center} + +\setlength{\locallinewidth}{\linewidth} + +\end{document} diff --git a/test/functional/expected/misc_rst_html4css1.html b/test/functional/expected/misc_rst_html4css1.html new file mode 100644 index 000000000..f91844693 --- /dev/null +++ b/test/functional/expected/misc_rst_html4css1.html @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<title></title> +<link rel="stylesheet" href="foo&bar.css" type="text/css" /> +</head> +<body> +<div class="document"> +<p>simple input</p> +</div> +</body> +</html> diff --git a/test/functional/expected/pep_html.html b/test/functional/expected/pep_html.html new file mode 100644 index 000000000..8c1a077c5 --- /dev/null +++ b/test/functional/expected/pep_html.html @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!-- +This HTML is auto-generated. DO NOT EDIT THIS FILE! If you are writing a new +PEP, see http://www.python.org/peps/pep-0001.html for instructions and links +to templates. DO NOT USE THIS HTML FILE AS YOUR TEMPLATE! +--> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> + <title>PEP 100 -- Test PEP</title> + <link rel="stylesheet" href="../../../docutils/writers/pep_html/pep.css" type="text/css" /> +</head> +<body bgcolor="white"> +<table class="navigation" cellpadding="0" cellspacing="0" + width="100%" border="0"> +<tr><td class="navicon" width="150" height="35"> +<a href="http://www.python.org/" title="Python Home Page"> +<img src="http://www.python.org/pics/PyBanner000.gif" alt="[Python]" + border="0" width="150" height="35" /></a></td> +<td class="textlinks" align="left"> +[<b><a href="http://www.python.org/">Python Home</a></b>] +[<b><a href="http://www.python.org/peps/">PEP Index</a></b>] +[<b><a href="http://www.python.org/peps/pep-0100.txt">PEP Source</a></b>] +</td></tr></table> +<div class="document"> +<table class="rfc2822 docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">PEP:</th><td class="field-body">100</td> +</tr> +<tr class="field"><th class="field-name">Title:</th><td class="field-body">Test PEP</td> +</tr> +<tr class="field"><th class="field-name">Version:</th><td class="field-body">42</td> +</tr> +<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/nondist/peps/pep-0100.txt">A long time ago.</a></td> +</tr> +<tr class="field"><th class="field-name">Author:</th><td class="field-body">John Doe <john at example.org></td> +</tr> +<tr class="field"><th class="field-name">Discussions-To:</th><td class="field-body"><<a class="reference" href="mailto:devnull%40example.org?subject=PEP%20100">devnull at example.org</a>></td> +</tr> +<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td> +</tr> +<tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td> +</tr> +<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="http://www.python.org/peps/pep-0012.html">text/x-rst</a></td> +</tr> +<tr class="field"><th class="field-name">Created:</th><td class="field-body">01-Jun-2001</td> +</tr> +<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">13-Jun-2001</td> +</tr> +</tbody> +</table> +<hr /> +<div class="contents topic"> +<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> +<ul class="simple"> +<li><a class="reference" href="#abstract" id="id5" name="id5">Abstract</a></li> +<li><a class="reference" href="#copyright" id="id6" name="id6">Copyright</a></li> +<li><a class="reference" href="#references-and-footnotes" id="id7" name="id7">References and Footnotes</a></li> +</ul> +</div> +<div class="section"> +<h1><a class="toc-backref" href="#id5" id="abstract" name="abstract">Abstract</a></h1> +<p>This is just a test <a class="footnote-reference" href="#id2" id="id1" name="id1">[1]</a>. See the <a class="reference" href="http://www.python.org/peps/">PEP repository</a> <a class="footnote-reference" href="#id3" id="id4" name="id4">[2]</a> for the real +thing.</p> +</div> +<div class="section"> +<h1><a class="toc-backref" href="#id6" id="copyright" name="copyright">Copyright</a></h1> +<p>This document has been placed in the public domain.</p> +</div> +<div class="section"> +<h1><a class="toc-backref" href="#id7" id="references-and-footnotes" name="references-and-footnotes">References and Footnotes</a></h1> +<table class="docutils footnote" frame="void" id="id2" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id1" name="id2">[1]</a></td><td>PEP editors: <a class="reference" href="mailto:peps%40python.org">peps<span>@</span>python<span>.</span>org</a></td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id3" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id4" name="id3">[2]</a></td><td><a class="reference" href="http://www.python.org/peps/">http://www.python.org/peps/</a></td></tr> +</tbody> +</table> +</div> + +</div> +</body> +</html> + diff --git a/test/functional/expected/standalone_rst_html4css1.html b/test/functional/expected/standalone_rst_html4css1.html new file mode 100644 index 000000000..4f823b504 --- /dev/null +++ b/test/functional/expected/standalone_rst_html4css1.html @@ -0,0 +1,1001 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<title>reStructuredText Test Document</title> +<meta name="author" content="David Goodger" /> +<meta name="authors" content="Me Myself I" /> +<meta name="organization" content="humankind" /> +<meta name="date" content="Now, or yesterday. Or maybe even before yesterday." /> +<meta name="copyright" content="This document has been placed in the public domain. You may do with it as you wish. You may copy, modify, redistribute, reattribute, sell, buy, rent, lease, destroy, or improve it, quote it at length, excerpt, incorporate, collate, fold, staple, or mutilate it, or do anything else to it that your or anyone else's heart desires." /> +<meta content="reStructuredText, test, parser" name="keywords" /> +<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" /> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +</head> +<body> +<div class="header"> +Document header +<hr class="header"/> +</div> +<div class="document" id="restructuredtext-test-document"> +<span id="doctitle"></span><h1 class="title">reStructuredText Test Document</h1> +<h2 class="subtitle" id="examples-of-syntax-constructs"><span id="subtitle"></span>Examples of Syntax Constructs</h2> +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td>David Goodger</td></tr> +<tr><th class="docinfo-name">Address:</th> +<td><pre class="address"> +123 Example Street +Example, EX Canada +A1B 2C3 +</pre> +</td></tr> +<tr><th class="docinfo-name">Contact:</th> +<td><a class="first last reference" href="mailto:goodger@users.sourceforge.net">goodger@users.sourceforge.net</a></td></tr> +<tr><th class="docinfo-name">Authors:</th> +<td>Me +<br />Myself +<br />I</td></tr> +<tr><th class="docinfo-name">Organization:</th> +<td>humankind</td></tr> +<tr><th class="docinfo-name">Date:</th> +<td>Now, or yesterday. Or maybe even <em>before</em> yesterday.</td></tr> +<tr><th class="docinfo-name">Status:</th> +<td>This is a "work in progress"</td></tr> +<tr><th class="docinfo-name">Revision:</th> +<td>is managed by a version control system.</td></tr> +<tr><th class="docinfo-name">Version:</th> +<td>1</td></tr> +<tr><th class="docinfo-name">Copyright:</th> +<td>This document has been placed in the public domain. You +may do with it as you wish. You may copy, modify, +redistribute, reattribute, sell, buy, rent, lease, +destroy, or improve it, quote it at length, excerpt, +incorporate, collate, fold, staple, or mutilate it, or do +anything else to it that your or anyone else's heart +desires.</td></tr> +<tr class="field"><th class="docinfo-name">field name:</th><td class="field-body">This is a "generic bibliographic field".</td> +</tr> +<tr class="field"><th class="docinfo-name">field name "2":</th><td class="field-body"><p class="first">Generic bibliographic fields may contain multiple body elements.</p> +<p class="last">Like this.</p> +</td> +</tr> +</tbody> +</table> +<div class="dedication topic"> +<p class="topic-title first">Dedication</p> +<p>For Docutils users & co-developers.</p> +</div> +<div class="abstract topic"> +<p class="topic-title first">Abstract</p> +<p>This is a test document, containing at least one example of each +reStructuredText construct.</p> +</div> +<!-- This is a comment. Note how any initial comments are moved by +transforms to after the document title, subtitle, and docinfo. --> +<!-- Above is the document title, and below is the subtitle. +They are transformed from section titles after parsing. --> +<!-- bibliographic fields (which also require a transform): --> +<div class="contents topic"> +<p class="topic-title first"><a id="table-of-contents" name="table-of-contents">Table of Contents</a></p> +<ul class="auto-toc simple"> +<li><a class="reference" href="#structural-elements" id="id32" name="id32">1 Structural Elements</a><ul class="auto-toc"> +<li><a class="reference" href="#section-title" id="id33" name="id33">1.1 Section Title</a></li> +<li><a class="reference" href="#empty-section" id="id34" name="id34">1.2 Empty Section</a></li> +<li><a class="reference" href="#transitions" id="id35" name="id35">1.3 Transitions</a></li> +</ul> +</li> +<li><a class="reference" href="#body-elements" id="id36" name="id36">2 Body Elements</a><ul class="auto-toc"> +<li><a class="reference" href="#paragraphs" id="id37" name="id37">2.1 Paragraphs</a><ul class="auto-toc"> +<li><a class="reference" href="#inline-markup" id="id38" name="id38">2.1.1 Inline Markup</a></li> +</ul> +</li> +<li><a class="reference" href="#bullet-lists" id="id39" name="id39">2.2 Bullet Lists</a></li> +<li><a class="reference" href="#enumerated-lists" id="id40" name="id40">2.3 Enumerated Lists</a></li> +<li><a class="reference" href="#definition-lists" id="id41" name="id41">2.4 Definition Lists</a></li> +<li><a class="reference" href="#field-lists" id="id42" name="id42">2.5 Field Lists</a></li> +<li><a class="reference" href="#option-lists" id="id43" name="id43">2.6 Option Lists</a></li> +<li><a class="reference" href="#literal-blocks" id="id44" name="id44">2.7 Literal Blocks</a></li> +<li><a class="reference" href="#line-blocks" id="id45" name="id45">2.8 Line Blocks</a></li> +<li><a class="reference" href="#block-quotes" id="id46" name="id46">2.9 Block Quotes</a></li> +<li><a class="reference" href="#doctest-blocks" id="id47" name="id47">2.10 Doctest Blocks</a></li> +<li><a class="reference" href="#footnotes" id="id48" name="id48">2.11 Footnotes</a></li> +<li><a class="reference" href="#citations" id="id49" name="id49">2.12 Citations</a></li> +<li><a class="reference" href="#targets" id="id50" name="id50">2.13 Targets</a><ul class="auto-toc"> +<li><a class="reference" href="#duplicate-target-names" id="id51" name="id51">2.13.1 Duplicate Target Names</a></li> +<li><a class="reference" href="#id20" id="id52" name="id52">2.13.2 Duplicate Target Names</a></li> +</ul> +</li> +<li><a class="reference" href="#directives" id="id53" name="id53">2.14 Directives</a><ul class="auto-toc"> +<li><a class="reference" href="#document-parts" id="id54" name="id54">2.14.1 Document Parts</a></li> +<li><a class="reference" href="#images" id="id55" name="id55">2.14.2 Images</a></li> +<li><a class="reference" href="#admonitions" id="id56" name="id56">2.14.3 Admonitions</a></li> +<li><a class="reference" href="#topics-sidebars-and-rubrics" id="id57" name="id57">2.14.4 Topics, Sidebars, and Rubrics</a></li> +<li><a class="reference" href="#target-footnotes" id="id58" name="id58">2.14.5 Target Footnotes</a></li> +<li><a class="reference" href="#replacement-text" id="id59" name="id59">2.14.6 Replacement Text</a></li> +<li><a class="reference" href="#compound-paragraph" id="id60" name="id60">2.14.7 Compound Paragraph</a></li> +<li><a class="reference" href="#parsed-literal-blocks" id="id61" name="id61">2.14.8 Parsed Literal Blocks</a></li> +</ul> +</li> +<li><a class="reference" href="#substitution-definitions" id="id62" name="id62">2.15 Substitution Definitions</a></li> +<li><a class="reference" href="#comments" id="id63" name="id63">2.16 Comments</a></li> +<li><a class="reference" href="#raw-text" id="id64" name="id64">2.17 Raw text</a></li> +<li><a class="reference" href="#container" id="id65" name="id65">2.18 Container</a></li> +<li><a class="reference" href="#colspanning-tables" id="id66" name="id66">2.19 Colspanning tables</a></li> +<li><a class="reference" href="#rowspanning-tables" id="id67" name="id67">2.20 Rowspanning tables</a></li> +<li><a class="reference" href="#complex-tables" id="id68" name="id68">2.21 Complex tables</a></li> +<li><a class="reference" href="#list-tables" id="id69" name="id69">2.22 List Tables</a></li> +<li><a class="reference" href="#custom-roles" id="id70" name="id70">2.23 Custom Roles</a></li> +</ul> +</li> +<li><a class="reference" href="#error-handling" id="id71" name="id71">3 Error Handling</a></li> +</ul> +</div> +<div class="section"> +<h1><a class="toc-backref" href="#id32" id="structural-elements" name="structural-elements">1 Structural Elements</a></h1> +<div class="section"> +<h2 class="with-subtitle"><a class="toc-backref" href="#id33" id="section-title" name="section-title">1.1 Section Title</a></h2> +<h2 class="section-subtitle" id="section-subtitle"><span class="section-subtitle">Section Subtitle</span></h2> +<p>That's it, the text just above this line.</p> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id34" id="empty-section" name="empty-section">1.2 Empty Section</a></h2> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id35" id="transitions" name="transitions">1.3 Transitions</a></h2> +<p>Here's a transition:</p> +<hr class="docutils" /> +<p>It divides the section. Transitions may also occur between sections:</p> +</div> +</div> +<hr class="docutils" /> +<div class="section"> +<h1><a class="toc-backref" href="#id36" id="body-elements" name="body-elements">2 Body Elements</a></h1> +<div class="section"> +<h2><a class="toc-backref" href="#id37" id="paragraphs" name="paragraphs">2.1 Paragraphs</a></h2> +<p>A paragraph.</p> +<div class="section"> +<h3><a class="toc-backref" href="#id38" id="inline-markup" name="inline-markup">2.1.1 Inline Markup</a></h3> +<p>Paragraphs contain text and may contain inline markup: <em>emphasis</em>, +<strong>strong emphasis</strong>, <tt class="docutils literal"><span class="pre">inline</span> <span class="pre">literals</span></tt>, standalone hyperlinks +(<a class="reference" href="http://www.python.org">http://www.python.org</a>), external hyperlinks (<a class="reference" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id25" id="id26" name="id26">[5]</a>), internal +cross-references (<a class="reference" href="#example">example</a>), external hyperlinks with embedded URIs +(<a class="reference" href="http://www.python.org">Python web site</a>), <a class="reference" href="http://www.python.org/">anonymous hyperlink +references</a> <a class="footnote-reference" href="#id25" id="id29" name="id29">[5]</a> (<a class="reference" href="http://docutils.sourceforge.net/">a second reference</a> <a class="footnote-reference" href="#id30" id="id31" name="id31">[6]</a>), footnote references (manually +numbered <a class="footnote-reference" href="#id8" id="id1" name="id1">[1]</a>, anonymous auto-numbered <a class="footnote-reference" href="#id11" id="id2" name="id2">[3]</a>, labeled auto-numbered +<a class="footnote-reference" href="#label" id="id3" name="id3">[2]</a>, or symbolic <a class="footnote-reference" href="#id12" id="id4" name="id4">[*]</a>), citation references (<a class="citation-reference" href="#cit2002" id="id5" name="id5">[CIT2002]</a>), +substitution references (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />), and <span class="target" id="inline-hyperlink-targets">inline hyperlink targets</span> +(see <a class="reference" href="#id22">Targets</a> below for a reference back to here). Character-level +inline markup is also possible (although exceedingly ugly!) in <em>re</em><tt class="docutils literal"><span class="pre">Structured</span></tt><em>Text</em>. Problems are indicated by <a href="#id23" name="id24"><span class="problematic" id="id24">|problematic|</span></a> text +(generated by processing errors; this one is intentional). Here is a +reference to the <a class="reference" href="#doctitle">doctitle</a> and the <a class="reference" href="#subtitle">subtitle</a>.</p> +<p>The default role for interpreted text is <cite>Title Reference</cite>. Here are +some explicit interpreted text roles: a PEP reference (<a class="reference" href="http://www.python.org/peps/pep-0287.html">PEP 287</a>); an +RFC reference (<a class="reference" href="http://www.faqs.org/rfcs/rfc2822.html">RFC 2822</a>); a <sub>subscript</sub>; a <sup>superscript</sup>; +and explicit roles for <em>standard</em> <strong>inline</strong> +<tt class="docutils literal"><span class="pre">markup</span></tt>.</p> +<!-- DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! --> +<p>Let's test wrapping and whitespace significance in inline literals: +<tt class="docutils literal"><span class="pre">This</span> <span class="pre">is</span> <span class="pre">an</span> <span class="pre">example</span> <span class="pre">of</span> <span class="pre">--inline-literal</span> <span class="pre">--text,</span> <span class="pre">--including</span> <span class="pre">some--</span> +<span class="pre">strangely--hyphenated-words.</span> <span class="pre">Adjust-the-width-of-your-browser-window</span> +<span class="pre">to</span> <span class="pre">see</span> <span class="pre">how</span> <span class="pre">the</span> <span class="pre">text</span> <span class="pre">is</span> <span class="pre">wrapped.</span> <span class="pre">--</span> <span class="pre">----</span> <span class="pre">--------</span> <span class="pre">Now</span> <span class="pre">note</span> <span class="pre">the</span> +<span class="pre">spacing</span> <span class="pre">between</span> <span class="pre">the</span> <span class="pre">words</span> <span class="pre">of</span> <span class="pre">this</span> <span class="pre">sentence</span> <span class="pre">(words</span> +<span class="pre">should</span> <span class="pre">be</span> <span class="pre">grouped</span> <span class="pre">in</span> <span class="pre">pairs).</span></tt></p> +<p>If the <tt class="docutils literal"><span class="pre">--pep-references</span></tt> option was supplied, there should be a +live link to PEP 258 here.</p> +</div> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id39" id="bullet-lists" name="bullet-lists">2.2 Bullet Lists</a></h2> +<ul> +<li><p class="first">A bullet list</p> +<ul class="simple"> +<li>Nested bullet list.</li> +<li>Nested item 2.</li> +</ul> +</li> +<li><p class="first">Item 2.</p> +<p>Paragraph 2 of item 2.</p> +<ul class="simple"> +<li>Nested bullet list.</li> +<li>Nested item 2.<ul> +<li>Third level.</li> +<li>Item 2.</li> +</ul> +</li> +<li>Nested item 3.</li> +<li>This nested list should be compacted by the HTML writer.<span class="target" id="target"></span><!-- Even if this item contains a target and a comment. --> +</li> +</ul> +</li> +</ul> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id40" id="enumerated-lists" name="enumerated-lists">2.3 Enumerated Lists</a></h2> +<ol class="arabic"> +<li><p class="first">Arabic numerals.</p> +<ol class="loweralpha simple"> +<li>lower alpha)<ol class="lowerroman"> +<li>(lower roman)<ol class="upperalpha"> +<li>upper alpha.<ol class="upperroman"> +<li>upper roman)</li> +</ol> +</li> +</ol> +</li> +</ol> +</li> +</ol> +</li> +<li><p class="first">Lists that don't start at 1:</p> +<ol class="arabic simple" start="3"> +<li>Three</li> +<li>Four</li> +</ol> +<ol class="upperalpha simple" start="3"> +<li>C</li> +<li>D</li> +</ol> +<ol class="lowerroman simple" start="3"> +<li>iii</li> +<li>iv</li> +</ol> +</li> +</ol> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id41" id="definition-lists" name="definition-lists">2.4 Definition Lists</a></h2> +<dl class="docutils"> +<dt>Term</dt> +<dd>Definition</dd> +<dt>Term <span class="classifier-delimiter">:</span> <span class="classifier">classifier</span></dt> +<dd><p class="first">Definition paragraph 1.</p> +<p class="last">Definition paragraph 2.</p> +</dd> +<dt>Term</dt> +<dd>Definition</dd> +<dt>Term <span class="classifier-delimiter">:</span> <span class="classifier">classifier one</span> <span class="classifier-delimiter">:</span> <span class="classifier">classifier two</span></dt> +<dd>Definition</dd> +</dl> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id42" id="field-lists" name="field-lists">2.5 Field Lists</a></h2> +<table class="docutils field-list" frame="void" rules="none"> +<col class="field-name" /> +<col class="field-body" /> +<tbody valign="top"> +<tr class="field"><th class="field-name">what:</th><td class="field-body"><p class="first">Field lists map field names to field bodies, like database +records. They are often part of an extension syntax. They are +an unambiguous variant of RFC 2822 fields.</p> +</td> +</tr> +<tr class="field"><th class="field-name">how arg1 arg2:</th><td class="field-body"><p class="first">The field marker is a colon, the field name, and a colon.</p> +<p>The field body may contain one or more body elements, indented +relative to the field marker.</p> +</td> +</tr> +<tr class="field"><th class="field-name">credits:</th><td class="field-body"><p class="credits first last">This paragraph has the <cite>credits</cite> class set. (This is actually not +about credits but just for ensuring that the class attribute +doesn't get stripped away.)</p> +</td> +</tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id43" id="option-lists" name="option-lists">2.6 Option Lists</a></h2> +<p>For listing command-line options:</p> +<table class="docutils option-list" frame="void" rules="none"> +<col class="option" /> +<col class="description" /> +<tbody valign="top"> +<tr><td class="option-group"> +<kbd><span class="option">-a</span></kbd></td> +<td>command-line option "a"</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-b <var>file</var></span></kbd></td> +<td>options can have arguments +and long descriptions</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--long</span></kbd></td> +<td>options can be long also</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">--input=<var>file</var></span></kbd></td> +<td>long options can also have +arguments</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">--very-long-option</span></kbd></td> +</tr> +<tr><td> </td><td><p class="first">The description can also start on the next line.</p> +<p class="last">The description may contain multiple body elements, +regardless of where it starts.</p> +</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-x</span>, <span class="option">-y</span>, <span class="option">-z</span></kbd></td> +<td>Multiple options are an "option group".</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">-v</span>, <span class="option">--verbose</span></kbd></td> +<td>Commonly-seen: short & long options.</td></tr> +<tr><td class="option-group" colspan="2"> +<kbd><span class="option">-1 <var>file</var></span>, <span class="option">--one=<var>file</var></span>, <span class="option">--two <var>file</var></span></kbd></td> +</tr> +<tr><td> </td><td>Multiple options with arguments.</td></tr> +<tr><td class="option-group"> +<kbd><span class="option">/V</span></kbd></td> +<td>DOS/VMS-style options too</td></tr> +</tbody> +</table> +<p>There must be at least two spaces between the option and the +description.</p> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id44" id="literal-blocks" name="literal-blocks">2.7 Literal Blocks</a></h2> +<p>Literal blocks are indicated with a double-colon ("::") at the end of +the preceding paragraph (over there <tt class="docutils literal"><span class="pre">--></span></tt>). They can be indented:</p> +<pre class="literal-block"> +if literal_block: + text = 'is left as-is' + spaces_and_linebreaks = 'are preserved' + markup_processing = None +</pre> +<p>Or they can be quoted without indentation:</p> +<pre class="literal-block"> +>> Great idea! +> +> Why didn't I think of that? +</pre> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id45" id="line-blocks" name="line-blocks">2.8 Line Blocks</a></h2> +<p>This section tests line blocks. Line blocks are body elements which +consist of lines and other line blocks. Nested line blocks cause +indentation.</p> +<div class="line-block"> +<div class="line">This is a line block. It ends with a blank line.</div> +<div class="line-block"> +<div class="line">New lines begin with a vertical bar ("|").</div> +<div class="line">Line breaks and initial indent are significant, and preserved.</div> +<div class="line-block"> +<div class="line">Continuation lines are also possible. A long line that is intended +to wrap should begin with a space in place of the vertical bar.</div> +</div> +<div class="line">The left edge of a continuation line need not be aligned with +the left edge of the text above it.</div> +</div> +</div> +<div class="line-block"> +<div class="line">This is a second line block.</div> +<div class="line"><br /></div> +<div class="line">Blank lines are permitted internally, but they must begin with a "|".</div> +</div> +<p>Another line block, surrounded by paragraphs:</p> +<div class="line-block"> +<div class="line">And it's no good waiting by the window</div> +<div class="line">It's no good waiting for the sun</div> +<div class="line">Please believe me, the things you dream of</div> +<div class="line">They don't fall in the lap of no-one</div> +</div> +<p>Take it away, Eric the Orchestra Leader!</p> +<blockquote> +<div class="line-block"> +<div class="line">A one, two, a one two three four</div> +<div class="line"><br /></div> +<div class="line">Half a bee, philosophically,</div> +<div class="line-block"> +<div class="line">must, <em>ipso facto</em>, half not be.</div> +</div> +<div class="line">But half the bee has got to be,</div> +<div class="line-block"> +<div class="line"><em>vis a vis</em> its entity. D'you see?</div> +<div class="line"><br /></div> +</div> +<div class="line">But can a bee be said to be</div> +<div class="line-block"> +<div class="line">or not to be an entire bee,</div> +<div class="line-block"> +<div class="line">when half the bee is not a bee,</div> +<div class="line-block"> +<div class="line">due to some ancient injury?</div> +<div class="line"><br /></div> +</div> +</div> +</div> +<div class="line">Singing...</div> +</div> +</blockquote> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id46" id="block-quotes" name="block-quotes">2.9 Block Quotes</a></h2> +<p>Block quotes consist of indented body elements:</p> +<blockquote> +<p>My theory by A. Elk. Brackets Miss, brackets. This theory goes +as follows and begins now. All brontosauruses are thin at one +end, much much thicker in the middle and then thin again at the +far end. That is my theory, it is mine, and belongs to me and I +own it, and what it is too.</p> +<p class="attribution">—Anne Elk (Miss)</p> +</blockquote> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id47" id="doctest-blocks" name="doctest-blocks">2.10 Doctest Blocks</a></h2> +<pre class="doctest-block"> +>>> print 'Python-specific usage examples; begun with ">>>"' +Python-specific usage examples; begun with ">>>" +>>> print '(cut and pasted from interactive Python sessions)' +(cut and pasted from interactive Python sessions) +</pre> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id48" id="footnotes" name="footnotes">2.11 Footnotes</a></h2> +<table class="docutils footnote" frame="void" id="id8" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a name="id8">[1]</a></td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id9">2</a>, <a class="fn-backref" href="#id21">3</a>)</em> <p>A footnote contains body elements, consistently indented by at +least 3 spaces.</p> +<p class="last">This is the footnote's second paragraph.</p> +</td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="label" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a name="label">[2]</a></td><td><em>(<a class="fn-backref" href="#id3">1</a>, <a class="fn-backref" href="#id10">2</a>)</em> Footnotes may be numbered, either manually (as in <a class="footnote-reference" href="#id8" id="id9" name="id9">[1]</a>) or +automatically using a "#"-prefixed label. This footnote has a +label so it can be referred to from multiple places, both as a +footnote reference (<a class="footnote-reference" href="#label" id="id10" name="id10">[2]</a>) and as a hyperlink reference +(<a class="reference" href="#label">label</a>).</td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id11" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id2" name="id11">[3]</a></td><td><p class="first">This footnote is numbered automatically and anonymously using a +label of "#" only.</p> +<p>This is the second paragraph.</p> +<p class="last">And this is the third paragraph.</p> +</td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id12" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id4" name="id12">[*]</a></td><td>Footnotes may also use symbols, specified with a "*" label. +Here's a reference to the next footnote: <a class="footnote-reference" href="#id14" id="id13" name="id13">[†]</a>.</td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id14" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id13" name="id14">[†]</a></td><td>This footnote shows the next symbol in the sequence.</td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id15" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a name="id15">[4]</a></td><td>Here's an unreferenced footnote, with a reference to a +nonexistent footnote: <a href="#id80" name="id81"><span class="problematic" id="id81"><span id="id16"></span>[5]_</span></a>.</td></tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id49" id="citations" name="citations">2.12 Citations</a></h2> +<table class="docutils citation" frame="void" id="cit2002" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a name="cit2002">[CIT2002]</a></td><td><em>(<a class="fn-backref" href="#id5">1</a>, <a class="fn-backref" href="#id17">2</a>)</em> Citations are text-labeled footnotes. They may be +rendered separately and differently from footnotes.</td></tr> +</tbody> +</table> +<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id17" name="id17">[CIT2002]</a>, and a <a href="#id82" name="id83"><span class="problematic" id="id83"><span id="id18"></span>[nonexistent]_</span></a> +citation.</p> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id50" id="targets" name="targets"><span id="another-target"></span>2.13 Targets</a></h2> +<p id="example">This paragraph is pointed to by the explicit "example" target. A +reference can be found under <a class="reference" href="#inline-markup">Inline Markup</a>, above. <a class="reference" href="#inline-hyperlink-targets">Inline +hyperlink targets</a> are also possible.</p> +<p>Section headers are implicit targets, referred to by name. See +<a class="reference" href="#id22">Targets</a>, which is a subsection of <a class="reference" href="#body-elements">Body Elements</a>.</p> +<p>Explicit external targets are interpolated into references such as +"<a class="reference" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id25" id="id27" name="id27">[5]</a>".</p> +<p>Targets may be indirect and anonymous. Thus <a class="reference" href="#id22">this phrase</a> may also +refer to the <a class="reference" href="#id22">Targets</a> section.</p> +<p>Here's a <a href="#id84" name="id85"><span class="problematic" id="id85">`hyperlink reference without a target`_</span></a>, which generates an +error.</p> +<div class="section"> +<h3><a class="toc-backref" href="#id51" id="duplicate-target-names" name="duplicate-target-names">2.13.1 Duplicate Target Names</a></h3> +<p>Duplicate names in section headers or other implicit targets will +generate "info" (level-1) system messages. Duplicate names in +explicit targets will generate "warning" (level-2) system messages.</p> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id52" id="id20" name="id20">2.13.2 Duplicate Target Names</a></h3> +<p>Since there are two "Duplicate Target Names" section headers, we +cannot uniquely refer to either of them by name. If we try to (like +this: <a href="#id86" name="id87"><span class="problematic" id="id87">`Duplicate Target Names`_</span></a>), an error is generated.</p> +</div> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id53" id="directives" name="directives">2.14 Directives</a></h2> +<div class="contents local topic"> +<ul class="auto-toc simple"> +<li><a class="reference" href="#document-parts" id="id72" name="id72">2.14.1 Document Parts</a></li> +<li><a class="reference" href="#images" id="id73" name="id73">2.14.2 Images</a></li> +<li><a class="reference" href="#admonitions" id="id74" name="id74">2.14.3 Admonitions</a></li> +<li><a class="reference" href="#topics-sidebars-and-rubrics" id="id75" name="id75">2.14.4 Topics, Sidebars, and Rubrics</a></li> +<li><a class="reference" href="#target-footnotes" id="id76" name="id76">2.14.5 Target Footnotes</a></li> +<li><a class="reference" href="#replacement-text" id="id77" name="id77">2.14.6 Replacement Text</a></li> +<li><a class="reference" href="#compound-paragraph" id="id78" name="id78">2.14.7 Compound Paragraph</a></li> +<li><a class="reference" href="#parsed-literal-blocks" id="id79" name="id79">2.14.8 Parsed Literal Blocks</a></li> +</ul> +</div> +<p>These are just a sample of the many reStructuredText Directives. For +others, please see +<a class="reference" href="http://docutils.sourceforge.net/docs/ref/rst/directives.html">http://docutils.sourceforge.net/docs/ref/rst/directives.html</a>.</p> +<div class="section"> +<h3><a class="toc-backref" href="#id72" id="document-parts" name="document-parts">2.14.1 Document Parts</a></h3> +<p>An example of the "contents" directive can be seen above this section +(a local, untitled table of <a class="reference" href="#contents">contents</a>) and at the beginning of the +document (a document-wide <a class="reference" href="#table-of-contents">table of contents</a>).</p> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id73" id="images" name="images">2.14.2 Images</a></h3> +<p>An image directive (also clickable -- a hyperlink reference):</p> +<a class="reference image-reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a> +<p>Image with multiple IDs:</p> +<span id="image-target-2"></span><span id="image-target-1"></span><img alt="../../../docs/user/rst/images/title.png" id="image-target-3" name="image-target-3" src="../../../docs/user/rst/images/title.png" /> +<p>A centered image:</p> +<div align="center" class="align-center"><img alt="../../../docs/user/rst/images/biohazard.png" class="align-center" src="../../../docs/user/rst/images/biohazard.png" /></div> +<p>A left-aligned image:</p> +<img align="left" alt="../../../docs/user/rst/images/biohazard.png" class="align-left" src="../../../docs/user/rst/images/biohazard.png" /> +<p>A right-aligned image:</p> +<img align="right" alt="../../../docs/user/rst/images/biohazard.png" class="align-right" src="../../../docs/user/rst/images/biohazard.png" /> +<p>A figure directive:</p> +<div align="right" class="figclass1 figclass2 figure"> +<img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/biohazard.png" style="width: 50px;" /> +<p class="caption">A figure is an image with a caption and/or a legend:</p> +<div class="legend"> +<table border="1" class="docutils"> +<colgroup> +<col width="20%" /> +<col width="80%" /> +</colgroup> +<tbody valign="top"> +<tr><td>re</td> +<td>Revised, revisited, based on 're' module.</td> +</tr> +<tr><td>Structured</td> +<td>Structure-enhanced text, structuredtext.</td> +</tr> +<tr><td>Text</td> +<td>Well it is, isn't it?</td> +</tr> +</tbody> +</table> +<p>This paragraph is also part of the legend.</p> +</div> +</div> +<div align="left" class="figclass1 figclass2 figure"> +<img alt="reStructuredText, the markup syntax" class="class1 class2" src="../../../docs/user/rst/images/biohazard.png" style="width: 50px;" /> +<p class="caption">A left-aligned figure.</p> +<div class="legend"> +This is the legend.</div> +</div> +<p>This paragraph might flow around the figure...</p> +<p>A centered figure:</p> +<div align="center" class="figure"> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 50px;" /> +<p class="caption">This is the caption.</p> +<div class="legend"> +<p>This is the legend.</p> +<p>The legend may consist of several paragraphs.</p> +</div> +</div> +<p>This paragraph might flow around the figure...</p> +<p>A left-aligned figure:</p> +<div align="left" class="figure"> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 50px;" /> +<p class="caption">This is the caption.</p> +<div class="legend"> +<p>This is the legend.</p> +<p>The legend may consist of several paragraphs.</p> +</div> +</div> +<p>This paragraph might flow around the figure...</p> +<p>Now widths:</p> +<p>An image 2 em wide:</p> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2em;" /> +<p>An image 2 em wide and 30 pixel high:</p> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 2em; height: 30px;" /> +<p>An image occupying 70% of the line width:</p> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="width: 70%;" /> +<p>An image 3 cm high:</p> +<img alt="../../../docs/user/rst/images/biohazard.png" src="../../../docs/user/rst/images/biohazard.png" style="height: 3cm;" /> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id74" id="admonitions" name="admonitions">2.14.3 Admonitions</a></h3> +<div class="attention"> +<p class="first admonition-title">Attention!</p> +<p class="last">Directives at large.</p> +</div> +<div class="caution"> +<p class="first admonition-title">Caution!</p> +<p class="last">Don't take any wooden nickels.</p> +</div> +<div class="danger"> +<p class="first admonition-title">!DANGER!</p> +<p class="last">Mad scientist at work!</p> +</div> +<div class="error"> +<p class="first admonition-title">Error</p> +<p class="last">Does not compute.</p> +</div> +<div class="hint"> +<p class="first admonition-title">Hint</p> +<p class="last">It's bigger than a bread box.</p> +</div> +<div class="important"> +<p class="first admonition-title">Important</p> +<ul class="last simple"> +<li>Wash behind your ears.</li> +<li>Clean up your room.</li> +<li>Call your mother.</li> +<li>Back up your data.</li> +</ul> +</div> +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last">This is a note.</p> +</div> +<div class="tip"> +<p class="first admonition-title">Tip</p> +<p class="last">15% if the service is good.</p> +</div> +<div class="warning"> +<p class="first admonition-title">Warning</p> +<p class="last">Strong prose may provoke extreme mental exertion. +Reader discretion is strongly advised.</p> +</div> +<div class="admonition-and-by-the-way admonition"> +<p class="first admonition-title">And, by the way...</p> +<p class="last">You can make up your own admonition too.</p> +</div> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id75" id="topics-sidebars-and-rubrics" name="topics-sidebars-and-rubrics">2.14.4 Topics, Sidebars, and Rubrics</a></h3> +<div class="sidebar"> +<p class="first sidebar-title">Sidebar Title</p> +<p class="sidebar-subtitle">Optional Subtitle</p> +<p>This is a sidebar. It is for text outside the flow of the main +text.</p> +<p class="rubric">This is a rubric inside a sidebar</p> +<p class="last">Sidebars often appears beside the main text with a border and +background color.</p> +</div> +<div class="topic"> +<p class="topic-title first">Topic Title</p> +<p>This is a topic.</p> +</div> +<p class="rubric">This is a rubric</p> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id76" id="target-footnotes" name="target-footnotes">2.14.5 Target Footnotes</a></h3> +<table class="docutils footnote" frame="void" id="id25" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a name="id25">[5]</a></td><td><em>(<a class="fn-backref" href="#id26">1</a>, <a class="fn-backref" href="#id27">2</a>, <a class="fn-backref" href="#id28">3</a>, <a class="fn-backref" href="#id29">4</a>)</em> <a class="reference" href="http://www.python.org/">http://www.python.org/</a></td></tr> +</tbody> +</table> +<table class="docutils footnote" frame="void" id="id30" rules="none"> +<colgroup><col class="label" /><col /></colgroup> +<tbody valign="top"> +<tr><td class="label"><a class="fn-backref" href="#id31" name="id30">[6]</a></td><td><a class="reference" href="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</a></td></tr> +</tbody> +</table> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id77" id="replacement-text" name="replacement-text">2.14.6 Replacement Text</a></h3> +<p>I recommend you try <a class="reference" href="http://www.python.org/">Python, <em>the</em> best language around</a> <a class="footnote-reference" href="#id25" id="id28" name="id28">[5]</a>.</p> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id78" id="compound-paragraph" name="compound-paragraph">2.14.7 Compound Paragraph</a></h3> +<div class="some-class compound"> +<p class="compound-first">Compound 1, paragraph 1.</p> +<p class="compound-middle">Compound 1, paragraph 2.</p> +<ul class="compound-last simple"> +<li>Compound 1, list item one.</li> +<li>Compound 1, list item two.</li> +</ul> +</div> +<p>Another compound statement:</p> +<div class="compound"> +<p class="compound-first">Compound 2, a literal block:</p> +<pre class="compound-middle literal-block"> +Compound 2, literal. +</pre> +<p class="compound-last">Compound 2, this is a test.</p> +</div> +<div class="compound"> +<p>Compound 3, only consisting of one paragraph.</p> +</div> +<div class="compound"> +<pre class="compound-first literal-block"> +Compound 4. +This one starts with a literal block. +</pre> +<p class="compound-last">Compound 4, a paragraph.</p> +</div> +<p>Now something <em>really</em> perverted -- a nested compound block. This is +just to test that it works at all; the results don't have to be +meaningful.</p> +<div class="compound"> +<p class="compound-first">Compound 5, block 1 (a paragraph).</p> +<div class="compound-middle compound"> +<p class="compound-first">Compound 6, block 2 in compound 5.</p> +<p class="compound-last">Compound 6, another paragraph.</p> +</div> +<p class="compound-last">Compound 5, block 3 (a paragraph).</p> +</div> +<div class="compound"> +<p class="compound-first">Compound 7, with a table inside:</p> +<table border="1" class="compound-middle docutils"> +<colgroup> +<col width="33%" /> +<col width="33%" /> +<col width="33%" /> +</colgroup> +<tbody valign="top"> +<tr><td><p class="first">Left cell, first +paragraph.</p> +<p class="last">Left cell, second +paragraph.</p> +</td> +<td>Middle cell, +consisting of +exactly one +paragraph.</td> +<td><p class="first">Right cell.</p> +<p>Paragraph 2.</p> +<p class="last">Paragraph 3.</p> +</td> +</tr> +</tbody> +</table> +<p class="compound-middle">Compound 7, a paragraph after the table.</p> +<p class="compound-last">Compound 7, another paragraph.</p> +</div> +</div> +<div class="section"> +<h3><a class="toc-backref" href="#id79" id="parsed-literal-blocks" name="parsed-literal-blocks">2.14.8 Parsed Literal Blocks</a></h3> +<pre class="literal-block"> +This is a parsed literal block. + This line is indented. The next line is blank. + +Inline markup is supported, e.g. <em>emphasis</em>, <strong>strong</strong>, <tt class="docutils literal"><span class="pre">literal</span> +<span class="pre">text</span></tt>, footnotes <a class="footnote-reference" href="#id8" id="id21" name="id21">[1]</a>, <span class="target" id="id22">targets</span>, and <a class="reference" href="http://www.python.org/">references</a>. +</pre> +</div> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id62" id="substitution-definitions" name="substitution-definitions">2.15 Substitution Definitions</a></h2> +<p>An inline image (<img alt="EXAMPLE" src="../../../docs/user/rst/images/biohazard.png" />) example:</p> +<p>(Substitution definitions are not visible in the HTML source.)</p> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id63" id="comments" name="comments">2.16 Comments</a></h2> +<p>Here's one:</p> +<!-- Comments begin with two dots and a space. Anything may +follow, except for the syntax of footnotes, hyperlink +targets, directives, or substitution definitions. + +Double-dashes - - "- -" - - must be escaped somehow in HTML output. --> +<p>(View the HTML source to see the comment.)</p> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id64" id="raw-text" name="raw-text">2.17 Raw text</a></h2> +<p>This does not necessarily look nice, because there may be missing white space.</p> +<p>It's just there to freeze the behavior.</p> +A test.Second test.<div class="myclass">Another test with myclass set.</div><p>This is the <span class="myrawroleclass">fourth test</span> with myrawroleclass set.</p> +Fifth test in HTML.<br />Line two.</div> +<div class="section"> +<h2><a class="toc-backref" href="#id65" id="container" name="container">2.18 Container</a></h2> +<div class="custom container"> +<p>paragraph 1</p> +<p>paragraph 2</p> +</div> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id66" id="colspanning-tables" name="colspanning-tables">2.19 Colspanning tables</a></h2> +<p>This table has a cell spanning two columns:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="31%" /> +<col width="31%" /> +<col width="38%" /> +</colgroup> +<thead valign="bottom"> +<tr><th class="head" colspan="2">Inputs</th> +<th class="head">Output</th> +</tr> +<tr><th class="head">A</th> +<th class="head">B</th> +<th class="head">A or B</th> +</tr> +</thead> +<tbody valign="top"> +<tr><td>False</td> +<td>False</td> +<td>False</td> +</tr> +<tr><td>True</td> +<td>False</td> +<td>True</td> +</tr> +<tr><td>False</td> +<td>True</td> +<td>True</td> +</tr> +<tr><td>True</td> +<td>True</td> +<td>True</td> +</tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id67" id="rowspanning-tables" name="rowspanning-tables">2.20 Rowspanning tables</a></h2> +<p>Here's a table with cells spanning several rows:</p> +<table border="1" class="docutils"> +<colgroup> +<col width="44%" /> +<col width="22%" /> +<col width="33%" /> +</colgroup> +<thead valign="bottom"> +<tr><th class="head">Header row, column 1 +(header rows optional)</th> +<th class="head">Header 2</th> +<th class="head">Header 3</th> +</tr> +</thead> +<tbody valign="top"> +<tr><td>body row 1, column 1</td> +<td>column 2</td> +<td>column 3</td> +</tr> +<tr><td>body row 2</td> +<td rowspan="2">Cells may +span rows.</td> +<td rowspan="2">Another +rowspanning +cell.</td> +</tr> +<tr><td>body row 3</td> +</tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id68" id="complex-tables" name="complex-tables">2.21 Complex tables</a></h2> +<p>Here's a complex table, which should test all features.</p> +<table border="1" class="docutils"> +<colgroup> +<col width="43%" /> +<col width="21%" /> +<col width="18%" /> +<col width="18%" /> +</colgroup> +<thead valign="bottom"> +<tr><th class="head">Header row, column 1 +(header rows optional)</th> +<th class="head">Header 2</th> +<th class="head">Header 3</th> +<th class="head">Header 4</th> +</tr> +</thead> +<tbody valign="top"> +<tr><td>body row 1, column 1</td> +<td>column 2</td> +<td>column 3</td> +<td>column 4</td> +</tr> +<tr><td>body row 2</td> +<td colspan="3">Cells may span columns.</td> +</tr> +<tr><td>body row 3</td> +<td rowspan="2"><p class="first">Cells may +span rows.</p> +<p class="last">Paragraph.</p> +</td> +<td colspan="2" rowspan="2"><ul class="first last simple"> +<li>Table cells</li> +<li>contain</li> +<li>body elements.</li> +</ul> +</td> +</tr> +<tr><td>body row 4</td> +</tr> +<tr><td>body row 5</td> +<td colspan="2">Cells may also be +empty: <tt class="docutils literal"><span class="pre">--></span></tt></td> +<td> </td> +</tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id69" id="list-tables" name="list-tables">2.22 List Tables</a></h2> +<p>Here's a list table exercising all features:</p> +<table border="1" class="test docutils"> +<caption>list table with integral header</caption> +<colgroup> +<col width="17%" /> +<col width="33%" /> +<col width="50%" /> +</colgroup> +<thead valign="bottom"> +<tr><th class="head stub">Treat</th> +<th class="head">Quantity</th> +<th class="head">Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr><th class="stub">Albatross</th> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr><th class="stub">Crunchy Frog</th> +<td>1.49</td> +<td>If we took the bones out, it wouldn't be +crunchy, now would it?</td> +</tr> +<tr><th class="stub">Gannet Ripple</th> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +</div> +<div class="section"> +<h2><a class="toc-backref" href="#id70" id="custom-roles" name="custom-roles">2.23 Custom Roles</a></h2> +<p><tt class="custom docutils literal"><span class="pre">one</span></tt> <tt class="custom docutils literal"><span class="pre">two</span></tt> <tt class="custom docutils literal"><span class="pre">three</span></tt></p> +</div> +</div> +<div class="section"> +<h1><a class="toc-backref" href="#id71" id="error-handling" name="error-handling">3 Error Handling</a></h1> +<p>Any errors caught during processing will generate system messages.</p> +<p>There should be five messages in the following, auto-generated +section, "Docutils System Messages":</p> +<!-- section should be added by Docutils automatically --> +</div> +<div class="system-messages section"> +<h1>Docutils System Messages</h1> +<div class="system-message" id="id23"> +<p class="system-message-title">System Message: <a name="id23">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 100); <em><a href="#id24">backlink</a></em></p> +Undefined substitution referenced: "problematic".</div> +<div class="system-message" id="id80"> +<p class="system-message-title">System Message: <a name="id80">ERROR/3</a> (<tt class="docutils">functional/input/standalone_rst_html4css1.txt</tt>, line 358); <em><a href="#id81">backlink</a></em></p> +Unknown target name: "5".</div> +<div class="system-message" id="id82"> +<p class="system-message-title">System Message: <a name="id82">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 367); <em><a href="#id83">backlink</a></em></p> +Unknown target name: "nonexistent".</div> +<div class="system-message" id="id84"> +<p class="system-message-title">System Message: <a name="id84">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 394); <em><a href="#id85">backlink</a></em></p> +Unknown target name: "hyperlink reference without a target".</div> +<div class="system-message" id="id86"> +<p class="system-message-title">System Message: <a name="id86">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 407); <em><a href="#id87">backlink</a></em></p> +Duplicate target name, cannot be used as a unique reference: "duplicate target names".</div> +</div> +</div> +<div class="footer"> +<hr class="footer" /> +Document footer +</div> +</body> +</html> diff --git a/test/functional/expected/standalone_rst_latex.tex b/test/functional/expected/standalone_rst_latex.tex new file mode 100644 index 000000000..ba5b63bb0 --- /dev/null +++ b/test/functional/expected/standalone_rst_latex.tex @@ -0,0 +1,1556 @@ +\documentclass[10pt,a4paper,english]{article} +\usepackage{babel} +\usepackage{ae} +\usepackage{aeguill} +\usepackage{shortvrb} +\usepackage[latin1]{inputenc} +\usepackage{tabularx} +\usepackage{longtable} +\setlength{\extrarowheight}{2pt} +\usepackage{amsmath} +\usepackage{graphicx} +\usepackage{color} +\usepackage{multirow} +\usepackage{ifthen} +\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} +\usepackage[DIV12]{typearea} +%% generator Docutils: http://docutils.sourceforge.net/ +\newlength{\admonitionwidth} +\setlength{\admonitionwidth}{0.9\textwidth} +\newlength{\docinfowidth} +\setlength{\docinfowidth}{0.9\textwidth} +\newlength{\locallinewidth} +\newcommand{\optionlistlabel}[1]{\bf #1 \hfill} +\newenvironment{optionlist}[1] +{\begin{list}{} + {\setlength{\labelwidth}{#1} + \setlength{\rightmargin}{1cm} + \setlength{\leftmargin}{\rightmargin} + \addtolength{\leftmargin}{\labelwidth} + \addtolength{\leftmargin}{\labelsep} + \renewcommand{\makelabel}{\optionlistlabel}} +}{\end{list}} +\newlength{\lineblockindentation} +\setlength{\lineblockindentation}{2.5em} +\newenvironment{lineblock}[1] +{\begin{list}{} + {\setlength{\partopsep}{\parskip} + \addtolength{\partopsep}{\baselineskip} + \topsep0pt\itemsep0.15\baselineskip\parsep0pt + \leftmargin#1} + \raggedright} +{\end{list}} +% begin: floats for footnotes tweaking. +\setlength{\floatsep}{0.5em} +\setlength{\textfloatsep}{\fill} +\addtolength{\textfloatsep}{3em} +\renewcommand{\textfraction}{0.5} +\renewcommand{\topfraction}{0.5} +\renewcommand{\bottomfraction}{0.5} +\setcounter{totalnumber}{50} +\setcounter{topnumber}{50} +\setcounter{bottomnumber}{50} +% end floats for footnotes +% some commands, that could be overwritten in the style file. +\newcommand{\rubric}[1]{\subsection*{~\hfill {\it #1} \hfill ~}} +\newcommand{\titlereference}[1]{\textsl{#1}} +% end of "some commands" +\title{reStructuredText Test Document\\ +\large{Examples of Syntax Constructs} +} +\author{} +\date{} +\hypersetup{ +pdftitle={reStructuredText Test Document}, +pdfauthor={David Goodger;Me;Myself;I} +} +\raggedbottom +\begin{document} +\maketitle + +%___________________________________________________________________________ +\begin{center} +\begin{tabularx}{\docinfowidth}{lX} +\textbf{Author}: & + David Goodger \\ +\textbf{Address}: & + {\raggedright +123 Example Street~\\ +Example, EX Canada~\\ +A1B 2C3 } \\ +\textbf{Contact}: & + \href{mailto:goodger@users.sourceforge.net}{goodger@users.sourceforge.net} \\ +\textbf{Author}: & + Me \\ +\textbf{Author}: & + Myself \\ +\textbf{Author}: & + I \\ +\textbf{Organization}: & + humankind \\ +\textbf{Date}: & + Now, or yesterday. Or maybe even \emph{before} yesterday. \\ +\textbf{Status}: & + This is a ``work in progress'' \\ +\textbf{Revision}: & + is managed by a version control system. \\ +\textbf{Version}: & + 1 \\ +\textbf{Copyright}: & + This document has been placed in the public domain. You +may do with it as you wish. You may copy, modify, +redistribute, reattribute, sell, buy, rent, lease, +destroy, or improve it, quote it at length, excerpt, +incorporate, collate, fold, staple, or mutilate it, or do +anything else to it that your or anyone else's heart +desires. \\ +\textbf{field name}: & + This is a ``generic bibliographic field''. \\ +\textbf{field name ``2''}: & + Generic bibliographic fields may contain multiple body elements. + +Like this. \\ +\end{tabularx} +\end{center} + +\setlength{\locallinewidth}{\linewidth} + + +\subsubsection*{~\hfill Dedication\hfill ~} + +For Docutils users {\&} co-developers. + +\subsubsection*{~\hfill Abstract\hfill ~} + +This is a test document, containing at least one example of each +reStructuredText construct. + +% This is a comment. Note how any initial comments are moved by +% transforms to after the document title, subtitle, and docinfo. +% Above is the document title, and below is the subtitle. +% They are transformed from section titles after parsing. +% bibliographic fields (which also require a transform): +\hypertarget{table-of-contents}{} +\pdfbookmark[0]{Table of Contents}{table-of-contents} +\subsubsection*{~\hfill Table of Contents\hfill ~} +\begin{list}{}{} +\item {} \href{\#structural-elements}{1~~~Structural Elements} +\begin{list}{}{} +\item {} \href{\#section-title}{1.1~~~Section Title} + +\item {} \href{\#empty-section}{1.2~~~Empty Section} + +\item {} \href{\#transitions}{1.3~~~Transitions} + +\end{list} + +\item {} \href{\#body-elements}{2~~~Body Elements} +\begin{list}{}{} +\item {} \href{\#paragraphs}{2.1~~~Paragraphs} +\begin{list}{}{} +\item {} \href{\#inline-markup}{2.1.1~~~Inline Markup} + +\end{list} + +\item {} \href{\#bullet-lists}{2.2~~~Bullet Lists} + +\item {} \href{\#enumerated-lists}{2.3~~~Enumerated Lists} + +\item {} \href{\#definition-lists}{2.4~~~Definition Lists} + +\item {} \href{\#field-lists}{2.5~~~Field Lists} + +\item {} \href{\#option-lists}{2.6~~~Option Lists} + +\item {} \href{\#literal-blocks}{2.7~~~Literal Blocks} + +\item {} \href{\#line-blocks}{2.8~~~Line Blocks} + +\item {} \href{\#block-quotes}{2.9~~~Block Quotes} + +\item {} \href{\#doctest-blocks}{2.10~~~Doctest Blocks} + +\item {} \href{\#footnotes}{2.11~~~Footnotes} + +\item {} \href{\#citations}{2.12~~~Citations} + +\item {} \href{\#targets}{2.13~~~Targets} +\begin{list}{}{} +\item {} \href{\#duplicate-target-names}{2.13.1~~~Duplicate Target Names} + +\item {} \href{\#id20}{2.13.2~~~Duplicate Target Names} + +\end{list} + +\item {} \href{\#directives}{2.14~~~Directives} +\begin{list}{}{} +\item {} \href{\#document-parts}{2.14.1~~~Document Parts} + +\item {} \href{\#images}{2.14.2~~~Images} + +\item {} \href{\#admonitions}{2.14.3~~~Admonitions} + +\item {} \href{\#topics-sidebars-and-rubrics}{2.14.4~~~Topics, Sidebars, and Rubrics} + +\item {} \href{\#target-footnotes}{2.14.5~~~Target Footnotes} + +\item {} \href{\#replacement-text}{2.14.6~~~Replacement Text} + +\item {} \href{\#compound-paragraph}{2.14.7~~~Compound Paragraph} + +\item {} \href{\#parsed-literal-blocks}{2.14.8~~~Parsed Literal Blocks} + +\end{list} + +\item {} \href{\#substitution-definitions}{2.15~~~Substitution Definitions} + +\item {} \href{\#comments}{2.16~~~Comments} + +\item {} \href{\#raw-text}{2.17~~~Raw text} + +\item {} \href{\#container}{2.18~~~Container} + +\item {} \href{\#colspanning-tables}{2.19~~~Colspanning tables} + +\item {} \href{\#rowspanning-tables}{2.20~~~Rowspanning tables} + +\end{list} + +\item {} \href{\#tests-for-the-latex-writer}{3~~~Tests for the LaTeX writer} +\begin{list}{}{} +\item {} \href{\#monospaced-non-alphanumeric-characters}{3.1~~~Monospaced non-alphanumeric characters} + +\item {} \href{\#various-non-ascii-characters}{3.2~~~Various non-ASCII characters} + +\end{list} + +\item {} \href{\#error-handling}{4~~~Error Handling} + +\end{list} + + + +%___________________________________________________________________________ + +\hypertarget{structural-elements}{} +\pdfbookmark[0]{1~~~Structural Elements}{structural-elements} +\section*{1~~~Structural Elements} + + +%___________________________________________________________________________ + +\hypertarget{section-title}{} +\pdfbookmark[1]{1.1~~~Section Title}{section-title} +\subsection*{1.1~~~Section Title} +\textbf{Section Subtitle}\vspace{0.2cm} + +\noindent +That's it, the text just above this line. + + +%___________________________________________________________________________ + +\hypertarget{empty-section}{} +\pdfbookmark[1]{1.2~~~Empty Section}{empty-section} +\subsection*{1.2~~~Empty Section} + + +%___________________________________________________________________________ + +\hypertarget{transitions}{} +\pdfbookmark[1]{1.3~~~Transitions}{transitions} +\subsection*{1.3~~~Transitions} + +Here's a transition: + + +%___________________________________________________________________________ +\hspace*{\fill}\hrulefill\hspace*{\fill} + + +It divides the section. Transitions may also occur between sections: + + +%___________________________________________________________________________ +\hspace*{\fill}\hrulefill\hspace*{\fill} + + + +%___________________________________________________________________________ + +\hypertarget{body-elements}{} +\pdfbookmark[0]{2~~~Body Elements}{body-elements} +\section*{2~~~Body Elements} + + +%___________________________________________________________________________ + +\hypertarget{paragraphs}{} +\pdfbookmark[1]{2.1~~~Paragraphs}{paragraphs} +\subsection*{2.1~~~Paragraphs} + +A paragraph. + + +%___________________________________________________________________________ + +\hypertarget{inline-markup}{} +\pdfbookmark[2]{2.1.1~~~Inline Markup}{inline-markup} +\subsubsection*{2.1.1~~~Inline Markup} + +Paragraphs contain text and may contain inline markup: \emph{emphasis}, +\textbf{strong emphasis}, \texttt{inline literals}, standalone hyperlinks +(\href{http://www.python.org}{http://www.python.org}), external hyperlinks (\href{http://www.python.org/}{Python}\raisebox{.5em}[0em]{\scriptsize\hyperlink{id25}{5}}), internal +cross-references (\href{\#example}{example}), external hyperlinks with embedded URIs +(\href{http://www.python.org}{Python web site}), \href{http://www.python.org/}{anonymous hyperlink +references}\raisebox{.5em}[0em]{\scriptsize\hyperlink{id25}{5}} (\href{http://docutils.sourceforge.net/}{a second reference}\raisebox{.5em}[0em]{\scriptsize\hyperlink{id30}{6}}), footnote references (manually +numbered\raisebox{.5em}[0em]{\scriptsize\hyperlink{id8}{1}}, anonymous auto-numbered\raisebox{.5em}[0em]{\scriptsize\hyperlink{id11}{3}}, labeled auto-numbered\raisebox{.5em}[0em]{\scriptsize\hyperlink{label}{2}}, or symbolic\raisebox{.5em}[0em]{\scriptsize\hyperlink{id12}{*}}), citation references ([\hyperlink{cit2002}{CIT2002}]), +substitution references (\includegraphics{../../../docs/user/rst/images/biohazard.png}), and \hypertarget{inline-hyperlink-targets}{inline hyperlink targets} +(see \href{\#id22}{Targets} below for a reference back to here). Character-level +inline markup is also possible (although exceedingly ugly!) in \emph{re}\texttt{Structured}\emph{Text}. Problems are indicated by {\color{red}\bfseries{}{\textbar}problematic{\textbar}} text +(generated by processing errors; this one is intentional). Here is a +reference to the \href{\#doctitle}{doctitle} and the \href{\#subtitle}{subtitle}. + +The default role for interpreted text is \titlereference{Title Reference}. Here are +some explicit interpreted text roles: a PEP reference (\href{http://www.python.org/peps/pep-0287.html}{PEP 287}); an +RFC reference (\href{http://www.faqs.org/rfcs/rfc2822.html}{RFC 2822}); a $_{subscript}$; a $^{superscript}$; +and explicit roles for \emph{standard} \textbf{inline} +\texttt{markup}. +% DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! + +Let's test wrapping and whitespace significance in inline literals: +\texttt{This is an example of -{}-inline-literal -{}-text, -{}-including some-{}- +strangely-{}-hyphenated-words. Adjust-the-width-of-your-browser-window +to see how the text is wrapped. -{}- -{}-{}-{}- -{}-{}-{}-{}-{}-{}-{}- Now note the +spacing between the words of this sentence (words +should be grouped in pairs).} + +If the \texttt{-{}-pep-references} option was supplied, there should be a +live link to PEP 258 here. + + +%___________________________________________________________________________ + +\hypertarget{bullet-lists}{} +\pdfbookmark[1]{2.2~~~Bullet Lists}{bullet-lists} +\subsection*{2.2~~~Bullet Lists} +\begin{itemize} +\item {} +A bullet list +\begin{itemize} +\item {} +Nested bullet list. + +\item {} +Nested item 2. + +\end{itemize} + +\item {} +Item 2. + +Paragraph 2 of item 2. +\begin{itemize} +\item {} +Nested bullet list. + +\item {} +Nested item 2. +\begin{itemize} +\item {} +Third level. + +\item {} +Item 2. + +\end{itemize} + +\item {} +Nested item 3. + +\item {} +This nested list should be compacted by the HTML writer. +\hypertarget{target}{}% Even if this item contains a target and a comment. + +\end{itemize} + +\end{itemize} + + +%___________________________________________________________________________ + +\hypertarget{enumerated-lists}{} +\pdfbookmark[1]{2.3~~~Enumerated Lists}{enumerated-lists} +\subsection*{2.3~~~Enumerated Lists} +\newcounter{listcnt1} +\begin{list}{\arabic{listcnt1}.} +{ +\usecounter{listcnt1} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +Arabic numerals. +\newcounter{listcnt2} +\begin{list}{\alph{listcnt2})} +{ +\usecounter{listcnt2} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +lower alpha) +\newcounter{listcnt3} +\begin{list}{(\roman{listcnt3})} +{ +\usecounter{listcnt3} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +(lower roman) +\newcounter{listcnt4} +\begin{list}{\Alph{listcnt4}.} +{ +\usecounter{listcnt4} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +upper alpha. +\newcounter{listcnt5} +\begin{list}{\Roman{listcnt5})} +{ +\usecounter{listcnt5} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +upper roman) + +\end{list} + +\end{list} + +\end{list} + +\end{list} + +\item {} +Lists that don't start at 1: +\newcounter{listcnt6} +\begin{list}{\arabic{listcnt6}.} +{ +\usecounter{listcnt6} +\addtocounter{listcnt6}{2} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +Three + +\item {} +Four + +\end{list} +\newcounter{listcnt7} +\begin{list}{\Alph{listcnt7}.} +{ +\usecounter{listcnt7} +\addtocounter{listcnt7}{2} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +C + +\item {} +D + +\end{list} +\newcounter{listcnt8} +\begin{list}{\roman{listcnt8}.} +{ +\usecounter{listcnt8} +\addtocounter{listcnt8}{2} +\setlength{\rightmargin}{\leftmargin} +} +\item {} +iii + +\item {} +iv + +\end{list} + +\end{list} + + +%___________________________________________________________________________ + +\hypertarget{definition-lists}{} +\pdfbookmark[1]{2.4~~~Definition Lists}{definition-lists} +\subsection*{2.4~~~Definition Lists} +\begin{description} +%[visit_definition_list_item] +\item[{Term}] %[visit_definition] + +Definition + +%[depart_definition] +%[depart_definition_list_item] +%[visit_definition_list_item] +\item[{Term}] (\textbf{classifier}) +%[visit_definition] + +Definition paragraph 1. + +Definition paragraph 2. + +%[depart_definition] +%[depart_definition_list_item] +%[visit_definition_list_item] +\item[{Term}] %[visit_definition] + +Definition + +%[depart_definition] +%[depart_definition_list_item] +%[visit_definition_list_item] +\item[{Term}] (\textbf{classifier one}) +(\textbf{classifier two}) +%[visit_definition] + +Definition + +%[depart_definition] +%[depart_definition_list_item] +\end{description} + + +%___________________________________________________________________________ + +\hypertarget{field-lists}{} +\pdfbookmark[1]{2.5~~~Field Lists}{field-lists} +\subsection*{2.5~~~Field Lists} +\begin{quote} +\begin{description} +\item [what:] +Field lists map field names to field bodies, like database +records. They are often part of an extension syntax. They are +an unambiguous variant of RFC 2822 fields. + + +\item [how arg1 arg2:] +The field marker is a colon, the field name, and a colon. + +The field body may contain one or more body elements, indented +relative to the field marker. + + +\item [credits:] +This paragraph has the \titlereference{credits} class set. (This is actually not +about credits but just for ensuring that the class attribute +doesn't get stripped away.) + + +\end{description} +\end{quote} + + +%___________________________________________________________________________ + +\hypertarget{option-lists}{} +\pdfbookmark[1]{2.6~~~Option Lists}{option-lists} +\subsection*{2.6~~~Option Lists} + +For listing command-line options: +% [option list] +\begin{optionlist}{3cm} +\item [-a] +command-line option ``a'' +\item [-b file] +options can have arguments +and long descriptions +\item [-{}-long] +options can be long also +\item [-{}-input=file] +long options can also have +arguments +\item [-{}-very-long-option] +The description can also start on the next line. + +The description may contain multiple body elements, +regardless of where it starts. +\item [-x, -y, -z] +Multiple options are an ``option group''. +\item [-v, -{}-verbose] +Commonly-seen: short {\&} long options. +\item [-1 file, -{}-one=file, -{}-two file] +Multiple options with arguments. +\item [/V] +DOS/VMS-style options too +\end{optionlist} + +There must be at least two spaces between the option and the +description. + + +%___________________________________________________________________________ + +\hypertarget{literal-blocks}{} +\pdfbookmark[1]{2.7~~~Literal Blocks}{literal-blocks} +\subsection*{2.7~~~Literal Blocks} + +Literal blocks are indicated with a double-colon (``::'') at the end of +the preceding paragraph (over there \texttt{-{}->}). They can be indented: +\begin{quote}{\ttfamily \raggedright \noindent +if~literal{\_}block:~\\ +~~~~text~=~'is~left~as-is'~\\ +~~~~spaces{\_}and{\_}linebreaks~=~'are~preserved'~\\ +~~~~markup{\_}processing~=~None +}\end{quote} + +Or they can be quoted without indentation: +\begin{quote}{\ttfamily \raggedright \noindent +>{}>~Great~idea!~\\ +>~\\ +>~Why~didn't~I~think~of~that? +}\end{quote} + + +%___________________________________________________________________________ + +\hypertarget{line-blocks}{} +\pdfbookmark[1]{2.8~~~Line Blocks}{line-blocks} +\subsection*{2.8~~~Line Blocks} + +This section tests line blocks. Line blocks are body elements which +consist of lines and other line blocks. Nested line blocks cause +indentation. + +\begin{lineblock}{0em} +\item[] This is a line block. It ends with a blank line. +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] New lines begin with a vertical bar (``{\textbar}''). +\item[] Line breaks and initial indent are significant, and preserved. +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] Continuation lines are also possible. A long line that is intended +to wrap should begin with a space in place of the vertical bar. +\end{lineblock} +\item[] The left edge of a continuation line need not be aligned with +the left edge of the text above it. +\end{lineblock} +\end{lineblock} + +\begin{lineblock}{0em} +\item[] This is a second line block. +\item[] +\item[] Blank lines are permitted internally, but they must begin with a ``{\textbar}''. +\end{lineblock} + +Another line block, surrounded by paragraphs: + +\begin{lineblock}{0em} +\item[] And it's no good waiting by the window +\item[] It's no good waiting for the sun +\item[] Please believe me, the things you dream of +\item[] They don't fall in the lap of no-one +\end{lineblock} + +Take it away, Eric the Orchestra Leader! +\begin{quote} + +\begin{lineblock}{0em} +\item[] A one, two, a one two three four +\item[] +\item[] Half a bee, philosophically, +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] must, \emph{ipso facto}, half not be. +\end{lineblock} +\item[] But half the bee has got to be, +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] \emph{vis a vis} its entity. D'you see? +\item[] +\end{lineblock} +\item[] But can a bee be said to be +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] or not to be an entire bee, +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] when half the bee is not a bee, +\item[] +\begin{lineblock}{\lineblockindentation} +\item[] due to some ancient injury? +\item[] +\end{lineblock} +\end{lineblock} +\end{lineblock} +\item[] Singing... +\end{lineblock} +\end{quote} + + +%___________________________________________________________________________ + +\hypertarget{block-quotes}{} +\pdfbookmark[1]{2.9~~~Block Quotes}{block-quotes} +\subsection*{2.9~~~Block Quotes} + +Block quotes consist of indented body elements: +\begin{quote} + +My theory by A. Elk. Brackets Miss, brackets. This theory goes +as follows and begins now. All brontosauruses are thin at one +end, much much thicker in the middle and then thin again at the +far end. That is my theory, it is mine, and belongs to me and I +own it, and what it is too. + +\begin{flushright} +---Anne Elk (Miss) +\end{flushright} +\end{quote} + + +%___________________________________________________________________________ + +\hypertarget{doctest-blocks}{} +\pdfbookmark[1]{2.10~~~Doctest Blocks}{doctest-blocks} +\subsection*{2.10~~~Doctest Blocks} +\begin{verbatim}>>> print 'Python-specific usage examples; begun with ">>>"' +Python-specific usage examples; begun with ">>>" +>>> print '(cut and pasted from interactive Python sessions)' +(cut and pasted from interactive Python sessions)\end{verbatim} + + +%___________________________________________________________________________ + +\hypertarget{footnotes}{} +\pdfbookmark[1]{2.11~~~Footnotes}{footnotes} +\subsection*{2.11~~~Footnotes} +\begin{figure}[b]\hypertarget{id8}$^{1}$ +A footnote contains body elements, consistently indented by at +least 3 spaces. + +This is the footnote's second paragraph. +\end{figure} +\begin{figure}[b]\hypertarget{label}$^{2}$ +Footnotes may be numbered, either manually (as in\raisebox{.5em}[0em]{\scriptsize\hyperlink{id8}{1}}) or +automatically using a ``{\#}''-prefixed label. This footnote has a +label so it can be referred to from multiple places, both as a +footnote reference (\raisebox{.5em}[0em]{\scriptsize\hyperlink{label}{2}}) and as a hyperlink reference +(\href{\#label}{label}). +\end{figure} +\begin{figure}[b]\hypertarget{id11}$^{3}$ +This footnote is numbered automatically and anonymously using a +label of ``{\#}'' only. + +This is the second paragraph. + +And this is the third paragraph. +\end{figure} +\begin{figure}[b]\hypertarget{id12}$^{*}$ +Footnotes may also use symbols, specified with a ``*'' label. +Here's a reference to the next footnote:\raisebox{.5em}[0em]{\scriptsize\hyperlink{id14}{{\dag}}}. +\end{figure} +\begin{figure}[b]\hypertarget{id14}$^{{\dag}}$ +This footnote shows the next symbol in the sequence. +\end{figure} +\begin{figure}[b]\hypertarget{id15}$^{4}$ +Here's an unreferenced footnote, with a reference to a +nonexistent footnote:{\color{red}\bfseries{}{[}5{]}{\_}}. +\end{figure} + + +%___________________________________________________________________________ + +\hypertarget{citations}{} +\pdfbookmark[1]{2.12~~~Citations}{citations} +\subsection*{2.12~~~Citations} +\begin{figure}[b]\hypertarget{cit2002}[CIT2002] +Citations are text-labeled footnotes. They may be +rendered separately and differently from footnotes. +\end{figure} + +Here's a reference to the above, [\hyperlink{cit2002}{CIT2002}], and a {\color{red}\bfseries{}{[}nonexistent{]}{\_}} +citation. + + +%___________________________________________________________________________ + +\hypertarget{targets}{} +\hypertarget{another-target}{} +\pdfbookmark[1]{2.13~~~Targets}{targets} +\pdfbookmark[1]{2.13~~~Targets}{another-target} +\subsection*{2.13~~~Targets} + +This paragraph is pointed to by the explicit ``example'' target. A +reference can be found under \href{\#inline-markup}{Inline Markup}, above. \href{\#inline-hyperlink-targets}{Inline +hyperlink targets} are also possible. + +Section headers are implicit targets, referred to by name. See +\href{\#id22}{Targets}, which is a subsection of \href{\#body-elements}{Body Elements}. + +Explicit external targets are interpolated into references such as +``\href{http://www.python.org/}{Python}\raisebox{.5em}[0em]{\scriptsize\hyperlink{id25}{5}}''. + +Targets may be indirect and anonymous. Thus \href{\#id22}{this phrase} may also +refer to the \href{\#id22}{Targets} section. + +Here's a {\color{red}\bfseries{}`hyperlink reference without a target`{\_}}, which generates an +error. + + +%___________________________________________________________________________ + +\hypertarget{duplicate-target-names}{} +\pdfbookmark[2]{2.13.1~~~Duplicate Target Names}{duplicate-target-names} +\subsubsection*{2.13.1~~~Duplicate Target Names} + +Duplicate names in section headers or other implicit targets will +generate ``info'' (level-1) system messages. Duplicate names in +explicit targets will generate ``warning'' (level-2) system messages. + + +%___________________________________________________________________________ + +\hypertarget{id20}{} +\pdfbookmark[2]{2.13.2~~~Duplicate Target Names}{id20} +\subsubsection*{2.13.2~~~Duplicate Target Names} + +Since there are two ``Duplicate Target Names'' section headers, we +cannot uniquely refer to either of them by name. If we try to (like +this: {\color{red}\bfseries{}`Duplicate Target Names`{\_}}), an error is generated. + + +%___________________________________________________________________________ + +\hypertarget{directives}{} +\pdfbookmark[1]{2.14~~~Directives}{directives} +\subsection*{2.14~~~Directives} +\begin{list}{}{} +\item {} \href{\#document-parts}{2.14.1~~~Document Parts} + +\item {} \href{\#images}{2.14.2~~~Images} + +\item {} \href{\#admonitions}{2.14.3~~~Admonitions} + +\item {} \href{\#topics-sidebars-and-rubrics}{2.14.4~~~Topics, Sidebars, and Rubrics} + +\item {} \href{\#target-footnotes}{2.14.5~~~Target Footnotes} + +\item {} \href{\#replacement-text}{2.14.6~~~Replacement Text} + +\item {} \href{\#compound-paragraph}{2.14.7~~~Compound Paragraph} + +\item {} \href{\#parsed-literal-blocks}{2.14.8~~~Parsed Literal Blocks} + +\end{list} + + +These are just a sample of the many reStructuredText Directives. For +others, please see +\href{http://docutils.sourceforge.net/docs/ref/rst/directives.html}{http://docutils.sourceforge.net/docs/ref/rst/directives.html}. + + +%___________________________________________________________________________ + +\hypertarget{document-parts}{} +\pdfbookmark[2]{2.14.1~~~Document Parts}{document-parts} +\subsubsection*{2.14.1~~~Document Parts} + +An example of the ``contents'' directive can be seen above this section +(a local, untitled table of \href{\#contents}{contents}) and at the beginning of the +document (a document-wide \href{\#table-of-contents}{table of contents}). + + +%___________________________________________________________________________ + +\hypertarget{images}{} +\pdfbookmark[2]{2.14.2~~~Images}{images} +\subsubsection*{2.14.2~~~Images} + +An image directive (also clickable -{}- a hyperlink reference): +\href{\#directives}{\includegraphics{../../../docs/user/rst/images/title.png}} +Image with multiple IDs: + +\includegraphics{../../../docs/user/rst/images/title.png} + +A centered image: + +{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill} + +A left-aligned image: + +{\includegraphics{../../../docs/user/rst/images/biohazard.png}\hfill} + +A right-aligned image: + +{\hfill\includegraphics{../../../docs/user/rst/images/biohazard.png}} + +A figure directive: +\begin{figure}[htbp]\begin{flushright} + +\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png} +\caption{A figure is an image with a caption and/or a legend:}{\small +\begin{longtable}[c]{|p{0.16\locallinewidth}|p{0.56\locallinewidth}|} +\hline + +re + & +Revised, revisited, based on 're' module. + \\ +\hline + +Structured + & +Structure-enhanced text, structuredtext. + \\ +\hline + +Text + & +Well it is, isn't it? + \\ +\hline +\end{longtable} + +This paragraph is also part of the legend. +}\end{flushright}\end{figure} +\begin{figure}[htbp]\begin{flushleft} + +\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png} +\caption{A left-aligned figure.}{\small +This is the legend. +}\end{flushleft}\end{figure} + +This paragraph might flow around the figure... + +A centered figure: +\begin{figure}[htbp]\begin{flushcenter} + +\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png} +\caption{This is the caption.}{\small +This is the legend. + +The legend may consist of several paragraphs. +}\end{flushcenter}\end{figure} + +This paragraph might flow around the figure... + +A left-aligned figure: +\begin{figure}[htbp]\begin{flushleft} + +\includegraphics[width=50]{../../../docs/user/rst/images/biohazard.png} +\caption{This is the caption.}{\small +This is the legend. + +The legend may consist of several paragraphs. +}\end{flushleft}\end{figure} + +This paragraph might flow around the figure... + +Now widths: + +An image 2 em wide: + +\includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png} + +An image 2 em wide and 30 pixel high: + +\includegraphics[width=2em]{../../../docs/user/rst/images/biohazard.png} + +An image occupying 70{\%} of the line width: + +\includegraphics[width=70%]{../../../docs/user/rst/images/biohazard.png} + +An image 3 cm high: + +\includegraphics{../../../docs/user/rst/images/biohazard.png} + + +%___________________________________________________________________________ + +\hypertarget{admonitions}{} +\pdfbookmark[2]{2.14.3~~~Admonitions}{admonitions} +\subsubsection*{2.14.3~~~Admonitions} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Attention!} +\vspace{2mm} + +Directives at large. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Caution!} +\vspace{2mm} + +Don't take any wooden nickels. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large !DANGER!} +\vspace{2mm} + +Mad scientist at work! +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Error} +\vspace{2mm} + +Does not compute. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Hint} +\vspace{2mm} + +It's bigger than a bread box. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Important} +\vspace{2mm} +\begin{itemize} +\item {} +Wash behind your ears. + +\item {} +Clean up your room. + +\item {} +Call your mother. + +\item {} +Back up your data. + +\end{itemize} +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Note} +\vspace{2mm} + +This is a note. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Tip} +\vspace{2mm} + +15{\%} if the service is good. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\textbf{\large Warning} +\vspace{2mm} + +Strong prose may provoke extreme mental exertion. +Reader discretion is strongly advised. +}} +\end{sffamily} +\end{center} +\begin{center}\begin{sffamily} +\fbox{\parbox{\admonitionwidth}{ +\vspace{2mm} +\textbf{\large And, by the way...} +\smallskip + +You can make up your own admonition too. +}} +\end{sffamily} +\end{center} + + +%___________________________________________________________________________ + +\hypertarget{topics-sidebars-and-rubrics}{} +\pdfbookmark[2]{2.14.4~~~Topics, Sidebars, and Rubrics}{topics-sidebars-and-rubrics} +\subsubsection*{2.14.4~~~Topics, Sidebars, and Rubrics} + +\setlength{\locallinewidth}{0.9\admonitionwidth} +\begin{center}\begin{sffamily} +\fbox{\colorbox[gray]{0.80}{\parbox{\admonitionwidth}{ +\textbf{\large Sidebar Title} +\smallskip +~\\ +\textbf{Optional Subtitle} +\smallskip + +This is a sidebar. It is for text outside the flow of the main +text. +\rubric{This is a rubric inside a sidebar} + +Sidebars often appears beside the main text with a border and +background color. +}}} +\end{sffamily} +\end{center} + +\setlength{\locallinewidth}{\linewidth} +\subsubsection*{~\hfill Topic Title\hfill ~} + +This is a topic. + +\rubric{This is a rubric} + + +%___________________________________________________________________________ + +\hypertarget{target-footnotes}{} +\pdfbookmark[2]{2.14.5~~~Target Footnotes}{target-footnotes} +\subsubsection*{2.14.5~~~Target Footnotes} +\begin{figure}[b]\hypertarget{id25}$^{5}$ +\href{http://www.python.org/}{http://www.python.org/} +\end{figure} +\begin{figure}[b]\hypertarget{id30}$^{6}$ +\href{http://docutils.sourceforge.net/}{http://docutils.sourceforge.net/} +\end{figure} + + +%___________________________________________________________________________ + +\hypertarget{replacement-text}{} +\pdfbookmark[2]{2.14.6~~~Replacement Text}{replacement-text} +\subsubsection*{2.14.6~~~Replacement Text} + +I recommend you try \href{http://www.python.org/}{Python, \emph{the} best language around}\raisebox{.5em}[0em]{\scriptsize\hyperlink{id25}{5}}. + + +%___________________________________________________________________________ + +\hypertarget{compound-paragraph}{} +\pdfbookmark[2]{2.14.7~~~Compound Paragraph}{compound-paragraph} +\subsubsection*{2.14.7~~~Compound Paragraph} + +Compound 1, paragraph 1. + +Compound 1, paragraph 2. +\begin{itemize} +\item {} +Compound 1, list item one. + +\item {} +Compound 1, list item two. + +\end{itemize} + +Another compound statement: + +Compound 2, a literal block: +\begin{quote}{\ttfamily \raggedright \noindent +Compound~2,~literal. +}\end{quote} +Compound 2, this is a test. + +Compound 3, only consisting of one paragraph. +\begin{quote}{\ttfamily \raggedright \noindent +Compound~4.~\\ +This~one~starts~with~a~literal~block. +}\end{quote} +Compound 4, a paragraph. + +Now something \emph{really} perverted -{}- a nested compound block. This is +just to test that it works at all; the results don't have to be +meaningful. + +Compound 5, block 1 (a paragraph). + +Compound 6, block 2 in compound 5. + +Compound 6, another paragraph. + +Compound 5, block 3 (a paragraph). + +Compound 7, with a table inside: + +\begin{longtable}[c]{|p{0.25\locallinewidth}|p{0.25\locallinewidth}|p{0.25\locallinewidth}|} +\hline + +Left cell, first +paragraph. + +Left cell, second +paragraph. + & +Middle cell, +consisting of +exactly one +paragraph. + & +Right cell. + +Paragraph 2. + +Paragraph 3. + \\ +\hline +\end{longtable} +Compound 7, a paragraph after the table. + +Compound 7, another paragraph. + + +%___________________________________________________________________________ + +\hypertarget{parsed-literal-blocks}{} +\pdfbookmark[2]{2.14.8~~~Parsed Literal Blocks}{parsed-literal-blocks} +\subsubsection*{2.14.8~~~Parsed Literal Blocks} +\begin{quote}{\ttfamily \raggedright \noindent +This~is~a~parsed~literal~block.~\\ +~~~~This~line~is~indented.~~The~next~line~is~blank.~\\ +~\\ +Inline~markup~is~supported,~e.g.~\emph{emphasis},~\textbf{strong},~\texttt{literal~\\ +text},~footnotes\raisebox{.5em}[0em]{\scriptsize\hyperlink{id8}{1}},~\hypertarget{id22}{targets},~and~\href{http://www.python.org/}{references}. +}\end{quote} + + +%___________________________________________________________________________ + +\hypertarget{substitution-definitions}{} +\pdfbookmark[1]{2.15~~~Substitution Definitions}{substitution-definitions} +\subsection*{2.15~~~Substitution Definitions} + +An inline image (\includegraphics{../../../docs/user/rst/images/biohazard.png}) example: + +(Substitution definitions are not visible in the HTML source.) + + +%___________________________________________________________________________ + +\hypertarget{comments}{} +\pdfbookmark[1]{2.16~~~Comments}{comments} +\subsection*{2.16~~~Comments} + +Here's one: +% Comments begin with two dots and a space. Anything may +% follow, except for the syntax of footnotes, hyperlink +% targets, directives, or substitution definitions. +% +% Double-dashes -- "--" -- must be escaped somehow in HTML output. + +(View the HTML source to see the comment.) + + +%___________________________________________________________________________ + +\hypertarget{raw-text}{} +\pdfbookmark[1]{2.17~~~Raw text}{raw-text} +\subsection*{2.17~~~Raw text} + +This does not necessarily look nice, because there may be missing white space. + +It's just there to freeze the behavior. +A test.Second test.Another test with myclass set. +This is the fourth test with myrawroleclass set. +Fifth test in LaTeX.\\Line two. + +%___________________________________________________________________________ + +\hypertarget{container}{} +\pdfbookmark[1]{2.18~~~Container}{container} +\subsection*{2.18~~~Container} + +paragraph 1 + +paragraph 2 + + +%___________________________________________________________________________ + +\hypertarget{colspanning-tables}{} +\pdfbookmark[1]{2.19~~~Colspanning tables}{colspanning-tables} +\subsection*{2.19~~~Colspanning tables} + +This table has a cell spanning two columns: + +\begin{longtable}[c]{|p{0.07\locallinewidth}|p{0.07\locallinewidth}|p{0.09\locallinewidth}|} +\hline +\multicolumn{2}{|l|}{\textbf{ +Inputs +}} & \textbf{ +Output +} \\ +\hline +\textbf{ +A +} & \textbf{ +B +} & \textbf{ +A or B +} \\ +\hline +\endhead + +False + & +False + & +False + \\ +\hline + +True + & +False + & +True + \\ +\hline + +False + & +True + & +True + \\ +\hline + +True + & +True + & +True + \\ +\hline +\end{longtable} + + +%___________________________________________________________________________ + +\hypertarget{rowspanning-tables}{} +\pdfbookmark[1]{2.20~~~Rowspanning tables}{rowspanning-tables} +\subsection*{2.20~~~Rowspanning tables} + +Here's a table with cells spanning several rows: + +\begin{longtable}[c]{|p{0.30\locallinewidth}|p{0.16\locallinewidth}|p{0.23\locallinewidth}|} +\hline +\textbf{ +Header row, column 1 +(header rows optional) +} & \textbf{ +Header 2 +} & \textbf{ +Header 3 +} \\ +\hline +\endhead + +body row 1, column 1 + & +column 2 + & +column 3 + \\ +\hline + +body row 2 + & \multirow{2}{0.16\locallinewidth}{ +Cells may +span rows. +} & \multirow{2}{0.23\locallinewidth}{ +Another +rowspanning +cell. +} \\ +\cline{1-1} + +body row 3 + & \\ +\hline +\end{longtable} + + +%___________________________________________________________________________ + +\hypertarget{tests-for-the-latex-writer}{} +\pdfbookmark[0]{3~~~Tests for the LaTeX writer}{tests-for-the-latex-writer} +\section*{3~~~Tests for the LaTeX writer} + + +%___________________________________________________________________________ + +\hypertarget{monospaced-non-alphanumeric-characters}{} +\pdfbookmark[1]{3.1~~~Monospaced non-alphanumeric characters}{monospaced-non-alphanumeric-characters} +\subsection*{3.1~~~Monospaced non-alphanumeric characters} + +These are all ASCII characters except a-zA-Z0-9 and space: + +\texttt{!!!"{}"{}"{\#}{\#}{\#}{\$}{\$}{\$}{\%}{\%}{\%}{\&}{\&}{\&}'{}'{}'((()))***+++,{},{},-{}-{}-...///:::} + +\texttt{;;;<{}<{}<===>{}>{}>???@@@{[}{[}{[}{\textbackslash}{\textbackslash}{\textbackslash}{]}{]}{]}{\textasciicircum}{\textasciicircum}{\textasciicircum}{\_}{\_}{\_}`{}`{}`{\{}{\{}{\{}|||{\}}{\}}{\}}{\textasciitilde}{\textasciitilde}{\textasciitilde}} + +\texttt{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} + +The two lines of non-alphanumeric characters should both have the same +width as the third line. + + +%___________________________________________________________________________ + +\hypertarget{various-non-ascii-characters}{} +\pdfbookmark[1]{3.2~~~Various non-ASCII characters}{various-non-ascii-characters} +\subsection*{3.2~~~Various non-ASCII characters} + +\begin{longtable}[c]{|p{0.03\locallinewidth}|p{0.42\locallinewidth}|} +\hline + + + & +copyright sign + \\ +\hline + + + & +registered sign + \\ +\hline + + + & +left pointing guillemet + \\ +\hline + + + & +right pointing guillemet + \\ +\hline + +{--} + & +en-dash + \\ +\hline + +{---} + & +em-dash + \\ +\hline + +` + & +single turned comma quotation mark + \\ +\hline + +' + & +single comma quotation mark + \\ +\hline + +, + & +low single comma quotation mark + \\ +\hline + +`` + & +double turned comma quotation mark + \\ +\hline + +'' + & +double comma quotation mark + \\ +\hline + +,, + & +low double comma quotation mark + \\ +\hline + +{\dag} + & +dagger + \\ +\hline + +{\ddag} + & +double dagger + \\ +\hline + +{\dots} + & +ellipsis + \\ +\hline + +{\texttrademark} + & +trade mark sign + \\ +\hline + +{$\Leftrightarrow$} + & +left-right double arrow + \\ +\hline +\end{longtable} + +The following line should not be wrapped, because it uses +non-breakable spaces: + +X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X + + +%___________________________________________________________________________ + +\hypertarget{error-handling}{} +\pdfbookmark[0]{4~~~Error Handling}{error-handling} +\section*{4~~~Error Handling} + +Any errors caught during processing will generate system messages. + +There should be five messages in the following, auto-generated +section, ``Docutils System Messages'': +% section should be added by Docutils automatically + + +%___________________________________________________________________________ + +\section*{Docutils System Messages} + +Undefined substitution referenced: ``problematic''. + + +Unknown target name: ``5''. + + +Unknown target name: ``nonexistent''. + + +Unknown target name: ``hyperlink reference without a target''. + + +Duplicate target name, cannot be used as a unique reference: ``duplicate target names''. + + +\end{document} diff --git a/test/functional/expected/standalone_rst_pseudoxml.txt b/test/functional/expected/standalone_rst_pseudoxml.txt new file mode 100644 index 000000000..193f8c37c --- /dev/null +++ b/test/functional/expected/standalone_rst_pseudoxml.txt @@ -0,0 +1,1841 @@ +<document ids="restructuredtext-test-document doctitle" names="restructuredtext\ test\ document doctitle" source="functional/input/standalone_rst_pseudoxml.txt" title="reStructuredText Test Document"> + <title> + reStructuredText Test Document + <subtitle ids="examples-of-syntax-constructs subtitle" names="examples\ of\ syntax\ constructs subtitle"> + Examples of Syntax Constructs + <decoration> + <header> + <paragraph> + Document header + <footer> + <paragraph> + Document footer + <docinfo> + <author> + David Goodger + <address xml:space="preserve"> + 123 Example Street + Example, EX Canada + A1B 2C3 + <contact> + <reference refuri="mailto:goodger@users.sourceforge.net"> + goodger@users.sourceforge.net + <authors> + <author> + Me + <author> + Myself + <author> + I + <organization> + humankind + <date> + Now, or yesterday. Or maybe even + <emphasis> + before + yesterday. + <status> + This is a "work in progress" + <revision> + is managed by a version control system. + <version> + 1 + <copyright> + This document has been placed in the public domain. You + may do with it as you wish. You may copy, modify, + redistribute, reattribute, sell, buy, rent, lease, + destroy, or improve it, quote it at length, excerpt, + incorporate, collate, fold, staple, or mutilate it, or do + anything else to it that your or anyone else's heart + desires. + <field> + <field_name> + field name + <field_body> + <paragraph> + This is a "generic bibliographic field". + <field> + <field_name> + field name "2" + <field_body> + <paragraph> + Generic bibliographic fields may contain multiple body elements. + <paragraph> + Like this. + <topic classes="dedication"> + <title> + Dedication + <paragraph> + For Docutils users & co-developers. + <topic classes="abstract"> + <title> + Abstract + <paragraph> + This is a test document, containing at least one example of each + reStructuredText construct. + <comment xml:space="preserve"> + This is a comment. Note how any initial comments are moved by + transforms to after the document title, subtitle, and docinfo. + <target refid="doctitle"> + <comment xml:space="preserve"> + Above is the document title, and below is the subtitle. + They are transformed from section titles after parsing. + <target refid="subtitle"> + <comment xml:space="preserve"> + bibliographic fields (which also require a transform): + <meta content="reStructuredText, test, parser" name="keywords"> + <meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description"> + <topic classes="contents" ids="table-of-contents" names="table\ of\ contents"> + <title> + Table of Contents + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id32" refid="structural-elements"> + <generated classes="sectnum"> + 1 + Structural Elements + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id33" refid="section-title"> + <generated classes="sectnum"> + 1.1 + Section Title + <list_item> + <paragraph> + <reference ids="id34" refid="empty-section"> + <generated classes="sectnum"> + 1.2 + Empty Section + <list_item> + <paragraph> + <reference ids="id35" refid="transitions"> + <generated classes="sectnum"> + 1.3 + Transitions + <list_item> + <paragraph> + <reference ids="id36" refid="body-elements"> + <generated classes="sectnum"> + 2 + Body Elements + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id37" refid="paragraphs"> + <generated classes="sectnum"> + 2.1 + Paragraphs + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id38" refid="inline-markup"> + <generated classes="sectnum"> + 2.1.1 + Inline Markup + <list_item> + <paragraph> + <reference ids="id39" refid="bullet-lists"> + <generated classes="sectnum"> + 2.2 + Bullet Lists + <list_item> + <paragraph> + <reference ids="id40" refid="enumerated-lists"> + <generated classes="sectnum"> + 2.3 + Enumerated Lists + <list_item> + <paragraph> + <reference ids="id41" refid="definition-lists"> + <generated classes="sectnum"> + 2.4 + Definition Lists + <list_item> + <paragraph> + <reference ids="id42" refid="field-lists"> + <generated classes="sectnum"> + 2.5 + Field Lists + <list_item> + <paragraph> + <reference ids="id43" refid="option-lists"> + <generated classes="sectnum"> + 2.6 + Option Lists + <list_item> + <paragraph> + <reference ids="id44" refid="literal-blocks"> + <generated classes="sectnum"> + 2.7 + Literal Blocks + <list_item> + <paragraph> + <reference ids="id45" refid="line-blocks"> + <generated classes="sectnum"> + 2.8 + Line Blocks + <list_item> + <paragraph> + <reference ids="id46" refid="block-quotes"> + <generated classes="sectnum"> + 2.9 + Block Quotes + <list_item> + <paragraph> + <reference ids="id47" refid="doctest-blocks"> + <generated classes="sectnum"> + 2.10 + Doctest Blocks + <list_item> + <paragraph> + <reference ids="id48" refid="footnotes"> + <generated classes="sectnum"> + 2.11 + Footnotes + <list_item> + <paragraph> + <reference ids="id49" refid="citations"> + <generated classes="sectnum"> + 2.12 + Citations + <list_item> + <paragraph> + <reference ids="id50" refid="targets"> + <generated classes="sectnum"> + 2.13 + Targets + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id51" refid="duplicate-target-names"> + <generated classes="sectnum"> + 2.13.1 + Duplicate Target Names + <list_item> + <paragraph> + <reference ids="id52" refid="id20"> + <generated classes="sectnum"> + 2.13.2 + Duplicate Target Names + <list_item> + <paragraph> + <reference ids="id53" refid="directives"> + <generated classes="sectnum"> + 2.14 + Directives + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id54" refid="document-parts"> + <generated classes="sectnum"> + 2.14.1 + Document Parts + <list_item> + <paragraph> + <reference ids="id55" refid="images"> + <generated classes="sectnum"> + 2.14.2 + Images + <list_item> + <paragraph> + <reference ids="id56" refid="admonitions"> + <generated classes="sectnum"> + 2.14.3 + Admonitions + <list_item> + <paragraph> + <reference ids="id57" refid="topics-sidebars-and-rubrics"> + <generated classes="sectnum"> + 2.14.4 + Topics, Sidebars, and Rubrics + <list_item> + <paragraph> + <reference ids="id58" refid="target-footnotes"> + <generated classes="sectnum"> + 2.14.5 + Target Footnotes + <list_item> + <paragraph> + <reference ids="id59" refid="replacement-text"> + <generated classes="sectnum"> + 2.14.6 + Replacement Text + <list_item> + <paragraph> + <reference ids="id60" refid="compound-paragraph"> + <generated classes="sectnum"> + 2.14.7 + Compound Paragraph + <list_item> + <paragraph> + <reference ids="id61" refid="parsed-literal-blocks"> + <generated classes="sectnum"> + 2.14.8 + Parsed Literal Blocks + <list_item> + <paragraph> + <reference ids="id62" refid="substitution-definitions"> + <generated classes="sectnum"> + 2.15 + Substitution Definitions + <list_item> + <paragraph> + <reference ids="id63" refid="comments"> + <generated classes="sectnum"> + 2.16 + Comments + <list_item> + <paragraph> + <reference ids="id64" refid="raw-text"> + <generated classes="sectnum"> + 2.17 + Raw text + <list_item> + <paragraph> + <reference ids="id65" refid="container"> + <generated classes="sectnum"> + 2.18 + Container + <list_item> + <paragraph> + <reference ids="id66" refid="colspanning-tables"> + <generated classes="sectnum"> + 2.19 + Colspanning tables + <list_item> + <paragraph> + <reference ids="id67" refid="rowspanning-tables"> + <generated classes="sectnum"> + 2.20 + Rowspanning tables + <list_item> + <paragraph> + <reference ids="id68" refid="complex-tables"> + <generated classes="sectnum"> + 2.21 + Complex tables + <list_item> + <paragraph> + <reference ids="id69" refid="list-tables"> + <generated classes="sectnum"> + 2.22 + List Tables + <list_item> + <paragraph> + <reference ids="id70" refid="error-handling"> + <generated classes="sectnum"> + 3 + Error Handling + <section ids="structural-elements" names="structural\ elements"> + <title auto="1" refid="id32"> + <generated classes="sectnum"> + 1 + Structural Elements + <section ids="section-title" names="section\ title"> + <title auto="1" refid="id33"> + <generated classes="sectnum"> + 1.1 + Section Title + <subtitle ids="section-subtitle" names="section\ subtitle"> + Section Subtitle + <paragraph> + That's it, the text just above this line. + <section ids="empty-section" names="empty\ section"> + <title auto="1" refid="id34"> + <generated classes="sectnum"> + 1.2 + Empty Section + <section ids="transitions" names="transitions"> + <title auto="1" refid="id35"> + <generated classes="sectnum"> + 1.3 + Transitions + <paragraph> + Here's a transition: + <transition> + <paragraph> + It divides the section. Transitions may also occur between sections: + <transition> + <section ids="body-elements" names="body\ elements"> + <title auto="1" refid="id36"> + <generated classes="sectnum"> + 2 + Body Elements + <section ids="paragraphs" names="paragraphs"> + <title auto="1" refid="id37"> + <generated classes="sectnum"> + 2.1 + Paragraphs + <paragraph> + A paragraph. + <section ids="inline-markup" names="inline\ markup"> + <title auto="1" refid="id38"> + <generated classes="sectnum"> + 2.1.1 + Inline Markup + <paragraph> + Paragraphs contain text and may contain inline markup: + <emphasis> + emphasis + , + <strong> + strong emphasis + , + <literal> + inline literals + , standalone hyperlinks + ( + <reference refuri="http://www.python.org"> + http://www.python.org + ), external hyperlinks ( + <reference name="Python" refuri="http://www.python.org/"> + Python + + <footnote_reference auto="1" ids="id26" refid="id25"> + 5 + ), internal + cross-references ( + <reference name="example" refid="example"> + example + ), external hyperlinks with embedded URIs + ( + <reference name="Python web site" refuri="http://www.python.org"> + Python web site + ), + <reference anonymous="1" name="anonymous hyperlink references" refuri="http://www.python.org/"> + anonymous hyperlink + references + + <footnote_reference auto="1" ids="id29" refid="id25"> + 5 + ( + <reference anonymous="1" name="a second reference" refuri="http://docutils.sourceforge.net/"> + a second reference + + <footnote_reference auto="1" ids="id31" refid="id30"> + 6 + ), footnote references (manually + numbered + <footnote_reference ids="id1" refid="id8"> + 1 + , anonymous auto-numbered + <footnote_reference auto="1" ids="id2" refid="id11"> + 3 + , labeled auto-numbered + <footnote_reference auto="1" ids="id3" refid="label"> + 2 + , or symbolic + <footnote_reference auto="*" ids="id4" refid="id12"> + * + ), citation references ( + <citation_reference ids="id5" refid="cit2002"> + CIT2002 + ), + substitution references ( + <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"> + ), and + <target ids="inline-hyperlink-targets" names="inline\ hyperlink\ targets"> + inline hyperlink targets + + (see + <reference name="Targets" refid="id22"> + Targets + below for a reference back to here). Character-level + inline markup is also possible (although exceedingly ugly!) in + <emphasis> + re + <literal> + Structured + <emphasis> + Text + . Problems are indicated by + <problematic ids="id24" refid="id23"> + |problematic| + text + (generated by processing errors; this one is intentional). Here is a + reference to the + <reference name="doctitle" refid="doctitle"> + doctitle + and the + <reference name="subtitle" refid="subtitle"> + subtitle + . + <target anonymous="1" ids="id6" refuri="http://www.python.org/"> + <target anonymous="1" ids="id7" refuri="http://docutils.sourceforge.net/"> + <paragraph> + The default role for interpreted text is + <title_reference> + Title Reference + . Here are + some explicit interpreted text roles: a PEP reference ( + <reference refuri="http://www.python.org/peps/pep-0287.html"> + PEP 287 + ); an + RFC reference ( + <reference refuri="http://www.faqs.org/rfcs/rfc2822.html"> + RFC 2822 + ); a + <subscript> + subscript + ; a + <superscript> + superscript + ; + and explicit roles for + <emphasis> + standard + + <strong> + inline + + <literal> + markup + . + <comment xml:space="preserve"> + DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! + <paragraph> + Let's test wrapping and whitespace significance in inline literals: + <literal> + This is an example of --inline-literal --text, --including some-- + strangely--hyphenated-words. Adjust-the-width-of-your-browser-window + to see how the text is wrapped. -- ---- -------- Now note the + spacing between the words of this sentence (words + should be grouped in pairs). + <paragraph> + If the + <literal> + --pep-references + option was supplied, there should be a + live link to PEP 258 here. + <section ids="bullet-lists" names="bullet\ lists"> + <title auto="1" refid="id39"> + <generated classes="sectnum"> + 2.2 + Bullet Lists + <bullet_list bullet="-"> + <list_item> + <paragraph> + A bullet list + <bullet_list bullet="+"> + <list_item> + <paragraph> + Nested bullet list. + <list_item> + <paragraph> + Nested item 2. + <list_item> + <paragraph> + Item 2. + <paragraph> + Paragraph 2 of item 2. + <bullet_list bullet="*"> + <list_item> + <paragraph> + Nested bullet list. + <list_item> + <paragraph> + Nested item 2. + <bullet_list bullet="-"> + <list_item> + <paragraph> + Third level. + <list_item> + <paragraph> + Item 2. + <list_item> + <paragraph> + Nested item 3. + <list_item> + <paragraph> + This nested list should be compacted by the HTML writer. + <target ids="target" names="target"> + <comment xml:space="preserve"> + Even if this item contains a target and a comment. + <section ids="enumerated-lists" names="enumerated\ lists"> + <title auto="1" refid="id40"> + <generated classes="sectnum"> + 2.3 + Enumerated Lists + <enumerated_list enumtype="arabic" prefix="" suffix="."> + <list_item> + <paragraph> + Arabic numerals. + <enumerated_list enumtype="loweralpha" prefix="" suffix=")"> + <list_item> + <paragraph> + lower alpha) + <enumerated_list enumtype="lowerroman" prefix="(" suffix=")"> + <list_item> + <paragraph> + (lower roman) + <enumerated_list enumtype="upperalpha" prefix="" suffix="."> + <list_item> + <paragraph> + upper alpha. + <enumerated_list enumtype="upperroman" prefix="" suffix=")"> + <list_item> + <paragraph> + upper roman) + <list_item> + <paragraph> + Lists that don't start at 1: + <enumerated_list enumtype="arabic" prefix="" start="3" suffix="."> + <list_item> + <paragraph> + Three + <list_item> + <paragraph> + Four + <enumerated_list enumtype="upperalpha" prefix="" start="3" suffix="."> + <list_item> + <paragraph> + C + <list_item> + <paragraph> + D + <enumerated_list enumtype="lowerroman" prefix="" start="3" suffix="."> + <list_item> + <paragraph> + iii + <list_item> + <paragraph> + iv + <section ids="definition-lists" names="definition\ lists"> + <title auto="1" refid="id41"> + <generated classes="sectnum"> + 2.4 + Definition Lists + <definition_list> + <definition_list_item> + <term> + Term + <definition> + <paragraph> + Definition + <definition_list_item> + <term> + Term + <classifier> + classifier + <definition> + <paragraph> + Definition paragraph 1. + <paragraph> + Definition paragraph 2. + <definition_list_item> + <term> + Term + <definition> + <paragraph> + Definition + <definition_list_item> + <term> + Term + <classifier> + classifier one + <classifier> + classifier two + <definition> + <paragraph> + Definition + <section ids="field-lists" names="field\ lists"> + <title auto="1" refid="id42"> + <generated classes="sectnum"> + 2.5 + Field Lists + <field_list> + <field> + <field_name> + what + <field_body> + <paragraph> + Field lists map field names to field bodies, like database + records. They are often part of an extension syntax. They are + an unambiguous variant of RFC 2822 fields. + <field> + <field_name> + how arg1 arg2 + <field_body> + <paragraph> + The field marker is a colon, the field name, and a colon. + <paragraph> + The field body may contain one or more body elements, indented + relative to the field marker. + <field> + <field_name> + credits + <field_body> + <paragraph classes="credits"> + This paragraph has the + <title_reference> + credits + class set. (This is actually not + about credits but just for ensuring that the class attribute + doesn't get stripped away.) + <section ids="option-lists" names="option\ lists"> + <title auto="1" refid="id43"> + <generated classes="sectnum"> + 2.6 + Option Lists + <paragraph> + For listing command-line options: + <option_list> + <option_list_item> + <option_group> + <option> + <option_string> + -a + <description> + <paragraph> + command-line option "a" + <option_list_item> + <option_group> + <option> + <option_string> + -b + <option_argument delimiter=" "> + file + <description> + <paragraph> + options can have arguments + and long descriptions + <option_list_item> + <option_group> + <option> + <option_string> + --long + <description> + <paragraph> + options can be long also + <option_list_item> + <option_group> + <option> + <option_string> + --input + <option_argument delimiter="="> + file + <description> + <paragraph> + long options can also have + arguments + <option_list_item> + <option_group> + <option> + <option_string> + --very-long-option + <description> + <paragraph> + The description can also start on the next line. + <paragraph> + The description may contain multiple body elements, + regardless of where it starts. + <option_list_item> + <option_group> + <option> + <option_string> + -x + <option> + <option_string> + -y + <option> + <option_string> + -z + <description> + <paragraph> + Multiple options are an "option group". + <option_list_item> + <option_group> + <option> + <option_string> + -v + <option> + <option_string> + --verbose + <description> + <paragraph> + Commonly-seen: short & long options. + <option_list_item> + <option_group> + <option> + <option_string> + -1 + <option_argument delimiter=" "> + file + <option> + <option_string> + --one + <option_argument delimiter="="> + file + <option> + <option_string> + --two + <option_argument delimiter=" "> + file + <description> + <paragraph> + Multiple options with arguments. + <option_list_item> + <option_group> + <option> + <option_string> + /V + <description> + <paragraph> + DOS/VMS-style options too + <paragraph> + There must be at least two spaces between the option and the + description. + <section ids="literal-blocks" names="literal\ blocks"> + <title auto="1" refid="id44"> + <generated classes="sectnum"> + 2.7 + Literal Blocks + <paragraph> + Literal blocks are indicated with a double-colon ("::") at the end of + the preceding paragraph (over there + <literal> + --> + ). They can be indented: + <literal_block xml:space="preserve"> + if literal_block: + text = 'is left as-is' + spaces_and_linebreaks = 'are preserved' + markup_processing = None + <paragraph> + Or they can be quoted without indentation: + <literal_block xml:space="preserve"> + >> Great idea! + > + > Why didn't I think of that? + <section ids="line-blocks" names="line\ blocks"> + <title auto="1" refid="id45"> + <generated classes="sectnum"> + 2.8 + Line Blocks + <paragraph> + This section tests line blocks. Line blocks are body elements which + consist of lines and other line blocks. Nested line blocks cause + indentation. + <line_block> + <line> + This is a line block. It ends with a blank line. + <line_block> + <line> + New lines begin with a vertical bar ("|"). + <line> + Line breaks and initial indent are significant, and preserved. + <line_block> + <line> + Continuation lines are also possible. A long line that is intended + to wrap should begin with a space in place of the vertical bar. + <line> + The left edge of a continuation line need not be aligned with + the left edge of the text above it. + <line_block> + <line> + This is a second line block. + <line> + <line> + Blank lines are permitted internally, but they must begin with a "|". + <paragraph> + Another line block, surrounded by paragraphs: + <line_block> + <line> + And it's no good waiting by the window + <line> + It's no good waiting for the sun + <line> + Please believe me, the things you dream of + <line> + They don't fall in the lap of no-one + <paragraph> + Take it away, Eric the Orchestra Leader! + <block_quote> + <line_block> + <line> + A one, two, a one two three four + <line> + <line> + Half a bee, philosophically, + <line_block> + <line> + must, + <emphasis> + ipso facto + , half not be. + <line> + But half the bee has got to be, + <line_block> + <line> + <emphasis> + vis a vis + its entity. D'you see? + <line> + <line> + But can a bee be said to be + <line_block> + <line> + or not to be an entire bee, + <line_block> + <line> + when half the bee is not a bee, + <line_block> + <line> + due to some ancient injury? + <line> + <line> + Singing... + <section ids="block-quotes" names="block\ quotes"> + <title auto="1" refid="id46"> + <generated classes="sectnum"> + 2.9 + Block Quotes + <paragraph> + Block quotes consist of indented body elements: + <block_quote> + <paragraph> + My theory by A. Elk. Brackets Miss, brackets. This theory goes + as follows and begins now. All brontosauruses are thin at one + end, much much thicker in the middle and then thin again at the + far end. That is my theory, it is mine, and belongs to me and I + own it, and what it is too. + <attribution> + Anne Elk (Miss) + <section ids="doctest-blocks" names="doctest\ blocks"> + <title auto="1" refid="id47"> + <generated classes="sectnum"> + 2.10 + Doctest Blocks + <doctest_block xml:space="preserve"> + >>> print 'Python-specific usage examples; begun with ">>>"' + Python-specific usage examples; begun with ">>>" + >>> print '(cut and pasted from interactive Python sessions)' + (cut and pasted from interactive Python sessions) + <section ids="footnotes" names="footnotes"> + <title auto="1" refid="id48"> + <generated classes="sectnum"> + 2.11 + Footnotes + <footnote backrefs="id1 id9 id21" ids="id8" names="1"> + <label> + 1 + <paragraph> + A footnote contains body elements, consistently indented by at + least 3 spaces. + <paragraph> + This is the footnote's second paragraph. + <footnote auto="1" backrefs="id3 id10" ids="label" names="label"> + <label> + 2 + <paragraph> + Footnotes may be numbered, either manually (as in + <footnote_reference ids="id9" refid="id8"> + 1 + ) or + automatically using a "#"-prefixed label. This footnote has a + label so it can be referred to from multiple places, both as a + footnote reference ( + <footnote_reference auto="1" ids="id10" refid="label"> + 2 + ) and as a hyperlink reference + ( + <reference name="label" refid="label"> + label + ). + <footnote auto="1" backrefs="id2" ids="id11" names="3"> + <label> + 3 + <paragraph> + This footnote is numbered automatically and anonymously using a + label of "#" only. + <paragraph> + This is the second paragraph. + <paragraph> + And this is the third paragraph. + <footnote auto="*" backrefs="id4" ids="id12"> + <label> + * + <paragraph> + Footnotes may also use symbols, specified with a "*" label. + Here's a reference to the next footnote: + <footnote_reference auto="*" ids="id13" refid="id14"> + † + . + <footnote auto="*" backrefs="id13" ids="id14"> + <label> + † + <paragraph> + This footnote shows the next symbol in the sequence. + <footnote ids="id15" names="4"> + <label> + 4 + <paragraph> + Here's an unreferenced footnote, with a reference to a + nonexistent footnote: + <problematic ids="id80 id16" refid="id79"> + [5]_ + . + <section ids="citations" names="citations"> + <title auto="1" refid="id49"> + <generated classes="sectnum"> + 2.12 + Citations + <citation backrefs="id5 id17" ids="cit2002" names="cit2002"> + <label> + CIT2002 + <paragraph> + Citations are text-labeled footnotes. They may be + rendered separately and differently from footnotes. + <paragraph> + Here's a reference to the above, + <citation_reference ids="id17" refid="cit2002"> + CIT2002 + , and a + <problematic ids="id82 id18" refid="id81"> + [nonexistent]_ + + citation. + <target refid="another-target"> + <section dupnames="targets" ids="targets another-target" names="another\ target"> + <title auto="1" refid="id50"> + <generated classes="sectnum"> + 2.13 + Targets + <target refid="example"> + <paragraph ids="example" names="example"> + This paragraph is pointed to by the explicit "example" target. A + reference can be found under + <reference name="Inline Markup" refid="inline-markup"> + Inline Markup + , above. + <reference name="Inline hyperlink targets" refid="inline-hyperlink-targets"> + Inline + hyperlink targets + are also possible. + <paragraph> + Section headers are implicit targets, referred to by name. See + <reference name="Targets" refid="id22"> + Targets + , which is a subsection of + <reference name="Body Elements" refid="body-elements"> + Body Elements + . + <paragraph> + Explicit external targets are interpolated into references such as + " + <reference name="Python" refuri="http://www.python.org/"> + Python + + <footnote_reference auto="1" ids="id27" refid="id25"> + 5 + ". + <target ids="python" names="python" refuri="http://www.python.org/"> + <paragraph> + Targets may be indirect and anonymous. Thus + <reference anonymous="1" name="this phrase" refid="id22"> + this phrase + may also + refer to the + <reference name="Targets" refid="id22"> + Targets + section. + <target anonymous="1" ids="id19" refid="id22"> + <paragraph> + Here's a + <problematic ids="id84" refid="id83"> + `hyperlink reference without a target`_ + , which generates an + error. + <section dupnames="duplicate\ target\ names" ids="duplicate-target-names"> + <title auto="1" refid="id51"> + <generated classes="sectnum"> + 2.13.1 + Duplicate Target Names + <paragraph> + Duplicate names in section headers or other implicit targets will + generate "info" (level-1) system messages. Duplicate names in + explicit targets will generate "warning" (level-2) system messages. + <section dupnames="duplicate\ target\ names" ids="id20"> + <title auto="1" refid="id52"> + <generated classes="sectnum"> + 2.13.2 + Duplicate Target Names + <paragraph> + Since there are two "Duplicate Target Names" section headers, we + cannot uniquely refer to either of them by name. If we try to (like + this: + <problematic ids="id86" refid="id85"> + `Duplicate Target Names`_ + ), an error is generated. + <section ids="directives" names="directives"> + <title auto="1" refid="id53"> + <generated classes="sectnum"> + 2.14 + Directives + <topic classes="contents local" ids="contents" names="contents"> + <bullet_list classes="auto-toc"> + <list_item> + <paragraph> + <reference ids="id71" refid="document-parts"> + <generated classes="sectnum"> + 2.14.1 + Document Parts + <list_item> + <paragraph> + <reference ids="id72" refid="images"> + <generated classes="sectnum"> + 2.14.2 + Images + <list_item> + <paragraph> + <reference ids="id73" refid="admonitions"> + <generated classes="sectnum"> + 2.14.3 + Admonitions + <list_item> + <paragraph> + <reference ids="id74" refid="topics-sidebars-and-rubrics"> + <generated classes="sectnum"> + 2.14.4 + Topics, Sidebars, and Rubrics + <list_item> + <paragraph> + <reference ids="id75" refid="target-footnotes"> + <generated classes="sectnum"> + 2.14.5 + Target Footnotes + <list_item> + <paragraph> + <reference ids="id76" refid="replacement-text"> + <generated classes="sectnum"> + 2.14.6 + Replacement Text + <list_item> + <paragraph> + <reference ids="id77" refid="compound-paragraph"> + <generated classes="sectnum"> + 2.14.7 + Compound Paragraph + <list_item> + <paragraph> + <reference ids="id78" refid="parsed-literal-blocks"> + <generated classes="sectnum"> + 2.14.8 + Parsed Literal Blocks + <paragraph> + These are just a sample of the many reStructuredText Directives. For + others, please see + <reference refuri="http://docutils.sourceforge.net/docs/ref/rst/directives.html"> + http://docutils.sourceforge.net/docs/ref/rst/directives.html + . + <section ids="document-parts" names="document\ parts"> + <title auto="1" refid="id71"> + <generated classes="sectnum"> + 2.14.1 + Document Parts + <paragraph> + An example of the "contents" directive can be seen above this section + (a local, untitled table of + <reference name="contents" refid="contents"> + contents + ) and at the beginning of the + document (a document-wide + <reference name="table of contents" refid="table-of-contents"> + table of contents + ). + <section ids="images" names="images"> + <title auto="1" refid="id72"> + <generated classes="sectnum"> + 2.14.2 + Images + <paragraph> + An image directive (also clickable -- a hyperlink reference): + <reference name="directives" refid="directives"> + <image classes="class1 class2" uri="../../../docs/user/rst/images/title.png"> + <paragraph> + Image with multiple IDs: + <target refid="image-target-1"> + <target refid="image-target-2"> + <target refid="image-target-3"> + <image ids="image-target-3 image-target-2 image-target-1" names="image\ target\ 3 image\ target\ 2 image\ target\ 1" uri="../../../docs/user/rst/images/title.png"> + <paragraph> + A centered image: + <image align="center" uri="../../../docs/user/rst/images/biohazard.png"> + <paragraph> + A left-aligned image: + <image align="left" uri="../../../docs/user/rst/images/biohazard.png"> + <paragraph> + A right-aligned image: + <image align="right" uri="../../../docs/user/rst/images/biohazard.png"> + <paragraph> + A figure directive: + <figure align="right" classes="figclass1 figclass2"> + <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/biohazard.png" width="50"> + <caption> + A figure is an image with a caption and/or a legend: + <legend> + <table> + <tgroup cols="2"> + <colspec colwidth="12"> + <colspec colwidth="47"> + <tbody> + <row> + <entry> + <paragraph> + re + <entry> + <paragraph> + Revised, revisited, based on 're' module. + <row> + <entry> + <paragraph> + Structured + <entry> + <paragraph> + Structure-enhanced text, structuredtext. + <row> + <entry> + <paragraph> + Text + <entry> + <paragraph> + Well it is, isn't it? + <paragraph> + This paragraph is also part of the legend. + <figure align="left" classes="figclass1 figclass2"> + <image alt="reStructuredText, the markup syntax" classes="class1 class2" uri="../../../docs/user/rst/images/biohazard.png" width="50"> + <caption> + A left-aligned figure. + <legend> + <paragraph> + This is the legend. + <paragraph> + This paragraph might flow around the figure... + <paragraph> + A centered figure: + <figure align="center"> + <image uri="../../../docs/user/rst/images/biohazard.png" width="50"> + <caption> + This is the caption. + <legend> + <paragraph> + This is the legend. + <paragraph> + The legend may consist of several paragraphs. + <paragraph> + This paragraph might flow around the figure... + <paragraph> + A left-aligned figure: + <figure align="left"> + <image uri="../../../docs/user/rst/images/biohazard.png" width="50"> + <caption> + This is the caption. + <legend> + <paragraph> + This is the legend. + <paragraph> + The legend may consist of several paragraphs. + <paragraph> + This paragraph might flow around the figure... + <paragraph> + Now widths: + <paragraph> + An image 2 em wide: + <image uri="../../../docs/user/rst/images/biohazard.png" width="2em"> + <paragraph> + An image 2 em wide and 30 pixel high: + <image height="30px" uri="../../../docs/user/rst/images/biohazard.png" width="2em"> + <paragraph> + An image occupying 70% of the line width: + <image uri="../../../docs/user/rst/images/biohazard.png" width="70%"> + <paragraph> + An image 3 cm high: + <image height="3cm" uri="../../../docs/user/rst/images/biohazard.png"> + <section ids="admonitions" names="admonitions"> + <title auto="1" refid="id73"> + <generated classes="sectnum"> + 2.14.3 + Admonitions + <attention> + <paragraph> + Directives at large. + <caution> + <paragraph> + Don't take any wooden nickels. + <danger> + <paragraph> + Mad scientist at work! + <error> + <paragraph> + Does not compute. + <hint> + <paragraph> + It's bigger than a bread box. + <important> + <bullet_list bullet="-"> + <list_item> + <paragraph> + Wash behind your ears. + <list_item> + <paragraph> + Clean up your room. + <list_item> + <paragraph> + Call your mother. + <list_item> + <paragraph> + Back up your data. + <note> + <paragraph> + This is a note. + <tip> + <paragraph> + 15% if the service is good. + <warning> + <paragraph> + Strong prose may provoke extreme mental exertion. + Reader discretion is strongly advised. + <admonition classes="admonition-and-by-the-way"> + <title> + And, by the way... + <paragraph> + You can make up your own admonition too. + <target ids="docutils" names="docutils" refuri="http://docutils.sourceforge.net/"> + <section ids="topics-sidebars-and-rubrics" names="topics,\ sidebars,\ and\ rubrics"> + <title auto="1" refid="id74"> + <generated classes="sectnum"> + 2.14.4 + Topics, Sidebars, and Rubrics + <sidebar> + <title> + Sidebar Title + <subtitle> + Optional Subtitle + <paragraph> + This is a sidebar. It is for text outside the flow of the main + text. + <rubric> + This is a rubric inside a sidebar + <paragraph> + Sidebars often appears beside the main text with a border and + background color. + <topic> + <title> + Topic Title + <paragraph> + This is a topic. + <rubric> + This is a rubric + <section ids="target-footnotes" names="target\ footnotes"> + <title auto="1" refid="id75"> + <generated classes="sectnum"> + 2.14.5 + Target Footnotes + <footnote auto="1" backrefs="id26 id27 id28 id29" ids="id25" names="TARGET_NOTE:\ id25"> + <label> + 5 + <paragraph> + <reference refuri="http://www.python.org/"> + http://www.python.org/ + <footnote auto="1" backrefs="id31" ids="id30" names="TARGET_NOTE:\ id30"> + <label> + 6 + <paragraph> + <reference refuri="http://docutils.sourceforge.net/"> + http://docutils.sourceforge.net/ + <section ids="replacement-text" names="replacement\ text"> + <title auto="1" refid="id76"> + <generated classes="sectnum"> + 2.14.6 + Replacement Text + <paragraph> + I recommend you try + <reference refuri="http://www.python.org/"> + Python, + <emphasis> + the + best language around + + <footnote_reference auto="1" ids="id28" refid="id25"> + 5 + . + <substitution_definition names="Python"> + Python, + <emphasis> + the + best language around + <section ids="compound-paragraph" names="compound\ paragraph"> + <title auto="1" refid="id77"> + <generated classes="sectnum"> + 2.14.7 + Compound Paragraph + <compound classes="some-class"> + <paragraph> + Compound 1, paragraph 1. + <paragraph> + Compound 1, paragraph 2. + <bullet_list bullet="*"> + <list_item> + <paragraph> + Compound 1, list item one. + <list_item> + <paragraph> + Compound 1, list item two. + <paragraph> + Another compound statement: + <compound> + <paragraph> + Compound 2, a literal block: + <literal_block xml:space="preserve"> + Compound 2, literal. + <paragraph> + Compound 2, this is a test. + <compound> + <paragraph> + Compound 3, only consisting of one paragraph. + <compound> + <literal_block xml:space="preserve"> + Compound 4. + This one starts with a literal block. + <paragraph> + Compound 4, a paragraph. + <paragraph> + Now something + <emphasis> + really + perverted -- a nested compound block. This is + just to test that it works at all; the results don't have to be + meaningful. + <compound> + <paragraph> + Compound 5, block 1 (a paragraph). + <compound> + <paragraph> + Compound 6, block 2 in compound 5. + <paragraph> + Compound 6, another paragraph. + <paragraph> + Compound 5, block 3 (a paragraph). + <compound> + <paragraph> + Compound 7, with a table inside: + <table> + <tgroup cols="3"> + <colspec colwidth="20"> + <colspec colwidth="20"> + <colspec colwidth="20"> + <tbody> + <row> + <entry> + <paragraph> + Left cell, first + paragraph. + <paragraph> + Left cell, second + paragraph. + <entry> + <paragraph> + Middle cell, + consisting of + exactly one + paragraph. + <entry> + <paragraph> + Right cell. + <paragraph> + Paragraph 2. + <paragraph> + Paragraph 3. + <paragraph> + Compound 7, a paragraph after the table. + <paragraph> + Compound 7, another paragraph. + <section ids="parsed-literal-blocks" names="parsed\ literal\ blocks"> + <title auto="1" refid="id78"> + <generated classes="sectnum"> + 2.14.8 + Parsed Literal Blocks + <literal_block xml:space="preserve"> + This is a parsed literal block. + This line is indented. The next line is blank. + + Inline markup is supported, e.g. + <emphasis> + emphasis + , + <strong> + strong + , + <literal> + literal + text + , footnotes + <footnote_reference ids="id21" refid="id8"> + 1 + , + <target ids="id22" names="targets"> + targets + , and + <reference name="references" refuri="http://www.python.org/"> + references + <target ids="references" names="references" refuri="http://www.python.org/"> + . + <section ids="substitution-definitions" names="substitution\ definitions"> + <title auto="1" refid="id62"> + <generated classes="sectnum"> + 2.15 + Substitution Definitions + <paragraph> + An inline image ( + <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"> + ) example: + <substitution_definition names="EXAMPLE"> + <image alt="EXAMPLE" uri="../../../docs/user/rst/images/biohazard.png"> + <paragraph> + (Substitution definitions are not visible in the HTML source.) + <section ids="comments" names="comments"> + <title auto="1" refid="id63"> + <generated classes="sectnum"> + 2.16 + Comments + <paragraph> + Here's one: + <comment xml:space="preserve"> + Comments begin with two dots and a space. Anything may + follow, except for the syntax of footnotes, hyperlink + targets, directives, or substitution definitions. + + Double-dashes -- "--" -- must be escaped somehow in HTML output. + <paragraph> + (View the HTML source to see the comment.) + <section ids="raw-text" names="raw\ text"> + <title auto="1" refid="id64"> + <generated classes="sectnum"> + 2.17 + Raw text + <paragraph> + This does not necessarily look nice, because there may be missing white space. + <paragraph> + It's just there to freeze the behavior. + <raw format="html latex" xml:space="preserve"> + A test. + <raw format="html latex" xml:space="preserve"> + Second test. + <raw classes="myclass" format="html latex" xml:space="preserve"> + Another test with myclass set. + <paragraph> + This is the + <raw classes="myrawroleclass" format="html latex" xml:space="preserve"> + fourth test + with myrawroleclass set. + <raw format="html" xml:space="preserve"> + Fifth test in HTML.<br />Line two. + <raw format="latex" xml:space="preserve"> + Fifth test in LaTeX.\\Line two. + <section ids="container" names="container"> + <title auto="1" refid="id65"> + <generated classes="sectnum"> + 2.18 + Container + <container classes="custom"> + <paragraph> + paragraph 1 + <paragraph> + paragraph 2 + <section ids="colspanning-tables" names="colspanning\ tables"> + <title auto="1" refid="id66"> + <generated classes="sectnum"> + 2.19 + Colspanning tables + <paragraph> + This table has a cell spanning two columns: + <table> + <tgroup cols="3"> + <colspec colwidth="5"> + <colspec colwidth="5"> + <colspec colwidth="6"> + <thead> + <row> + <entry morecols="1"> + <paragraph> + Inputs + <entry> + <paragraph> + Output + <row> + <entry> + <paragraph> + A + <entry> + <paragraph> + B + <entry> + <paragraph> + A or B + <tbody> + <row> + <entry> + <paragraph> + False + <entry> + <paragraph> + False + <entry> + <paragraph> + False + <row> + <entry> + <paragraph> + True + <entry> + <paragraph> + False + <entry> + <paragraph> + True + <row> + <entry> + <paragraph> + False + <entry> + <paragraph> + True + <entry> + <paragraph> + True + <row> + <entry> + <paragraph> + True + <entry> + <paragraph> + True + <entry> + <paragraph> + True + <section ids="rowspanning-tables" names="rowspanning\ tables"> + <title auto="1" refid="id67"> + <generated classes="sectnum"> + 2.20 + Rowspanning tables + <paragraph> + Here's a table with cells spanning several rows: + <table> + <tgroup cols="3"> + <colspec colwidth="24"> + <colspec colwidth="12"> + <colspec colwidth="18"> + <thead> + <row> + <entry> + <paragraph> + Header row, column 1 + (header rows optional) + <entry> + <paragraph> + Header 2 + <entry> + <paragraph> + Header 3 + <tbody> + <row> + <entry> + <paragraph> + body row 1, column 1 + <entry> + <paragraph> + column 2 + <entry> + <paragraph> + column 3 + <row> + <entry> + <paragraph> + body row 2 + <entry morerows="1"> + <paragraph> + Cells may + span rows. + <entry morerows="1"> + <paragraph> + Another + rowspanning + cell. + <row> + <entry> + <paragraph> + body row 3 + <section ids="complex-tables" names="complex\ tables"> + <title auto="1" refid="id68"> + <generated classes="sectnum"> + 2.21 + Complex tables + <paragraph> + Here's a complex table, which should test all features. + <table> + <tgroup cols="4"> + <colspec colwidth="24"> + <colspec colwidth="12"> + <colspec colwidth="10"> + <colspec colwidth="10"> + <thead> + <row> + <entry> + <paragraph> + Header row, column 1 + (header rows optional) + <entry> + <paragraph> + Header 2 + <entry> + <paragraph> + Header 3 + <entry> + <paragraph> + Header 4 + <tbody> + <row> + <entry> + <paragraph> + body row 1, column 1 + <entry> + <paragraph> + column 2 + <entry> + <paragraph> + column 3 + <entry> + <paragraph> + column 4 + <row> + <entry> + <paragraph> + body row 2 + <entry morecols="2"> + <paragraph> + Cells may span columns. + <row> + <entry> + <paragraph> + body row 3 + <entry morerows="1"> + <paragraph> + Cells may + span rows. + <paragraph> + Paragraph. + <entry morecols="1" morerows="1"> + <bullet_list bullet="-"> + <list_item> + <paragraph> + Table cells + <list_item> + <paragraph> + contain + <list_item> + <paragraph> + body elements. + <row> + <entry> + <paragraph> + body row 4 + <row> + <entry> + <paragraph> + body row 5 + <entry morecols="1"> + <paragraph> + Cells may also be + empty: + <literal> + --> + <entry> + <section ids="list-tables" names="list\ tables"> + <title auto="1" refid="id69"> + <generated classes="sectnum"> + 2.22 + List Tables + <paragraph> + Here's a list table exercising all features: + <table classes="test"> + <title> + list table with integral header + <tgroup cols="3"> + <colspec colwidth="10" stub="1"> + <colspec colwidth="20"> + <colspec colwidth="30"> + <thead> + <row> + <entry> + <paragraph> + Treat + <entry> + <paragraph> + Quantity + <entry> + <paragraph> + Description + <tbody> + <row> + <entry> + <paragraph> + Albatross + <entry> + <paragraph> + 2.99 + <entry> + <paragraph> + On a stick! + <row> + <entry> + <paragraph> + Crunchy Frog + <entry> + <paragraph> + 1.49 + <entry> + <paragraph> + If we took the bones out, it wouldn't be + crunchy, now would it? + <row> + <entry> + <paragraph> + Gannet Ripple + <entry> + <paragraph> + 1.99 + <entry> + <paragraph> + On a stick! + <section ids="error-handling" names="error\ handling"> + <title auto="1" refid="id70"> + <generated classes="sectnum"> + 3 + Error Handling + <paragraph> + Any errors caught during processing will generate system messages. + <paragraph> + There should be five messages in the following, auto-generated + section, "Docutils System Messages": + <comment xml:space="preserve"> + section should be added by Docutils automatically + <section classes="system-messages"> + <title> + Docutils System Messages + <system_message backrefs="id24" ids="id23" level="3" line="100" source="functional/input/data/standard.txt" type="ERROR"> + <paragraph> + Undefined substitution referenced: "problematic". + <system_message backrefs="id80" ids="id79" level="3" line="358" source="functional/input/standalone_rst_pseudoxml.txt" type="ERROR"> + <paragraph> + Unknown target name: "5". + <system_message backrefs="id82" ids="id81" level="3" line="367" source="functional/input/data/standard.txt" type="ERROR"> + <paragraph> + Unknown target name: "nonexistent". + <system_message backrefs="id84" ids="id83" level="3" line="394" source="functional/input/data/standard.txt" type="ERROR"> + <paragraph> + Unknown target name: "hyperlink reference without a target". + <system_message backrefs="id86" ids="id85" level="3" line="407" source="functional/input/data/standard.txt" type="ERROR"> + <paragraph> + Duplicate target name, cannot be used as a unique reference: "duplicate target names". diff --git a/test/functional/expected/standalone_rst_s5_html_1.html b/test/functional/expected/standalone_rst_s5_html_1.html new file mode 100644 index 000000000..54caa3916 --- /dev/null +++ b/test/functional/expected/standalone_rst_s5_html_1.html @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<meta name="version" content="S5 1.1" /> +<title>Slide Shows</title> +<meta name="author" content="David Goodger" /> +<meta name="date" content="2005-11-28" /> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +<!-- configuration parameters --> +<meta name="defaultView" content="slideshow" /> +<meta name="controlVis" content="hidden" /> +<!-- style sheet links --> +<script src="ui/small-black/slides.js" type="text/javascript"></script> +<link rel="stylesheet" href="ui/small-black/slides.css" + type="text/css" media="projection" id="slideProj" /> +<link rel="stylesheet" href="ui/small-black/outline.css" + type="text/css" media="screen" id="outlineStyle" /> +<link rel="stylesheet" href="ui/small-black/print.css" + type="text/css" media="print" id="slidePrint" /> +<link rel="stylesheet" href="ui/small-black/opera.css" + type="text/css" media="projection" id="operaFix" /> + +<style type="text/css"> +#currentSlide {display: none;} +</style> +</head> +<body> +<div class="layout"> +<div id="controls"></div> +<div id="currentSlide"></div> +<div id="header"> + +</div> +<div id="footer"> +<h1>Slide Shows</h1> +<h2>Location • Date</h2> +</div> +</div> +<div class="presentation"> +<div class="slide" id="slide0"> +<h1 class="title">Slide Shows</h1> +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td>David Goodger</td></tr> +<tr><th class="docinfo-name">Date:</th> +<td>2005-11-28</td></tr> +</tbody> +</table> +<!-- Definitions of interpreted text roles (classes) for S5/HTML data. --> +<!-- This data file has been placed in the public domain. --> +<!-- Colours +======= --> +<!-- Text Sizes +========== --> +<!-- Display in Slides (Presentation Mode) Only +========================================== --> +<!-- Display in Outline Mode Only +============================ --> +<!-- Display in Print Only +===================== --> +<!-- Incremental Display +=================== --> +<div class="contents handout topic"> +<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> +<ul class="simple"> +<li><a class="reference" href="#introduction" id="id1" name="id1">Introduction</a></li> +<li><a class="reference" href="#features-1" id="id2" name="id2">Features (1)</a></li> +<li><a class="reference" href="#features-2" id="id3" name="id3">Features (2)</a></li> +<li><a class="reference" href="#checklist" id="id4" name="id4">Checklist</a></li> +</ul> +</div> +<p class="handout">This is a test. This is only a test. If this were a real slide +show, there would be a projector handy.</p> +<p>Let's test the S5/HTML writer!</p> +<ul class="small simple"> +<li>Use the arrow keys to navigate.</li> +<li>Click the "Ø" button to switch between presentation & +handout/outline modes.</li> +</ul> +<div class="handout container"> +In presentation mode, mouse over to the lower right-hand corner to +display the controls.</div> + +</div> +<div class="slide" id="introduction"> +<h1>Introduction</h1> +<ul class="compact simple"> +<li>reStructuredText<p class="handout">Uses normal reStructuredText as input.</p> +</li> +<li>One section per slide<p class="handout">Each first-level section is converted into a single slide.</p> +</li> +<li>(X)HTML output<p 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!</p> +</li> +<li>Themes<p class="handout">A variety of themes are available.</p> +</li> +<li><tt class="docutils literal"><span class="pre">rst2s5.py</span></tt><p class="handout">The front-end tool to generate S5 slide shows.</p> +</li> +</ul> +</div> +<div class="slide" id="features-1"> +<h1>Features (1)</h1> +<p class="left">A flush-left paragraph</p> +<p class="center">A centered paragraph</p> +<p class="right">A flush-right paragraph</p> +<p>Some colours: <span class="black">black</span> [black], <span class="gray">gray</span>, <span class="silver">silver</span>, +<span class="white">white</span> [white], <span class="maroon">maroon</span>, <span class="red">red</span>, +<span class="magenta">magenta</span>, <span class="fuchsia">fuchsia</span>, <span class="pink">pink</span>, +<span class="orange">orange</span>, <span class="yellow">yellow</span>, <span class="lime">lime</span>, <span class="green">green</span>, +<span class="olive">olive</span>, <span class="teal">teal</span>, <span class="cyan">cyan</span>, <span class="aqua">aqua</span>, +<span class="blue">blue</span>, <span class="navy">navy</span>, <span class="purple">purple</span></p> +</div> +<div class="slide" id="features-2"> +<h1>Features (2)</h1> +<p><span class="incremental">Some</span> <span class="incremental">incremental</span> <span class="incremental">text.</span></p> +<ul class="incremental open"> +<li><p class="first"><span class="tiny">tiny</span> (class & role name: "tiny", e.g. "<tt class="docutils literal"><span class="pre">:tiny:`text`</span></tt>")</p> +</li> +<li><p class="first"><span class="small">small</span> ("small")</p> +</li> +<li><p class="first">normal (unstyled)</p> +</li> +<li><p class="first"><span class="big">big</span> ("big")</p> +</li> +<li><p class="first"><span class="huge">huge</span> ("huge")</p> +</li> +</ul> +</div> +<div class="slide" id="checklist"> +<h1>Checklist</h1> +<ul class="simple"> +<li>The document title should be duplicated on each slide in the footer +(except for the first slide, <tt class="docutils literal"><span class="pre">slide0</span></tt>, where the entire footer is +disabled).</li> +<li>The footer also contains a second line, "Location • Date"</li> +<li>There's no table of contents on the first slide, although it does +appear in the handout/outline.</li> +<li>Handout material is not displayed in presentation mode.</li> +<li>The theme directories should be created, and the theme files copied +over.</li> +</ul> +</div> +</div> +</body> +</html> diff --git a/test/functional/expected/standalone_rst_s5_html_2.html b/test/functional/expected/standalone_rst_s5_html_2.html new file mode 100644 index 000000000..e6e474a25 --- /dev/null +++ b/test/functional/expected/standalone_rst_s5_html_2.html @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> +<meta name="version" content="S5 1.1" /> +<title>Slide Shows</title> +<meta name="author" content="David Goodger" /> +<meta name="date" content="2005-11-28" /> +<link rel="stylesheet" href="../../../docutils/writers/html4css1/html4css1.css" type="text/css" /> +<!-- configuration parameters --> +<meta name="defaultView" content="slideshow" /> +<meta name="controlVis" content="hidden" /> +<!-- style sheet links --> +<script src="ui/default/slides.js" type="text/javascript"></script> +<link rel="stylesheet" href="ui/default/slides.css" + type="text/css" media="projection" id="slideProj" /> +<link rel="stylesheet" href="ui/default/outline.css" + type="text/css" media="screen" id="outlineStyle" /> +<link rel="stylesheet" href="ui/default/print.css" + type="text/css" media="print" id="slidePrint" /> +<link rel="stylesheet" href="ui/default/opera.css" + type="text/css" media="projection" id="operaFix" /> +</head> +<body> +<div class="layout"> +<div id="controls"></div> +<div id="currentSlide"></div> +<div id="header"> + +</div> +<div id="footer"> +<h1>Slide Shows</h1> +<h2>Location • Date</h2> +</div> +</div> +<div class="presentation"> +<div class="slide" id="slide0"> +<h1 class="title">Slide Shows</h1> +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td>David Goodger</td></tr> +<tr><th class="docinfo-name">Date:</th> +<td>2005-11-28</td></tr> +</tbody> +</table> +<!-- Definitions of interpreted text roles (classes) for S5/HTML data. --> +<!-- This data file has been placed in the public domain. --> +<!-- Colours +======= --> +<!-- Text Sizes +========== --> +<!-- Display in Slides (Presentation Mode) Only +========================================== --> +<!-- Display in Outline Mode Only +============================ --> +<!-- Display in Print Only +===================== --> +<!-- Incremental Display +=================== --> +<div class="contents handout topic"> +<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> +<ul class="simple"> +<li><a class="reference" href="#introduction" id="id1" name="id1">Introduction</a></li> +<li><a class="reference" href="#features-1" id="id2" name="id2">Features (1)</a></li> +<li><a class="reference" href="#features-2" id="id3" name="id3">Features (2)</a></li> +<li><a class="reference" href="#checklist" id="id4" name="id4">Checklist</a></li> +</ul> +</div> +<p class="handout">This is a test. This is only a test. If this were a real slide +show, there would be a projector handy.</p> +<p>Let's test the S5/HTML writer!</p> +<ul class="small simple"> +<li>Use the arrow keys to navigate.</li> +<li>Click the "Ø" button to switch between presentation & +handout/outline modes.</li> +</ul> +<div class="handout container"> +In presentation mode, mouse over to the lower right-hand corner to +display the controls.</div> + +</div> +<div class="slide" id="introduction"> +<h1>Introduction</h1> +<ul class="compact simple"> +<li>reStructuredText<p class="handout">Uses normal reStructuredText as input.</p> +</li> +<li>One section per slide<p class="handout">Each first-level section is converted into a single slide.</p> +</li> +<li>(X)HTML output<p 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!</p> +</li> +<li>Themes<p class="handout">A variety of themes are available.</p> +</li> +<li><tt class="docutils literal"><span class="pre">rst2s5.py</span></tt><p class="handout">The front-end tool to generate S5 slide shows.</p> +</li> +</ul> +</div> +<div class="slide" id="features-1"> +<h1>Features (1)</h1> +<p class="left">A flush-left paragraph</p> +<p class="center">A centered paragraph</p> +<p class="right">A flush-right paragraph</p> +<p>Some colours: <span class="black">black</span> [black], <span class="gray">gray</span>, <span class="silver">silver</span>, +<span class="white">white</span> [white], <span class="maroon">maroon</span>, <span class="red">red</span>, +<span class="magenta">magenta</span>, <span class="fuchsia">fuchsia</span>, <span class="pink">pink</span>, +<span class="orange">orange</span>, <span class="yellow">yellow</span>, <span class="lime">lime</span>, <span class="green">green</span>, +<span class="olive">olive</span>, <span class="teal">teal</span>, <span class="cyan">cyan</span>, <span class="aqua">aqua</span>, +<span class="blue">blue</span>, <span class="navy">navy</span>, <span class="purple">purple</span></p> +</div> +<div class="slide" id="features-2"> +<h1>Features (2)</h1> +<p><span class="incremental">Some</span> <span class="incremental">incremental</span> <span class="incremental">text.</span></p> +<ul class="incremental open"> +<li><p class="first"><span class="tiny">tiny</span> (class & role name: "tiny", e.g. "<tt class="docutils literal"><span class="pre">:tiny:`text`</span></tt>")</p> +</li> +<li><p class="first"><span class="small">small</span> ("small")</p> +</li> +<li><p class="first">normal (unstyled)</p> +</li> +<li><p class="first"><span class="big">big</span> ("big")</p> +</li> +<li><p class="first"><span class="huge">huge</span> ("huge")</p> +</li> +</ul> +</div> +<div class="slide" id="checklist"> +<h1>Checklist</h1> +<ul class="simple"> +<li>The document title should be duplicated on each slide in the footer +(except for the first slide, <tt class="docutils literal"><span class="pre">slide0</span></tt>, where the entire footer is +disabled).</li> +<li>The footer also contains a second line, "Location • Date"</li> +<li>There's no table of contents on the first slide, although it does +appear in the handout/outline.</li> +<li>Handout material is not displayed in presentation mode.</li> +<li>The theme directories should be created, and the theme files copied +over.</li> +</ul> +</div> +</div> +</body> +</html> diff --git a/test/functional/expected/ui/default/blank.gif b/test/functional/expected/ui/default/blank.gif Binary files differnew file mode 100644 index 000000000..75b945d25 --- /dev/null +++ b/test/functional/expected/ui/default/blank.gif diff --git a/test/functional/expected/ui/default/framing.css b/test/functional/expected/ui/default/framing.css new file mode 100644 index 000000000..c4727f303 --- /dev/null +++ b/test/functional/expected/ui/default/framing.css @@ -0,0 +1,25 @@ +/* This file has been placed in the public domain. */ +/* The following styles size, place, and layer the slide components. + Edit these if you want to change the overall slide layout. + The commented lines can be uncommented (and modified, if necessary) + to help you with the rearrangement process. */ + +/* target = 1024x768 */ + +div#header, div#footer, .slide {width: 100%; top: 0; left: 0;} +div#header {position: fixed; top: 0; height: 3em; z-index: 1;} +div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;} +.slide {top: 0; width: 92%; padding: 2.5em 4% 4%; z-index: 2;} +div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0;} +#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; + z-index: 10;} +html>body #currentSlide {position: fixed;} + +/* +div#header {background: #FCC;} +div#footer {background: #CCF;} +div#controls {background: #BBD;} +div#currentSlide {background: #FFC;} +*/ diff --git a/test/functional/expected/ui/default/iepngfix.htc b/test/functional/expected/ui/default/iepngfix.htc new file mode 100644 index 000000000..9f3d628b5 --- /dev/null +++ b/test/functional/expected/ui/default/iepngfix.htc @@ -0,0 +1,42 @@ +<public:component> +<public:attach event="onpropertychange" onevent="doFix()" /> + +<script> + +// IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com +// Free usage permitted as long as this notice remains intact. + +// This must be a path to a blank image. That's all the configuration you need here. +var blankImg = 'ui/default/blank.gif'; + +var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; + +function filt(s, m) { + if (filters[f]) { + filters[f].enabled = s ? true : false; + if (s) with (filters[f]) { src = s; sizingMethod = m } + } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")'; +} + +function doFix() { + if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) || + (event && !/(background|src)/.test(event.propertyName))) return; + + if (tagName == 'IMG') { + if ((/\.png$/i).test(src)) { + filt(src, 'image'); // was 'scale' + src = blankImg; + } else if (src.indexOf(blankImg) < 0) filt(); + } else if (style.backgroundImage) { + if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) { + var s = RegExp.$1; + style.backgroundImage = ''; + filt(s, 'crop'); + } else filt(); + } +} + +doFix(); + +</script> +</public:component>
\ No newline at end of file diff --git a/test/functional/expected/ui/default/opera.css b/test/functional/expected/ui/default/opera.css new file mode 100644 index 000000000..c9d1148be --- /dev/null +++ b/test/functional/expected/ui/default/opera.css @@ -0,0 +1,8 @@ +/* This file has been placed in the public domain. */ +/* DO NOT CHANGE THESE unless you really want to break Opera Show */ +.slide { + visibility: visible !important; + position: static !important; + page-break-before: always; +} +#slide0 {page-break-before: avoid;} diff --git a/test/functional/expected/ui/default/outline.css b/test/functional/expected/ui/default/outline.css new file mode 100644 index 000000000..fa767e227 --- /dev/null +++ b/test/functional/expected/ui/default/outline.css @@ -0,0 +1,16 @@ +/* This file has been placed in the public domain. */ +/* Don't change this unless you want the layout stuff to show up in the + outline view! */ + +.layout div, #footer *, #controlForm * {display: none;} +#footer, #controls, #controlForm, #navLinks, #toggle { + display: block; visibility: visible; margin: 0; padding: 0;} +#toggle {float: right; padding: 0.5em;} +html>body #toggle {position: fixed; top: 0; right: 0;} + +/* making the outline look pretty-ish */ + +#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} +#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} + +.outline {display: inline ! important;} diff --git a/test/functional/expected/ui/default/pretty.css b/test/functional/expected/ui/default/pretty.css new file mode 100644 index 000000000..1cede72d4 --- /dev/null +++ b/test/functional/expected/ui/default/pretty.css @@ -0,0 +1,120 @@ +/* This file has been placed in the public domain. */ +/* Following are the presentation styles -- edit away! */ + +html, body {margin: 0; padding: 0;} +body {background: white; color: black;} +/* Replace the background style above with the style below (and again for + div#header) for a graphic: */ +/* background: white url(bodybg.gif) -16px 0 no-repeat; */ +:link, :visited {text-decoration: none; color: #00C;} +#controls :active {color: #88A !important;} +#controls :focus {outline: 1px dotted #227;} +h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;} + +blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em;} +blockquote p {margin: 0;} + +kbd {font-weight: bold; font-size: 1em;} +sup {font-size: smaller; line-height: 1px;} + +.slide pre {padding: 0; margin-left: 0; margin-right: 0; font-size: 90%;} +.slide ul ul li {list-style: square;} +.slide img.leader {display: block; margin: 0 auto;} +.slide tt {font-size: 90%;} + +div#header, div#footer {background: #005; color: #AAB; font-family: sans-serif;} +/* background: #005 url(bodybg.gif) -16px 0 no-repeat; */ +div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;} +#footer h1 {display: block; padding: 0 1em;} +#footer h2 {display: block; padding: 0.8em 1em 0;} + +.slide {font-size: 1.2em;} +.slide h1 {position: absolute; top: 0.45em; z-index: 1; + margin: 0; padding-left: 0.7em; white-space: nowrap; + font: bold 150% sans-serif; color: #DDE; background: #005;} +.slide h2 {font: bold 120%/1em sans-serif; padding-top: 0.5em;} +.slide h3 {font: bold 100% sans-serif; padding-top: 0.5em;} +h1 abbr {font-variant: small-caps;} + +div#controls {position: absolute; left: 50%; bottom: 0; + width: 50%; text-align: right; font: bold 0.9em sans-serif;} +html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0; padding: 0;} +#controls #navLinks a {padding: 0; margin: 0 0.5em; + background: #005; border: none; color: #779; cursor: pointer;} +#controls #navList {height: 1em;} +#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; + background: #DDD; color: #227;} + +#currentSlide {text-align: center; font-size: 0.5em; color: #449; + font-family: sans-serif; font-weight: bold;} + +#slide0 {padding-top: 1.5em} +#slide0 h1 {position: static; margin: 1em 0 0; padding: 0; color: #000; + font: bold 2em sans-serif; white-space: normal; background: transparent;} +#slide0 h2 {font: bold italic 1em sans-serif; margin: 0.25em;} +#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;} +#slide0 h4 {margin-top: 0; font-size: 1em;} + +ul.urls {list-style: none; display: inline; margin: 0;} +.urls li {display: inline; margin: 0;} +.external {border-bottom: 1px dotted gray;} +html>body .external {border-bottom: none;} +.external:after {content: " \274F"; font-size: smaller; color: #77B;} + +.incremental, .incremental *, .incremental *:after {visibility: visible; + color: white; border: 0;} +img.incremental {visibility: hidden;} +.slide .current {color: green;} + +.slide-display {display: inline ! important;} + +.huge {font-family: sans-serif; font-weight: bold; font-size: 150%;} +.big {font-family: sans-serif; font-weight: bold; font-size: 120%;} +.small {font-size: 75%;} +.tiny {font-size: 50%;} +.huge tt, .big tt, .small tt, .tiny tt {font-size: 115%;} +.huge pre, .big pre, .small pre, .tiny pre {font-size: 115%;} + +.maroon {color: maroon;} +.red {color: red;} +.magenta {color: magenta;} +.fuchsia {color: fuchsia;} +.pink {color: #FAA;} +.orange {color: orange;} +.yellow {color: yellow;} +.lime {color: lime;} +.green {color: green;} +.olive {color: olive;} +.teal {color: teal;} +.cyan {color: cyan;} +.aqua {color: aqua;} +.blue {color: blue;} +.navy {color: navy;} +.purple {color: purple;} +.black {color: black;} +.gray {color: gray;} +.silver {color: silver;} +.white {color: white;} + +.left {text-align: left ! important;} +.center {text-align: center ! important;} +.right {text-align: right ! important;} + +.animation {position: relative; margin: 1em 0; padding: 0;} +.animation img {position: absolute;} + +/* Docutils-specific overrides */ + +.slide table.docinfo {margin: 1em 0 0.5em 2em;} + +pre.literal-block, pre.doctest-block {background-color: white;} + +tt.docutils {background-color: white;} + +/* diagnostics */ +/* +li:after {content: " [" attr(class) "]"; color: #F88;} +div:before {content: "[" attr(class) "]"; color: #F88;} +*/ diff --git a/test/functional/expected/ui/default/print.css b/test/functional/expected/ui/default/print.css new file mode 100644 index 000000000..9d057cc8c --- /dev/null +++ b/test/functional/expected/ui/default/print.css @@ -0,0 +1,24 @@ +/* This file has been placed in the public domain. */ +/* The following rule is necessary to have all slides appear in print! + DO NOT REMOVE IT! */ +.slide, ul {page-break-inside: avoid; visibility: visible !important;} +h1 {page-break-after: avoid;} + +body {font-size: 12pt; background: white;} +* {color: black;} + +#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} +#slide0 h3 {margin: 0; padding: 0;} +#slide0 h4 {margin: 0 0 0.5em; padding: 0;} +#slide0 {margin-bottom: 3em;} + +#header {display: none;} +#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; + font-style: italic;} +#footer h2, #controls {display: none;} + +.print {display: inline ! important;} + +/* The following rule keeps the layout stuff out of print. + Remove at your own risk! */ +.layout, .layout * {display: none !important;} diff --git a/test/functional/expected/ui/default/s5-core.css b/test/functional/expected/ui/default/s5-core.css new file mode 100644 index 000000000..6965f5e8f --- /dev/null +++ b/test/functional/expected/ui/default/s5-core.css @@ -0,0 +1,11 @@ +/* This file has been placed in the public domain. */ +/* Do not edit or override these styles! + The system will likely break if you do. */ + +div#header, div#footer, div#controls, .slide {position: absolute;} +html>body div#header, html>body div#footer, + html>body div#controls, html>body .slide {position: fixed;} +.handout {display: none;} +.layout {display: block;} +.slide, .hideme, .incremental {visibility: hidden;} +#slide0 {visibility: visible;} diff --git a/test/functional/expected/ui/default/slides.css b/test/functional/expected/ui/default/slides.css new file mode 100644 index 000000000..82bdc0ee0 --- /dev/null +++ b/test/functional/expected/ui/default/slides.css @@ -0,0 +1,10 @@ +/* This file has been placed in the public domain. */ + +/* required to make the slide show run at all */ +@import url(s5-core.css); + +/* sets basic placement and size of slide components */ +@import url(framing.css); + +/* styles that make the slides look good */ +@import url(pretty.css); diff --git a/test/functional/expected/ui/default/slides.js b/test/functional/expected/ui/default/slides.js new file mode 100644 index 000000000..81e04e5d4 --- /dev/null +++ b/test/functional/expected/ui/default/slides.js @@ -0,0 +1,558 @@ +// S5 v1.1 slides.js -- released into the Public Domain +// Modified for Docutils (http://docutils.sf.net) by David Goodger +// +// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for +// information about all the wonderful and talented contributors to this code! + +var undef; +var slideCSS = ''; +var snum = 0; +var smax = 1; +var slideIDs = new Array(); +var incpos = 0; +var number = undef; +var s5mode = true; +var defaultView = 'slideshow'; +var controlVis = 'visible'; + +var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; +var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; +var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; + +function hasClass(object, className) { + if (!object.className) return false; + return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1); +} + +function hasValue(object, value) { + if (!object) return false; + return (object.search('(^|\\s)' + value + '(\\s|$)') != -1); +} + +function removeClass(object,className) { + if (!object) return; + object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); +} + +function addClass(object,className) { + if (!object || hasClass(object, className)) return; + if (object.className) { + object.className += ' '+className; + } else { + object.className = className; + } +} + +function GetElementsWithClassName(elementName,className) { + var allElements = document.getElementsByTagName(elementName); + var elemColl = new Array(); + for (var i = 0; i< allElements.length; i++) { + if (hasClass(allElements[i], className)) { + elemColl[elemColl.length] = allElements[i]; + } + } + return elemColl; +} + +function isParentOrSelf(element, id) { + if (element == null || element.nodeName=='BODY') return false; + else if (element.id == id) return true; + else return isParentOrSelf(element.parentNode, id); +} + +function nodeValue(node) { + var result = ""; + if (node.nodeType == 1) { + var children = node.childNodes; + for (var i = 0; i < children.length; ++i) { + result += nodeValue(children[i]); + } + } + else if (node.nodeType == 3) { + result = node.nodeValue; + } + return(result); +} + +function slideLabel() { + var slideColl = GetElementsWithClassName('*','slide'); + var list = document.getElementById('jumplist'); + smax = slideColl.length; + for (var n = 0; n < smax; n++) { + var obj = slideColl[n]; + + var did = 'slide' + n.toString(); + if (obj.getAttribute('id')) { + slideIDs[n] = obj.getAttribute('id'); + } + else { + obj.setAttribute('id',did); + slideIDs[n] = did; + } + if (isOp) continue; + + var otext = ''; + var menu = obj.firstChild; + if (!menu) continue; // to cope with empty slides + while (menu && menu.nodeType == 3) { + menu = menu.nextSibling; + } + if (!menu) continue; // to cope with slides with only text nodes + + var menunodes = menu.childNodes; + for (var o = 0; o < menunodes.length; o++) { + otext += nodeValue(menunodes[o]); + } + list.options[list.length] = new Option(n + ' : ' + otext, n); + } +} + +function currentSlide() { + var cs; + var footer_nodes; + var vis = 'visible'; + if (document.getElementById) { + cs = document.getElementById('currentSlide'); + footer_nodes = document.getElementById('footer').childNodes; + } else { + cs = document.currentSlide; + footer = document.footer.childNodes; + } + cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' + + '<span id="csSep">\/<\/span> ' + + '<span id="csTotal">' + (smax-1) + '<\/span>'; + if (snum == 0) { + vis = 'hidden'; + } + cs.style.visibility = vis; + for (var i = 0; i < footer_nodes.length; i++) { + if (footer_nodes[i].nodeType == 1) { + footer_nodes[i].style.visibility = vis; + } + } +} + +function go(step) { + if (document.getElementById('slideProj').disabled || step == 0) return; + var jl = document.getElementById('jumplist'); + var cid = slideIDs[snum]; + var ce = document.getElementById(cid); + if (incrementals[snum].length > 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + removeClass(incrementals[snum][i], 'current'); + removeClass(incrementals[snum][i], 'incremental'); + } + } + if (step != 'j') { + snum += step; + lmax = smax - 1; + if (snum > lmax) snum = lmax; + if (snum < 0) snum = 0; + } else + snum = parseInt(jl.value); + var nid = slideIDs[snum]; + var ne = document.getElementById(nid); + if (!ne) { + ne = document.getElementById(slideIDs[0]); + snum = 0; + } + if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;} + if (incrementals[snum].length > 0 && incpos == 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + if (hasClass(incrementals[snum][i], 'current')) + incpos = i + 1; + else + addClass(incrementals[snum][i], 'incremental'); + } + } + if (incrementals[snum].length > 0 && incpos > 0) + addClass(incrementals[snum][incpos - 1], 'current'); + ce.style.visibility = 'hidden'; + ne.style.visibility = 'visible'; + jl.selectedIndex = snum; + currentSlide(); + number = 0; +} + +function goTo(target) { + if (target >= smax || target == snum) return; + go(target - snum); +} + +function subgo(step) { + if (step > 0) { + removeClass(incrementals[snum][incpos - 1],'current'); + removeClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos],'current'); + incpos++; + } else { + incpos--; + removeClass(incrementals[snum][incpos],'current'); + addClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos - 1],'current'); + } +} + +function toggle() { + var slideColl = GetElementsWithClassName('*','slide'); + var slides = document.getElementById('slideProj'); + var outline = document.getElementById('outlineStyle'); + if (!slides.disabled) { + slides.disabled = true; + outline.disabled = false; + s5mode = false; + fontSize('1em'); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'visible'; + } + } else { + slides.disabled = false; + outline.disabled = true; + s5mode = true; + fontScale(); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'hidden'; + } + slideColl[snum].style.visibility = 'visible'; + } +} + +function showHide(action) { + var obj = GetElementsWithClassName('*','hideme')[0]; + switch (action) { + case 's': obj.style.visibility = 'visible'; break; + case 'h': obj.style.visibility = 'hidden'; break; + case 'k': + if (obj.style.visibility != 'visible') { + obj.style.visibility = 'visible'; + } else { + obj.style.visibility = 'hidden'; + } + break; + } +} + +// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/) +function keys(key) { + if (!key) { + key = event; + key.which = key.keyCode; + } + if (key.which == 84) { + toggle(); + return; + } + if (s5mode) { + switch (key.which) { + case 10: // return + case 13: // enter + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + if(number != undef) { + goTo(number); + break; + } + case 32: // spacebar + case 34: // page down + case 39: // rightkey + case 40: // downkey + if(number != undef) { + go(number); + } else if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + break; + case 33: // page up + case 37: // leftkey + case 38: // upkey + if(number != undef) { + go(-1 * number); + } else if (!incrementals[snum] || incpos <= 0) { + go(-1); + } else { + subgo(-1); + } + break; + case 36: // home + goTo(0); + break; + case 35: // end + goTo(smax-1); + break; + case 67: // c + showHide('k'); + break; + } + if (key.which < 48 || key.which > 57) { + number = undef; + } else { + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + number = (((number != undef) ? number : 0) * 10) + (key.which - 48); + } + } + return false; +} + +function clicker(e) { + number = undef; + var target; + if (window.event) { + target = window.event.srcElement; + e = window.event; + } else target = e.target; + if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true; + if (!e.which || e.which == 1) { + if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + } +} + +function findSlide(hash) { + var target = document.getElementById(hash); + if (target) { + for (var i = 0; i < slideIDs.length; i++) { + if (target.id == slideIDs[i]) return i; + } + } + return null; +} + +function slideJump() { + if (window.location.hash == null || window.location.hash == '') { + currentSlide(); + return; + } + if (window.location.hash == null) return; + var dest = null; + dest = findSlide(window.location.hash.slice(1)); + if (dest == null) { + dest = 0; + } + go(dest - snum); +} + +function fixLinks() { + var thisUri = window.location.href; + thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length); + var aelements = document.getElementsByTagName('A'); + for (var i = 0; i < aelements.length; i++) { + var a = aelements[i].href; + var slideID = a.match('\#.+'); + if ((slideID) && (slideID[0].slice(0,1) == '#')) { + var dest = findSlide(slideID[0].slice(1)); + if (dest != null) { + if (aelements[i].addEventListener) { + aelements[i].addEventListener("click", new Function("e", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "if (e.preventDefault) e.preventDefault();"), true); + } else if (aelements[i].attachEvent) { + aelements[i].attachEvent("onclick", new Function("", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "event.returnValue = false;")); + } + } + } + } +} + +function externalLinks() { + if (!document.getElementsByTagName) return; + var anchors = document.getElementsByTagName('a'); + for (var i=0; i<anchors.length; i++) { + var anchor = anchors[i]; + if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) { + anchor.target = '_blank'; + addClass(anchor,'external'); + } + } +} + +function createControls() { + var controlsDiv = document.getElementById("controls"); + if (!controlsDiv) return; + var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"'; + var hideDiv, hideList = ''; + if (controlVis == 'hidden') { + hideDiv = hider; + } else { + hideList = hider; + } + controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' + + '<div id="navLinks">' + + '<a accesskey="t" id="toggle" href="javascript:toggle();">Ø<\/a>' + + '<a accesskey="z" id="prev" href="javascript:go(-1);">«<\/a>' + + '<a accesskey="x" id="next" href="javascript:go(1);">»<\/a>' + + '<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' + + '<\/div><\/form>'; + if (controlVis == 'hidden') { + var hidden = document.getElementById('navLinks'); + } else { + var hidden = document.getElementById('jumplist'); + } + addClass(hidden,'hideme'); +} + +function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers + if (!s5mode) return false; + var vScale = 22; // both yield 32 (after rounding) at 1024x768 + var hScale = 32; // perhaps should auto-calculate based on theme's declared value? + if (window.innerHeight) { + var vSize = window.innerHeight; + var hSize = window.innerWidth; + } else if (document.documentElement.clientHeight) { + var vSize = document.documentElement.clientHeight; + var hSize = document.documentElement.clientWidth; + } else if (document.body.clientHeight) { + var vSize = document.body.clientHeight; + var hSize = document.body.clientWidth; + } else { + var vSize = 700; // assuming 1024x768, minus chrome and such + var hSize = 1024; // these do not account for kiosk mode or Opera Show + } + var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale)); + fontSize(newSize + 'px'); + if (isGe) { // hack to counter incremental reflow bugs + var obj = document.getElementsByTagName('body')[0]; + obj.style.display = 'none'; + obj.style.display = 'block'; + } +} + +function fontSize(value) { + if (!(s5ss = document.getElementById('s5ss'))) { + if (!isIE) { + document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style')); + s5ss.setAttribute('media','screen, projection'); + s5ss.setAttribute('id','s5ss'); + } else { + document.createStyleSheet(); + document.s5ss = document.styleSheets[document.styleSheets.length - 1]; + } + } + if (!isIE) { + while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild); + s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}')); + } else { + document.s5ss.addRule('body','font-size: ' + value + ' !important;'); + } +} + +function notOperaFix() { + slideCSS = document.getElementById('slideProj').href; + var slides = document.getElementById('slideProj'); + var outline = document.getElementById('outlineStyle'); + slides.setAttribute('media','screen'); + outline.disabled = true; + if (isGe) { + slides.setAttribute('href','null'); // Gecko fix + slides.setAttribute('href',slideCSS); // Gecko fix + } + if (isIE && document.styleSheets && document.styleSheets[0]) { + document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)'); + document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)'); + document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)'); + } +} + +function getIncrementals(obj) { + var incrementals = new Array(); + if (!obj) + return incrementals; + var children = obj.childNodes; + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (hasClass(child, 'incremental')) { + if (child.nodeName == 'OL' || child.nodeName == 'UL') { + removeClass(child, 'incremental'); + for (var j = 0; j < child.childNodes.length; j++) { + if (child.childNodes[j].nodeType == 1) { + addClass(child.childNodes[j], 'incremental'); + } + } + } else { + incrementals[incrementals.length] = child; + removeClass(child,'incremental'); + } + } + if (hasClass(child, 'show-first')) { + if (child.nodeName == 'OL' || child.nodeName == 'UL') { + removeClass(child, 'show-first'); + if (child.childNodes[isGe].nodeType == 1) { + removeClass(child.childNodes[isGe], 'incremental'); + } + } else { + incrementals[incrementals.length] = child; + } + } + incrementals = incrementals.concat(getIncrementals(child)); + } + return incrementals; +} + +function createIncrementals() { + var incrementals = new Array(); + for (var i = 0; i < smax; i++) { + incrementals[i] = getIncrementals(document.getElementById(slideIDs[i])); + } + return incrementals; +} + +function defaultCheck() { + var allMetas = document.getElementsByTagName('meta'); + for (var i = 0; i< allMetas.length; i++) { + if (allMetas[i].name == 'defaultView') { + defaultView = allMetas[i].content; + } + if (allMetas[i].name == 'controlVis') { + controlVis = allMetas[i].content; + } + } +} + +// Key trap fix, new function body for trap() +function trap(e) { + if (!e) { + e = event; + e.which = e.keyCode; + } + try { + modifierKey = e.ctrlKey || e.altKey || e.metaKey; + } + catch(e) { + modifierKey = false; + } + return modifierKey || e.which == 0; +} + +function startup() { + defaultCheck(); + if (!isOp) createControls(); + slideLabel(); + fixLinks(); + externalLinks(); + fontScale(); + if (!isOp) { + notOperaFix(); + incrementals = createIncrementals(); + slideJump(); + if (defaultView == 'outline') { + toggle(); + } + document.onkeyup = keys; + document.onkeypress = trap; + document.onclick = clicker; + } +} + +window.onload = startup; +window.onresize = function(){setTimeout('fontScale()', 50);} diff --git a/test/functional/expected/ui/small-black/blank.gif b/test/functional/expected/ui/small-black/blank.gif Binary files differnew file mode 100644 index 000000000..75b945d25 --- /dev/null +++ b/test/functional/expected/ui/small-black/blank.gif diff --git a/test/functional/expected/ui/small-black/framing.css b/test/functional/expected/ui/small-black/framing.css new file mode 100644 index 000000000..70287dd06 --- /dev/null +++ b/test/functional/expected/ui/small-black/framing.css @@ -0,0 +1,24 @@ +/* This file has been placed in the public domain. */ +/* The following styles size, place, and layer the slide components. + Edit these if you want to change the overall slide layout. + The commented lines can be uncommented (and modified, if necessary) + to help you with the rearrangement process. */ + +/* target = 1024x768 */ + +div#header, div#footer, .slide {width: 100%; top: 0; left: 0;} +div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;} +.slide {top: 0; width: 92%; padding: 1em 4% 0 4%; z-index: 2;} +div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0;} +#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; + z-index: 10;} +html>body #currentSlide {position: fixed;} + +/* +div#header {background: #FCC;} +div#footer {background: #CCF;} +div#controls {background: #BBD;} +div#currentSlide {background: #FFC;} +*/ diff --git a/test/functional/expected/ui/small-black/iepngfix.htc b/test/functional/expected/ui/small-black/iepngfix.htc new file mode 100644 index 000000000..fa9f99659 --- /dev/null +++ b/test/functional/expected/ui/small-black/iepngfix.htc @@ -0,0 +1,42 @@ +<public:component> +<public:attach event="onpropertychange" onevent="doFix()" /> + +<script> + +// IE5.5+ PNG Alpha Fix v1.0 by Angus Turnbull http://www.twinhelix.com +// Free usage permitted as long as this notice remains intact. + +// This must be a path to a blank image. That's all the configuration you need here. +var blankImg = 'ui/small-black/blank.gif'; + +var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; + +function filt(s, m) { + if (filters[f]) { + filters[f].enabled = s ? true : false; + if (s) with (filters[f]) { src = s; sizingMethod = m } + } else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")'; +} + +function doFix() { + if ((parseFloat(navigator.userAgent.match(/MSIE (\S+)/)[1]) < 5.5) || + (event && !/(background|src)/.test(event.propertyName))) return; + + if (tagName == 'IMG') { + if ((/\.png$/i).test(src)) { + filt(src, 'image'); // was 'scale' + src = blankImg; + } else if (src.indexOf(blankImg) < 0) filt(); + } else if (style.backgroundImage) { + if (style.backgroundImage.match(/^url[("']+(.*\.png)[)"']+$/i)) { + var s = RegExp.$1; + style.backgroundImage = ''; + filt(s, 'crop'); + } else filt(); + } +} + +doFix(); + +</script> +</public:component>
\ No newline at end of file diff --git a/test/functional/expected/ui/small-black/opera.css b/test/functional/expected/ui/small-black/opera.css new file mode 100644 index 000000000..c9d1148be --- /dev/null +++ b/test/functional/expected/ui/small-black/opera.css @@ -0,0 +1,8 @@ +/* This file has been placed in the public domain. */ +/* DO NOT CHANGE THESE unless you really want to break Opera Show */ +.slide { + visibility: visible !important; + position: static !important; + page-break-before: always; +} +#slide0 {page-break-before: avoid;} diff --git a/test/functional/expected/ui/small-black/outline.css b/test/functional/expected/ui/small-black/outline.css new file mode 100644 index 000000000..fa767e227 --- /dev/null +++ b/test/functional/expected/ui/small-black/outline.css @@ -0,0 +1,16 @@ +/* This file has been placed in the public domain. */ +/* Don't change this unless you want the layout stuff to show up in the + outline view! */ + +.layout div, #footer *, #controlForm * {display: none;} +#footer, #controls, #controlForm, #navLinks, #toggle { + display: block; visibility: visible; margin: 0; padding: 0;} +#toggle {float: right; padding: 0.5em;} +html>body #toggle {position: fixed; top: 0; right: 0;} + +/* making the outline look pretty-ish */ + +#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} +#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} + +.outline {display: inline ! important;} diff --git a/test/functional/expected/ui/small-black/pretty.css b/test/functional/expected/ui/small-black/pretty.css new file mode 100644 index 000000000..5c1932704 --- /dev/null +++ b/test/functional/expected/ui/small-black/pretty.css @@ -0,0 +1,116 @@ +/* This file has been placed in the public domain. */ +/* Following are the presentation styles -- edit away! */ + +html, body {margin: 0; padding: 0;} +body {background: black; color: white;} +:link, :visited {text-decoration: none; color: cyan;} +#controls :active {color: #888 !important;} +#controls :focus {outline: 1px dotted #CCC;} +h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;} + +blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em;} +blockquote p {margin: 0;} + +kbd {font-weight: bold; font-size: 1em;} +sup {font-size: smaller; line-height: 1px;} + +.slide pre {padding: 0; margin-left: 0; margin-right: 0; font-size: 90%;} +.slide ul ul li {list-style: square;} +.slide img.leader {display: block; margin: 0 auto;} +.slide tt {font-size: 90%;} + +div#footer {font-family: sans-serif; color: #AAA; + font-size: 0.5em; font-weight: bold; padding: 1em 0;} +#footer h1 {display: block; padding: 0 1em;} +#footer h2 {display: block; padding: 0.8em 1em 0;} + +.slide {font-size: 1.2em;} +.slide h1 {padding-top: 0; z-index: 1; margin: 0; font: bold 150% sans-serif;} +.slide h2 {font: bold 120% sans-serif; padding-top: 0.5em;} +.slide h3 {font: bold 100% sans-serif; padding-top: 0.5em;} +h1 abbr {font-variant: small-caps;} + +div#controls {position: absolute; left: 50%; bottom: 0; + width: 50%; text-align: right; font: bold 0.9em sans-serif;} +html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;} +div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; + margin: 0; padding: 0;} +#controls #navLinks a {padding: 0; margin: 0 0.5em; + border: none; color: #888; cursor: pointer;} +#controls #navList {height: 1em;} +#controls #navList #jumplist {position: absolute; bottom: 0; right: 0; + background: black; color: #CCC;} + +#currentSlide {text-align: center; font-size: 0.5em; color: #AAA; + font-family: sans-serif; font-weight: bold;} + +#slide0 {padding-top: 0em} +#slide0 h1 {position: static; margin: 1em 0 0; padding: 0; + font: bold 2em sans-serif; white-space: normal; background: transparent;} +#slide0 h2 {font: bold italic 1em sans-serif; margin: 0.25em;} +#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;} +#slide0 h4 {margin-top: 0; font-size: 1em;} + +ul.urls {list-style: none; display: inline; margin: 0;} +.urls li {display: inline; margin: 0;} +.external {border-bottom: 1px dotted gray;} +html>body .external {border-bottom: none;} +.external:after {content: " \274F"; font-size: smaller; color: #FCC;} + +.incremental, .incremental *, .incremental *:after { + color: black; visibility: visible; border: 0;} +img.incremental {visibility: hidden;} +.slide .current {color: lime;} + +.slide-display {display: inline ! important;} + +.huge {font-family: sans-serif; font-weight: bold; font-size: 150%;} +.big {font-family: sans-serif; font-weight: bold; font-size: 120%;} +.small {font-size: 75%;} +.tiny {font-size: 50%;} +.huge tt, .big tt, .small tt, .tiny tt {font-size: 115%;} +.huge pre, .big pre, .small pre, .tiny pre {font-size: 115%;} + +.maroon {color: maroon;} +.red {color: red;} +.magenta {color: magenta;} +.fuchsia {color: fuchsia;} +.pink {color: #FAA;} +.orange {color: orange;} +.yellow {color: yellow;} +.lime {color: lime;} +.green {color: green;} +.olive {color: olive;} +.teal {color: teal;} +.cyan {color: cyan;} +.aqua {color: aqua;} +.blue {color: blue;} +.navy {color: navy;} +.purple {color: purple;} +.black {color: black;} +.gray {color: gray;} +.silver {color: silver;} +.white {color: white;} + +.left {text-align: left ! important;} +.center {text-align: center ! important;} +.right {text-align: right ! important;} + +.animation {position: relative; margin: 1em 0; padding: 0;} +.animation img {position: absolute;} + +/* Docutils-specific overrides */ + +.slide table.docinfo {margin: 1em 0 0.5em 2em;} + +div.sidebar {background-color: black;} + +pre.literal-block, pre.doctest-block {background-color: black;} + +tt.docutils {background-color: black;} + +/* diagnostics */ +/* +li:after {content: " [" attr(class) "]"; color: #F88;} +div:before {content: "[" attr(class) "]"; color: #F88;} +*/ diff --git a/test/functional/expected/ui/small-black/print.css b/test/functional/expected/ui/small-black/print.css new file mode 100644 index 000000000..9d057cc8c --- /dev/null +++ b/test/functional/expected/ui/small-black/print.css @@ -0,0 +1,24 @@ +/* This file has been placed in the public domain. */ +/* The following rule is necessary to have all slides appear in print! + DO NOT REMOVE IT! */ +.slide, ul {page-break-inside: avoid; visibility: visible !important;} +h1 {page-break-after: avoid;} + +body {font-size: 12pt; background: white;} +* {color: black;} + +#slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} +#slide0 h3 {margin: 0; padding: 0;} +#slide0 h4 {margin: 0 0 0.5em; padding: 0;} +#slide0 {margin-bottom: 3em;} + +#header {display: none;} +#footer h1 {margin: 0; border-bottom: 1px solid; color: gray; + font-style: italic;} +#footer h2, #controls {display: none;} + +.print {display: inline ! important;} + +/* The following rule keeps the layout stuff out of print. + Remove at your own risk! */ +.layout, .layout * {display: none !important;} diff --git a/test/functional/expected/ui/small-black/s5-core.css b/test/functional/expected/ui/small-black/s5-core.css new file mode 100644 index 000000000..6965f5e8f --- /dev/null +++ b/test/functional/expected/ui/small-black/s5-core.css @@ -0,0 +1,11 @@ +/* This file has been placed in the public domain. */ +/* Do not edit or override these styles! + The system will likely break if you do. */ + +div#header, div#footer, div#controls, .slide {position: absolute;} +html>body div#header, html>body div#footer, + html>body div#controls, html>body .slide {position: fixed;} +.handout {display: none;} +.layout {display: block;} +.slide, .hideme, .incremental {visibility: hidden;} +#slide0 {visibility: visible;} diff --git a/test/functional/expected/ui/small-black/slides.css b/test/functional/expected/ui/small-black/slides.css new file mode 100644 index 000000000..82bdc0ee0 --- /dev/null +++ b/test/functional/expected/ui/small-black/slides.css @@ -0,0 +1,10 @@ +/* This file has been placed in the public domain. */ + +/* required to make the slide show run at all */ +@import url(s5-core.css); + +/* sets basic placement and size of slide components */ +@import url(framing.css); + +/* styles that make the slides look good */ +@import url(pretty.css); diff --git a/test/functional/expected/ui/small-black/slides.js b/test/functional/expected/ui/small-black/slides.js new file mode 100644 index 000000000..d628dfeaf --- /dev/null +++ b/test/functional/expected/ui/small-black/slides.js @@ -0,0 +1,558 @@ +// S5 v1.1 slides.js -- released into the Public Domain +// Modified for Docutils (http://docutils.sf.net) by David Goodger +// +// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for +// information about all the wonderful and talented contributors to this code! + +var undef; +var slideCSS = ''; +var snum = 0; +var smax = 1; +var slideIDs = new Array(); +var incpos = 0; +var number = undef; +var s5mode = true; +var defaultView = 'slideshow'; +var controlVis = 'visible'; + +var isIE = navigator.appName == 'Microsoft Internet Explorer' ? 1 : 0; +var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; +var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; + +function hasClass(object, className) { + if (!object.className) return false; + return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1); +} + +function hasValue(object, value) { + if (!object) return false; + return (object.search('(^|\\s)' + value + '(\\s|$)') != -1); +} + +function removeClass(object,className) { + if (!object) return; + object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); +} + +function addClass(object,className) { + if (!object || hasClass(object, className)) return; + if (object.className) { + object.className += ' '+className; + } else { + object.className = className; + } +} + +function GetElementsWithClassName(elementName,className) { + var allElements = document.getElementsByTagName(elementName); + var elemColl = new Array(); + for (var i = 0; i< allElements.length; i++) { + if (hasClass(allElements[i], className)) { + elemColl[elemColl.length] = allElements[i]; + } + } + return elemColl; +} + +function isParentOrSelf(element, id) { + if (element == null || element.nodeName=='BODY') return false; + else if (element.id == id) return true; + else return isParentOrSelf(element.parentNode, id); +} + +function nodeValue(node) { + var result = ""; + if (node.nodeType == 1) { + var children = node.childNodes; + for (var i = 0; i < children.length; ++i) { + result += nodeValue(children[i]); + } + } + else if (node.nodeType == 3) { + result = node.nodeValue; + } + return(result); +} + +function slideLabel() { + var slideColl = GetElementsWithClassName('*','slide'); + var list = document.getElementById('jumplist'); + smax = slideColl.length; + for (var n = 0; n < smax; n++) { + var obj = slideColl[n]; + + var did = 'slide' + n.toString(); + if (obj.getAttribute('id')) { + slideIDs[n] = obj.getAttribute('id'); + } + else { + obj.setAttribute('id',did); + slideIDs[n] = did; + } + if (isOp) continue; + + var otext = ''; + var menu = obj.firstChild; + if (!menu) continue; // to cope with empty slides + while (menu && menu.nodeType == 3) { + menu = menu.nextSibling; + } + if (!menu) continue; // to cope with slides with only text nodes + + var menunodes = menu.childNodes; + for (var o = 0; o < menunodes.length; o++) { + otext += nodeValue(menunodes[o]); + } + list.options[list.length] = new Option(n + ' : ' + otext, n); + } +} + +function currentSlide() { + var cs; + var footer_nodes; + var vis = 'visible'; + if (document.getElementById) { + cs = document.getElementById('currentSlide'); + footer_nodes = document.getElementById('footer').childNodes; + } else { + cs = document.currentSlide; + footer = document.footer.childNodes; + } + cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' + + '<span id="csSep">\/<\/span> ' + + '<span id="csTotal">' + (smax-1) + '<\/span>'; + if (snum == 0) { + vis = 'hidden'; + } + cs.style.visibility = vis; + for (var i = 0; i < footer_nodes.length; i++) { + if (footer_nodes[i].nodeType == 1) { + footer_nodes[i].style.visibility = vis; + } + } +} + +function go(step) { + if (document.getElementById('slideProj').disabled || step == 0) return; + var jl = document.getElementById('jumplist'); + var cid = slideIDs[snum]; + var ce = document.getElementById(cid); + if (incrementals[snum].length > 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + removeClass(incrementals[snum][i], 'current'); + removeClass(incrementals[snum][i], 'incremental'); + } + } + if (step != 'j') { + snum += step; + lmax = smax - 1; + if (snum > lmax) snum = lmax; + if (snum < 0) snum = 0; + } else + snum = parseInt(jl.value); + var nid = slideIDs[snum]; + var ne = document.getElementById(nid); + if (!ne) { + ne = document.getElementById(slideIDs[0]); + snum = 0; + } + if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;} + if (incrementals[snum].length > 0 && incpos == 0) { + for (var i = 0; i < incrementals[snum].length; i++) { + if (hasClass(incrementals[snum][i], 'current')) + incpos = i + 1; + else + addClass(incrementals[snum][i], 'incremental'); + } + } + if (incrementals[snum].length > 0 && incpos > 0) + addClass(incrementals[snum][incpos - 1], 'current'); + ce.style.visibility = 'hidden'; + ne.style.visibility = 'visible'; + jl.selectedIndex = snum; + currentSlide(); + number = 0; +} + +function goTo(target) { + if (target >= smax || target == snum) return; + go(target - snum); +} + +function subgo(step) { + if (step > 0) { + removeClass(incrementals[snum][incpos - 1],'current'); + removeClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos],'current'); + incpos++; + } else { + incpos--; + removeClass(incrementals[snum][incpos],'current'); + addClass(incrementals[snum][incpos], 'incremental'); + addClass(incrementals[snum][incpos - 1],'current'); + } +} + +function toggle() { + var slideColl = GetElementsWithClassName('*','slide'); + var slides = document.getElementById('slideProj'); + var outline = document.getElementById('outlineStyle'); + if (!slides.disabled) { + slides.disabled = true; + outline.disabled = false; + s5mode = false; + fontSize('1em'); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'visible'; + } + } else { + slides.disabled = false; + outline.disabled = true; + s5mode = true; + fontScale(); + for (var n = 0; n < smax; n++) { + var slide = slideColl[n]; + slide.style.visibility = 'hidden'; + } + slideColl[snum].style.visibility = 'visible'; + } +} + +function showHide(action) { + var obj = GetElementsWithClassName('*','hideme')[0]; + switch (action) { + case 's': obj.style.visibility = 'visible'; break; + case 'h': obj.style.visibility = 'hidden'; break; + case 'k': + if (obj.style.visibility != 'visible') { + obj.style.visibility = 'visible'; + } else { + obj.style.visibility = 'hidden'; + } + break; + } +} + +// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/) +function keys(key) { + if (!key) { + key = event; + key.which = key.keyCode; + } + if (key.which == 84) { + toggle(); + return; + } + if (s5mode) { + switch (key.which) { + case 10: // return + case 13: // enter + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + if(number != undef) { + goTo(number); + break; + } + case 32: // spacebar + case 34: // page down + case 39: // rightkey + case 40: // downkey + if(number != undef) { + go(number); + } else if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + break; + case 33: // page up + case 37: // leftkey + case 38: // upkey + if(number != undef) { + go(-1 * number); + } else if (!incrementals[snum] || incpos <= 0) { + go(-1); + } else { + subgo(-1); + } + break; + case 36: // home + goTo(0); + break; + case 35: // end + goTo(smax-1); + break; + case 67: // c + showHide('k'); + break; + } + if (key.which < 48 || key.which > 57) { + number = undef; + } else { + if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; + if (key.target && isParentOrSelf(key.target, 'controls')) return; + number = (((number != undef) ? number : 0) * 10) + (key.which - 48); + } + } + return false; +} + +function clicker(e) { + number = undef; + var target; + if (window.event) { + target = window.event.srcElement; + e = window.event; + } else target = e.target; + if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true; + if (!e.which || e.which == 1) { + if (!incrementals[snum] || incpos >= incrementals[snum].length) { + go(1); + } else { + subgo(1); + } + } +} + +function findSlide(hash) { + var target = document.getElementById(hash); + if (target) { + for (var i = 0; i < slideIDs.length; i++) { + if (target.id == slideIDs[i]) return i; + } + } + return null; +} + +function slideJump() { + if (window.location.hash == null || window.location.hash == '') { + currentSlide(); + return; + } + if (window.location.hash == null) return; + var dest = null; + dest = findSlide(window.location.hash.slice(1)); + if (dest == null) { + dest = 0; + } + go(dest - snum); +} + +function fixLinks() { + var thisUri = window.location.href; + thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length); + var aelements = document.getElementsByTagName('A'); + for (var i = 0; i < aelements.length; i++) { + var a = aelements[i].href; + var slideID = a.match('\#.+'); + if ((slideID) && (slideID[0].slice(0,1) == '#')) { + var dest = findSlide(slideID[0].slice(1)); + if (dest != null) { + if (aelements[i].addEventListener) { + aelements[i].addEventListener("click", new Function("e", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "if (e.preventDefault) e.preventDefault();"), true); + } else if (aelements[i].attachEvent) { + aelements[i].attachEvent("onclick", new Function("", + "if (document.getElementById('slideProj').disabled) return;" + + "go("+dest+" - snum); " + + "event.returnValue = false;")); + } + } + } + } +} + +function externalLinks() { + if (!document.getElementsByTagName) return; + var anchors = document.getElementsByTagName('a'); + for (var i=0; i<anchors.length; i++) { + var anchor = anchors[i]; + if (anchor.getAttribute('href') && hasValue(anchor.rel, 'external')) { + anchor.target = '_blank'; + addClass(anchor,'external'); + } + } +} + +function createControls() { + var controlsDiv = document.getElementById("controls"); + if (!controlsDiv) return; + var hider = ' onmouseover="showHide(\'s\');" onmouseout="showHide(\'h\');"'; + var hideDiv, hideList = ''; + if (controlVis == 'hidden') { + hideDiv = hider; + } else { + hideList = hider; + } + controlsDiv.innerHTML = '<form action="#" id="controlForm"' + hideDiv + '>' + + '<div id="navLinks">' + + '<a accesskey="t" id="toggle" href="javascript:toggle();">Ø<\/a>' + + '<a accesskey="z" id="prev" href="javascript:go(-1);">«<\/a>' + + '<a accesskey="x" id="next" href="javascript:go(1);">»<\/a>' + + '<div id="navList"' + hideList + '><select id="jumplist" onchange="go(\'j\');"><\/select><\/div>' + + '<\/div><\/form>'; + if (controlVis == 'hidden') { + var hidden = document.getElementById('navLinks'); + } else { + var hidden = document.getElementById('jumplist'); + } + addClass(hidden,'hideme'); +} + +function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers + if (!s5mode) return false; + var vScale = 22; // both yield 32 (after rounding) at 1024x768 + var hScale = 32; // perhaps should auto-calculate based on theme's declared value? + if (window.innerHeight) { + var vSize = window.innerHeight; + var hSize = window.innerWidth; + } else if (document.documentElement.clientHeight) { + var vSize = document.documentElement.clientHeight; + var hSize = document.documentElement.clientWidth; + } else if (document.body.clientHeight) { + var vSize = document.body.clientHeight; + var hSize = document.body.clientWidth; + } else { + var vSize = 700; // assuming 1024x768, minus chrome and such + var hSize = 1024; // these do not account for kiosk mode or Opera Show + } + var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale)); + fontSize(newSize + 'px'); + if (isGe) { // hack to counter incremental reflow bugs + var obj = document.getElementsByTagName('body')[0]; + obj.style.display = 'none'; + obj.style.display = 'block'; + } +} + +function fontSize(value) { + if (!(s5ss = document.getElementById('s5ss'))) { + if (!isIE) { + document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style')); + s5ss.setAttribute('media','screen, projection'); + s5ss.setAttribute('id','s5ss'); + } else { + document.createStyleSheet(); + document.s5ss = document.styleSheets[document.styleSheets.length - 1]; + } + } + if (!isIE) { + while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild); + s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}')); + } else { + document.s5ss.addRule('body','font-size: ' + value + ' !important;'); + } +} + +function notOperaFix() { + slideCSS = document.getElementById('slideProj').href; + var slides = document.getElementById('slideProj'); + var outline = document.getElementById('outlineStyle'); + slides.setAttribute('media','screen'); + outline.disabled = true; + if (isGe) { + slides.setAttribute('href','null'); // Gecko fix + slides.setAttribute('href',slideCSS); // Gecko fix + } + if (isIE && document.styleSheets && document.styleSheets[0]) { + document.styleSheets[0].addRule('img', 'behavior: url(ui/small-black/iepngfix.htc)'); + document.styleSheets[0].addRule('div', 'behavior: url(ui/small-black/iepngfix.htc)'); + document.styleSheets[0].addRule('.slide', 'behavior: url(ui/small-black/iepngfix.htc)'); + } +} + +function getIncrementals(obj) { + var incrementals = new Array(); + if (!obj) + return incrementals; + var children = obj.childNodes; + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (hasClass(child, 'incremental')) { + if (child.nodeName == 'OL' || child.nodeName == 'UL') { + removeClass(child, 'incremental'); + for (var j = 0; j < child.childNodes.length; j++) { + if (child.childNodes[j].nodeType == 1) { + addClass(child.childNodes[j], 'incremental'); + } + } + } else { + incrementals[incrementals.length] = child; + removeClass(child,'incremental'); + } + } + if (hasClass(child, 'show-first')) { + if (child.nodeName == 'OL' || child.nodeName == 'UL') { + removeClass(child, 'show-first'); + if (child.childNodes[isGe].nodeType == 1) { + removeClass(child.childNodes[isGe], 'incremental'); + } + } else { + incrementals[incrementals.length] = child; + } + } + incrementals = incrementals.concat(getIncrementals(child)); + } + return incrementals; +} + +function createIncrementals() { + var incrementals = new Array(); + for (var i = 0; i < smax; i++) { + incrementals[i] = getIncrementals(document.getElementById(slideIDs[i])); + } + return incrementals; +} + +function defaultCheck() { + var allMetas = document.getElementsByTagName('meta'); + for (var i = 0; i< allMetas.length; i++) { + if (allMetas[i].name == 'defaultView') { + defaultView = allMetas[i].content; + } + if (allMetas[i].name == 'controlVis') { + controlVis = allMetas[i].content; + } + } +} + +// Key trap fix, new function body for trap() +function trap(e) { + if (!e) { + e = event; + e.which = e.keyCode; + } + try { + modifierKey = e.ctrlKey || e.altKey || e.metaKey; + } + catch(e) { + modifierKey = false; + } + return modifierKey || e.which == 0; +} + +function startup() { + defaultCheck(); + if (!isOp) createControls(); + slideLabel(); + fixLinks(); + externalLinks(); + fontScale(); + if (!isOp) { + notOperaFix(); + incrementals = createIncrementals(); + slideJump(); + if (defaultView == 'outline') { + toggle(); + } + document.onkeyup = keys; + document.onkeypress = trap; + document.onclick = clicker; + } +} + +window.onload = startup; +window.onresize = function(){setTimeout('fontScale()', 50);} diff --git a/test/functional/input/compact_lists.txt b/test/functional/input/compact_lists.txt new file mode 100644 index 000000000..ec13a97be --- /dev/null +++ b/test/functional/input/compact_lists.txt @@ -0,0 +1,39 @@ +* This is an ordinary simple bullet list. +* It should be made compact (<p> & </p> tags omitted). + +********** + +* This is a bullet list that is not simple. + + There are multiple paragraphs in some items. + +* It should not be made compact. + +* Even though some items may have only one paragraph. + +********** + +.. class:: open + +* This is a simple bullet list, but class="open" is set. +* It should not be made compact. + +********** + +.. class:: compact + +* This is a bullet list that is not simple. + + There are multiple paragraphs in some items. + +* However, the class="compact" setting will cause + all first paragraph's <p> & </p> tags to be omitted. + +* Items with multiple paragraphs will not appear changed. + +* Items may have one paragraph, or multiple. + + Items with multiple paragraphs will still be followed + by vertical whitespace because of the later paragraphs. + +* The effect is interesting. diff --git a/test/functional/input/dangerous.txt b/test/functional/input/dangerous.txt new file mode 100644 index 000000000..8f75386c8 --- /dev/null +++ b/test/functional/input/dangerous.txt @@ -0,0 +1,16 @@ +Potentially dangerous features (security holes): + +.. include:: /etc/passwd +.. raw:: html + :file: /etc/passwd +.. raw:: html + :url: file:///etc/passwd +.. raw:: html + + <script> + that does something really nasty + </script> +.. csv-table:: :file: /etc/passwd +.. csv-table:: :url: file:///etc/passwd +.. figure:: picture.png + :figwidth: image diff --git a/test/functional/input/data/custom_roles.txt b/test/functional/input/data/custom_roles.txt new file mode 100644 index 000000000..0f209d61e --- /dev/null +++ b/test/functional/input/data/custom_roles.txt @@ -0,0 +1,6 @@ +Custom Roles +------------ + +.. role:: custom(literal) + +:custom:`one` :custom:`two` :custom:`three` diff --git a/test/functional/input/data/errors.txt b/test/functional/input/data/errors.txt new file mode 100644 index 000000000..557f479d3 --- /dev/null +++ b/test/functional/input/data/errors.txt @@ -0,0 +1,9 @@ +Error Handling +============== + +Any errors caught during processing will generate system messages. + +There should be five messages in the following, auto-generated +section, "Docutils System Messages": + +.. section should be added by Docutils automatically diff --git a/test/functional/input/data/header_footer.txt b/test/functional/input/data/header_footer.txt new file mode 100644 index 000000000..875c9fac0 --- /dev/null +++ b/test/functional/input/data/header_footer.txt @@ -0,0 +1,2 @@ +.. header:: Document header +.. footer:: Document footer diff --git a/test/functional/input/data/latex.txt b/test/functional/input/data/latex.txt new file mode 100644 index 000000000..20d59db1e --- /dev/null +++ b/test/functional/input/data/latex.txt @@ -0,0 +1,201 @@ +Some Tests for the LaTeX Writer +=============================== + +These tests have been written to exercise some unusual combinations of +syntax elements which may cause trouble for the LaTeX writer but do +not need to be tested with other writers (e.g. the HTML writer). + +This file is not yet used by any automated test. It is currently only +used to control the visual appearance of the output. + + +Block Quotes +------------ + + This block quote comes directly after the section heading and is + followed by a paragraph. + + This is the second paragraph of the block quote and it contains + some more text filling up some space which would otherwise be + empty. + + -- Attribution + +This is a paragraph. + + This block quote does not have an attribution. + +This is another paragraph. + + Another block quote at the end of the section. + + +More Block Quotes +----------------- + + Block quote followed by a transition. + +---------- + + Another block quote. + + +Sidebars +-------- + +This paragraph precedes the sidebar. This is some text. This is some +text. This is some text. This is some text. This is some text. +This is some text. This is some text. This is some text. + +.. sidebar:: Sidebar Title + + These are the sidebar contents. These are the sidebar contents. + + These are the sidebar contents. These are the sidebar contents. + + These are the sidebar contents. These are the sidebar contents. + These are the sidebar contents. These are the sidebar contents. + +This paragraph follows the sidebar. This is some text. This is some +text. This is some text. + +This is some text. This is some text. This is some text. This is +some text. This is some text. This is some text. This is some text. + + +Next Section +------------ + +This section comes after the sidebar, and this text should float +around the sidebar as well. This is some text. This is some text. +This is some text. This is some text. This is some text. This is +some text. This is some text. This is some text. This is some text. +This is some text. This is some text. This is some text. This is +some text. This is some text. + +This is some text. This is some text. This is some text. This is +some text. This is some text. This is some text. This is some text. +This is some text. This is some text. This is some text. + + +Nested Elements +--------------- + +:Field list: | Line + | Block +:Field 2: * Bullet + * list +:Another (longer) field: * Bullet + * list +:Yet another long field: + * .. comment + + Bullet + + .. comment + + * .. comment + + list + + .. comment + +:Field: * This + + is + + a + + * bullet + + list + +:Field: * | This is + | a bullet + * | list with + | line blocks +:Last field: Last field. + +* * * * * * * * Deeply nested list. + +1. 2. 3. 4. 5. 6. 7. 8. Deeply nested list. + ++-----------------+ +| | Line block | +| | +| * Bullet list | +| | +| :: | +| | +| Literal | +| block | ++-----------------+ +| :Field 1: | +| Text. | +| :Field 2: | +| More text. | ++-----------------+ +| +-------+-----+ | +| | A |* foo| | +| | nested| | | +| | table.|* bar| | +| +-------+-----+ | ++-----------------+ +| This is a | +| paragraph. | +| | +| +-------+-----+ | +| | A |* foo| | +| | nested| | | +| | table.|* bar| | +| +-------+-----+ | +| | +| Another longer | +| paragraph. | ++-----------------+ +| * A list. | +| * A list. | +| | +| +-------+-----+ | +| | A |* foo| | +| | nested| | | +| | table.|* bar| | +| +-------+-----+ | +| | +| * Another list. | +| * Another list. | ++-----------------+ +| Foo | +| | +| Bar | ++-----------------+ +| * Foo | +| | +| * Bar | ++-----------------+ +| * This is a | +| paragraph. | +| | +| This is a | +| paragraph. | +| | +| * This is a | +| paragraph. | +| | +| This is a | +| paragraph. | ++-----------------+ + + +Images +====== + +Image with 20% width: + +.. image:: ../../../docs/user/rst/images/title.png + :width: 20% + +Image with 100% width: + +.. image:: ../../../docs/user/rst/images/title.png + :width: 100% diff --git a/test/functional/input/data/list_table.txt b/test/functional/input/data/list_table.txt new file mode 100644 index 000000000..632285e36 --- /dev/null +++ b/test/functional/input/data/list_table.txt @@ -0,0 +1,24 @@ +List Tables +----------- + +Here's a list table exercising all features: + +.. list-table:: list table with integral header + :class: test + :widths: 10 20 30 + :header-rows: 1 + :stub-columns: 1 + + * - Treat + - Quantity + - Description + * - Albatross + - 2.99 + - On a stick! + * - Crunchy Frog + - 1.49 + - If we took the bones out, it wouldn't be + crunchy, now would it? + * - Gannet Ripple + - 1.99 + - On a stick! diff --git a/test/functional/input/data/nonalphanumeric.txt b/test/functional/input/data/nonalphanumeric.txt new file mode 100644 index 000000000..4c4ee7343 --- /dev/null +++ b/test/functional/input/data/nonalphanumeric.txt @@ -0,0 +1,13 @@ +Monospaced non-alphanumeric characters +-------------------------------------- + +These are all ASCII characters except a-zA-Z0-9 and space: + +``!!!"""###$$$%%%&&&'''((()))***+++,,,---...///:::`` + +``;;;<<<===>>>???@@@[[[\\\]]]^^^___```{{{|||}}}~~~`` + +``xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`` + +The two lines of non-alphanumeric characters should both have the same +width as the third line. diff --git a/test/functional/input/data/standard.txt b/test/functional/input/data/standard.txt new file mode 100644 index 000000000..a0d1570ed --- /dev/null +++ b/test/functional/input/data/standard.txt @@ -0,0 +1,753 @@ +.. This is a comment. Note how any initial comments are moved by + transforms to after the document title, subtitle, and docinfo. + +.. _doctitle: + +================================ + reStructuredText Test Document +================================ + +.. Above is the document title, and below is the subtitle. + They are transformed from section titles after parsing. + +.. _subtitle: + +-------------------------------- + Examples of Syntax Constructs +-------------------------------- + +.. bibliographic fields (which also require a transform): + +:Author: David Goodger +:Address: 123 Example Street + Example, EX Canada + A1B 2C3 +:Contact: goodger@users.sourceforge.net +:Authors: Me; Myself; I +:organization: humankind +:date: Now, or yesterday. Or maybe even *before* yesterday. +:status: This is a "work in progress" +:revision: is managed by a version control system. +:version: 1 +:copyright: This document has been placed in the public domain. You + may do with it as you wish. You may copy, modify, + redistribute, reattribute, sell, buy, rent, lease, + destroy, or improve it, quote it at length, excerpt, + incorporate, collate, fold, staple, or mutilate it, or do + anything else to it that your or anyone else's heart + desires. +:field name: This is a "generic bibliographic field". +:field name "2": + Generic bibliographic fields may contain multiple body elements. + + Like this. + +:Dedication: + + For Docutils users & co-developers. + +:abstract: + + This is a test document, containing at least one example of each + reStructuredText construct. + +.. meta:: + :keywords: reStructuredText, test, parser + :description lang=en: A test document, containing at least one + example of each reStructuredText construct. + +.. contents:: Table of Contents +.. section-numbering:: + + +Structural Elements +=================== + +Section Title +------------- +Section Subtitle +```````````````` + +That's it, the text just above this line. + +Empty Section +------------- + +Transitions +----------- + +Here's a transition: + +--------- + +It divides the section. Transitions may also occur between sections: + +--------- + +Body Elements +============= + +Paragraphs +---------- + +A paragraph. + +Inline Markup +````````````` + +Paragraphs contain text and may contain inline markup: *emphasis*, +**strong emphasis**, ``inline literals``, standalone hyperlinks +(http://www.python.org), external hyperlinks (Python_), internal +cross-references (example_), external hyperlinks with embedded URIs +(`Python web site <http://www.python.org>`__), `anonymous hyperlink +references`__ (`a second reference`__), footnote references (manually +numbered [1]_, anonymous auto-numbered [#]_, labeled auto-numbered +[#label]_, or symbolic [*]_), citation references ([CIT2002]_), +substitution references (|example|), and _`inline hyperlink targets` +(see Targets_ below for a reference back to here). Character-level +inline markup is also possible (although exceedingly ugly!) in *re*\ +``Structured``\ *Text*. Problems are indicated by |problematic| text +(generated by processing errors; this one is intentional). Here is a +reference to the doctitle_ and the subtitle_. + +__ http://www.python.org/ +__ http://docutils.sourceforge.net/ + +The default role for interpreted text is `Title Reference`. Here are +some explicit interpreted text roles: a PEP reference (:PEP:`287`); an +RFC reference (:RFC:`2822`); a :sub:`subscript`; a :sup:`superscript`; +and explicit roles for :emphasis:`standard` :strong:`inline` +:literal:`markup`. + +.. DO NOT RE-WRAP THE FOLLOWING PARAGRAPH! + +Let's test wrapping and whitespace significance in inline literals: +``This is an example of --inline-literal --text, --including some-- +strangely--hyphenated-words. Adjust-the-width-of-your-browser-window +to see how the text is wrapped. -- ---- -------- Now note the +spacing between the words of this sentence (words +should be grouped in pairs).`` + +If the ``--pep-references`` option was supplied, there should be a +live link to PEP 258 here. + +Bullet Lists +------------ + +- A bullet list + + + Nested bullet list. + + Nested item 2. + +- Item 2. + + Paragraph 2 of item 2. + + * Nested bullet list. + * Nested item 2. + + - Third level. + - Item 2. + + * Nested item 3. + + * This nested list should be compacted by the HTML writer. + + .. _target: + + .. Even if this item contains a target and a comment. + +Enumerated Lists +---------------- + +1. Arabic numerals. + + a) lower alpha) + + (i) (lower roman) + + A. upper alpha. + + I) upper roman) + +2. Lists that don't start at 1: + + 3. Three + + 4. Four + + C. C + + D. D + + iii. iii + + iv. iv + +Definition Lists +---------------- + +Term + Definition +Term : classifier + Definition paragraph 1. + + Definition paragraph 2. +Term + Definition +Term : classifier one : classifier two + Definition + +Field Lists +----------- + +:what: Field lists map field names to field bodies, like database + records. They are often part of an extension syntax. They are + an unambiguous variant of RFC 2822 fields. + +:how arg1 arg2: + + The field marker is a colon, the field name, and a colon. + + The field body may contain one or more body elements, indented + relative to the field marker. + +:credits: + + .. class:: credits + + This paragraph has the `credits` class set. (This is actually not + about credits but just for ensuring that the class attribute + doesn't get stripped away.) + +Option Lists +------------ + +For listing command-line options: + +-a command-line option "a" +-b file options can have arguments + and long descriptions +--long options can be long also +--input=file long options can also have + arguments + +--very-long-option + The description can also start on the next line. + + The description may contain multiple body elements, + regardless of where it starts. + +-x, -y, -z Multiple options are an "option group". +-v, --verbose Commonly-seen: short & long options. +-1 file, --one=file, --two file + Multiple options with arguments. +/V DOS/VMS-style options too + +There must be at least two spaces between the option and the +description. + +Literal Blocks +-------------- + +Literal blocks are indicated with a double-colon ("::") at the end of +the preceding paragraph (over there ``-->``). They can be indented:: + + if literal_block: + text = 'is left as-is' + spaces_and_linebreaks = 'are preserved' + markup_processing = None + +Or they can be quoted without indentation:: + +>> Great idea! +> +> Why didn't I think of that? + +Line Blocks +----------- + +This section tests line blocks. Line blocks are body elements which +consist of lines and other line blocks. Nested line blocks cause +indentation. + +| This is a line block. It ends with a blank line. +| New lines begin with a vertical bar ("|"). +| Line breaks and initial indent are significant, and preserved. +| Continuation lines are also possible. A long line that is intended + to wrap should begin with a space in place of the vertical bar. +| The left edge of a continuation line need not be aligned with + the left edge of the text above it. + +| This is a second line block. +| +| Blank lines are permitted internally, but they must begin with a "|". + +Another line block, surrounded by paragraphs: + +| And it's no good waiting by the window +| It's no good waiting for the sun +| Please believe me, the things you dream of +| They don't fall in the lap of no-one + +Take it away, Eric the Orchestra Leader! + + | A one, two, a one two three four + | + | Half a bee, philosophically, + | must, *ipso facto*, half not be. + | But half the bee has got to be, + | *vis a vis* its entity. D'you see? + | + | But can a bee be said to be + | or not to be an entire bee, + | when half the bee is not a bee, + | due to some ancient injury? + | + | Singing... + +Block Quotes +------------ + +Block quotes consist of indented body elements: + + My theory by A. Elk. Brackets Miss, brackets. This theory goes + as follows and begins now. All brontosauruses are thin at one + end, much much thicker in the middle and then thin again at the + far end. That is my theory, it is mine, and belongs to me and I + own it, and what it is too. + + -- Anne Elk (Miss) + +Doctest Blocks +-------------- + +>>> print 'Python-specific usage examples; begun with ">>>"' +Python-specific usage examples; begun with ">>>" +>>> print '(cut and pasted from interactive Python sessions)' +(cut and pasted from interactive Python sessions) + +Footnotes +--------- + +.. [1] A footnote contains body elements, consistently indented by at + least 3 spaces. + + This is the footnote's second paragraph. + +.. [#label] Footnotes may be numbered, either manually (as in [1]_) or + automatically using a "#"-prefixed label. This footnote has a + label so it can be referred to from multiple places, both as a + footnote reference ([#label]_) and as a hyperlink reference + (label_). + +.. [#] This footnote is numbered automatically and anonymously using a + label of "#" only. + + This is the second paragraph. + + And this is the third paragraph. + +.. [*] Footnotes may also use symbols, specified with a "*" label. + Here's a reference to the next footnote: [*]_. + +.. [*] This footnote shows the next symbol in the sequence. + +.. [4] Here's an unreferenced footnote, with a reference to a + nonexistent footnote: [5]_. + +Citations +--------- + +.. [CIT2002] Citations are text-labeled footnotes. They may be + rendered separately and differently from footnotes. + +Here's a reference to the above, [CIT2002]_, and a [nonexistent]_ +citation. + +.. _Another Target: + +Targets +------- + +.. _example: + +This paragraph is pointed to by the explicit "example" target. A +reference can be found under `Inline Markup`_, above. `Inline +hyperlink targets`_ are also possible. + +Section headers are implicit targets, referred to by name. See +Targets_, which is a subsection of `Body Elements`_. + +Explicit external targets are interpolated into references such as +"Python_". + +.. _Python: http://www.python.org/ + +Targets may be indirect and anonymous. Thus `this phrase`__ may also +refer to the Targets_ section. + +__ Targets_ + +Here's a `hyperlink reference without a target`_, which generates an +error. + +Duplicate Target Names +`````````````````````` + +Duplicate names in section headers or other implicit targets will +generate "info" (level-1) system messages. Duplicate names in +explicit targets will generate "warning" (level-2) system messages. + +Duplicate Target Names +`````````````````````` + +Since there are two "Duplicate Target Names" section headers, we +cannot uniquely refer to either of them by name. If we try to (like +this: `Duplicate Target Names`_), an error is generated. + +Directives +---------- + +.. contents:: :local: + +These are just a sample of the many reStructuredText Directives. For +others, please see +http://docutils.sourceforge.net/docs/ref/rst/directives.html. + +Document Parts +`````````````` + +An example of the "contents" directive can be seen above this section +(a local, untitled table of contents_) and at the beginning of the +document (a document-wide `table of contents`_). + +Images +`````` + +An image directive (also clickable -- a hyperlink reference): + +.. image:: ../../../docs/user/rst/images/title.png + :class: class1 class2 + :target: directives_ + +Image with multiple IDs: + +.. _image target 1: +.. _image target 2: +.. _image target 3: +.. image:: ../../../docs/user/rst/images/title.png + +A centered image: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :align: center + +A left-aligned image: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :align: left + +A right-aligned image: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :align: right + +A figure directive: + +.. figure:: ../../../docs/user/rst/images/biohazard.png + :figclass: figclass1 figclass2 + :class: class1 class2 + :alt: reStructuredText, the markup syntax + :align: right + :width: 50 + + A figure is an image with a caption and/or a legend: + + +------------+-----------------------------------------------+ + | re | Revised, revisited, based on 're' module. | + +------------+-----------------------------------------------+ + | Structured | Structure-enhanced text, structuredtext. | + +------------+-----------------------------------------------+ + | Text | Well it is, isn't it? | + +------------+-----------------------------------------------+ + + This paragraph is also part of the legend. + +.. figure:: ../../../docs/user/rst/images/biohazard.png + :figclass: figclass1 figclass2 + :class: class1 class2 + :alt: reStructuredText, the markup syntax + :align: left + :width: 50 + + A left-aligned figure. + + This is the legend. + +This paragraph might flow around the figure... + +A centered figure: + +.. figure:: ../../../docs/user/rst/images/biohazard.png + :align: center + :width: 50 + + This is the caption. + + This is the legend. + + The legend may consist of several paragraphs. + +This paragraph might flow around the figure... + +A left-aligned figure: + +.. figure:: ../../../docs/user/rst/images/biohazard.png + :align: left + :width: 50 + + This is the caption. + + This is the legend. + + The legend may consist of several paragraphs. + +This paragraph might flow around the figure... + +Now widths: + +An image 2 em wide: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :width: 2 em + +An image 2 em wide and 30 pixel high: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :width: 2em + :height: 30 px + +An image occupying 70% of the line width: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :width: 70% + +An image 3 cm high: + +.. image:: ../../../docs/user/rst/images/biohazard.png + :height: 3 cm + + +Admonitions +``````````` + +.. Attention:: Directives at large. + +.. Caution:: + + Don't take any wooden nickels. + +.. DANGER:: Mad scientist at work! + +.. Error:: Does not compute. + +.. Hint:: It's bigger than a bread box. + +.. Important:: + - Wash behind your ears. + - Clean up your room. + - Call your mother. + - Back up your data. + +.. Note:: This is a note. + +.. Tip:: 15% if the service is good. + +.. WARNING:: Strong prose may provoke extreme mental exertion. + Reader discretion is strongly advised. + +.. admonition:: And, by the way... + + You can make up your own admonition too. + + .. _Docutils: http://docutils.sourceforge.net/ + +Topics, Sidebars, and Rubrics +````````````````````````````` + +.. sidebar:: Sidebar Title + :subtitle: Optional Subtitle + + This is a sidebar. It is for text outside the flow of the main + text. + + .. rubric:: This is a rubric inside a sidebar + + Sidebars often appears beside the main text with a border and + background color. + +.. topic:: Topic Title + + This is a topic. + +.. rubric:: This is a rubric + +Target Footnotes +```````````````` + +.. target-notes:: + + +Replacement Text +```````````````` + +I recommend you try |Python|_. + +.. |Python| replace:: Python, *the* best language around + +Compound Paragraph +`````````````````` + +.. compound:: + :class: some-class + + Compound 1, paragraph 1. + + Compound 1, paragraph 2. + + * Compound 1, list item one. + * Compound 1, list item two. + +Another compound statement: + +.. compound:: + + Compound 2, a literal block:: + + Compound 2, literal. + + Compound 2, this is a test. + +.. compound:: + + Compound 3, only consisting of one paragraph. + +.. compound:: + + :: + + Compound 4. + This one starts with a literal block. + + Compound 4, a paragraph. + +Now something *really* perverted -- a nested compound block. This is +just to test that it works at all; the results don't have to be +meaningful. + +.. compound:: + + Compound 5, block 1 (a paragraph). + + .. compound:: + + Compound 6, block 2 in compound 5. + + Compound 6, another paragraph. + + Compound 5, block 3 (a paragraph). + +.. compound:: + + Compound 7, with a table inside: + + +--------------------+--------------------+--------------------+ + | Left cell, first | Middle cell, | Right cell. | + | paragraph. | consisting of | | + | | exactly one | Paragraph 2. | + | Left cell, second | paragraph. | | + | paragraph. | | Paragraph 3. | + +--------------------+--------------------+--------------------+ + + Compound 7, a paragraph after the table. + + Compound 7, another paragraph. + +Parsed Literal Blocks +````````````````````` + +.. parsed-literal:: + + This is a parsed literal block. + This line is indented. The next line is blank. + + Inline markup is supported, e.g. *emphasis*, **strong**, ``literal + text``, footnotes [1]_, _`targets`, and `references + <http://www.python.org/>`_. + +Substitution Definitions +------------------------ + +An inline image (|example|) example: + +.. |EXAMPLE| image:: ../../../docs/user/rst/images/biohazard.png + +(Substitution definitions are not visible in the HTML source.) + +Comments +-------- + +Here's one: + +.. Comments begin with two dots and a space. Anything may + follow, except for the syntax of footnotes, hyperlink + targets, directives, or substitution definitions. + + Double-dashes -- "--" -- must be escaped somehow in HTML output. + +(View the HTML source to see the comment.) + +Raw text +-------- + +This does not necessarily look nice, because there may be missing white space. + +It's just there to freeze the behavior. + +.. raw:: html latex + + A test. + +.. raw:: html latex + + Second test. + +.. class:: myclass + +.. raw:: html latex + + Another test with myclass set. + +.. role:: raw-role(raw) + :format: html latex + :class: myrawroleclass + +This is the :raw-role:`fourth test` with myrawroleclass set. + +.. raw:: html + + Fifth test in HTML.<br />Line two. + +.. raw:: latex + + Fifth test in LaTeX.\\Line two. + +Container +--------- + +.. container:: custom + + paragraph 1 + + paragraph 2 diff --git a/test/functional/input/data/table_colspan.txt b/test/functional/input/data/table_colspan.txt new file mode 100644 index 000000000..54294fdd2 --- /dev/null +++ b/test/functional/input/data/table_colspan.txt @@ -0,0 +1,15 @@ +Colspanning tables +------------------ + +This table has a cell spanning two columns: + +===== ===== ====== + Inputs Output +------------ ------ + A B A or B +===== ===== ====== +False False False +True False True +False True True +True True True +===== ===== ====== diff --git a/test/functional/input/data/table_complex.txt b/test/functional/input/data/table_complex.txt new file mode 100644 index 000000000..8ff37180e --- /dev/null +++ b/test/functional/input/data/table_complex.txt @@ -0,0 +1,21 @@ +Complex tables +-------------- + +Here's a complex table, which should test all features. + ++------------------------+------------+----------+----------+ +| Header row, column 1 | Header 2 | Header 3 | Header 4 | +| (header rows optional) | | | | ++========================+============+==========+==========+ +| body row 1, column 1 | column 2 | column 3 | column 4 | ++------------------------+------------+----------+----------+ +| body row 2 | Cells may span columns. | ++------------------------+------------+---------------------+ +| body row 3 | Cells may | - Table cells | ++------------------------+ span rows. | - contain | +| body row 4 | | - body elements. | +| | Paragraph. | | ++------------------------+------------+----------+----------+ +| body row 5 | Cells may also be | | +| | empty: ``-->`` | | ++------------------------+-----------------------+----------+ diff --git a/test/functional/input/data/table_rowspan.txt b/test/functional/input/data/table_rowspan.txt new file mode 100644 index 000000000..5df3109c4 --- /dev/null +++ b/test/functional/input/data/table_rowspan.txt @@ -0,0 +1,15 @@ +Rowspanning tables +------------------ + +Here's a table with cells spanning several rows: + ++------------------------+------------+------------------+ +| Header row, column 1 | Header 2 | Header 3 | +| (header rows optional) | | | ++========================+============+==================+ +| body row 1, column 1 | column 2 | column 3 | ++------------------------+------------+------------------+ +| body row 2 | Cells may | Another | ++------------------------+ span rows. | rowspanning | +| body row 3 | | cell. | ++------------------------+------------+------------------+ diff --git a/test/functional/input/data/unicode.txt b/test/functional/input/data/unicode.txt new file mode 100644 index 000000000..4bdd57653 --- /dev/null +++ b/test/functional/input/data/unicode.txt @@ -0,0 +1,27 @@ +Various non-ASCII characters +---------------------------- + += =================================== +© copyright sign +® registered sign +« left pointing guillemet +» right pointing guillemet +– en-dash +— em-dash +‘ single turned comma quotation mark +’ single comma quotation mark +‚ low single comma quotation mark +“ double turned comma quotation mark +” double comma quotation mark +„ low double comma quotation mark +† dagger +‡ double dagger +… ellipsis +™ trade mark sign +⇔ left-right double arrow += =================================== + +The following line should not be wrapped, because it uses +non-breakable spaces: + +X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X diff --git a/test/functional/input/field_list.txt b/test/functional/input/field_list.txt new file mode 100644 index 000000000..fa04ba6ca --- /dev/null +++ b/test/functional/input/field_list.txt @@ -0,0 +1,5 @@ +:short: This field's name is short. +:medium-length: This field's name is medium-length. +:long field name: This field's name is long. +:very very long field name: + This field's name is quite long. diff --git a/test/functional/input/latex_docinfo.txt b/test/functional/input/latex_docinfo.txt new file mode 100644 index 000000000..f6c9ba2e4 --- /dev/null +++ b/test/functional/input/latex_docinfo.txt @@ -0,0 +1,10 @@ +:Author: Foo Fred +:Organization: Food Foomatics & Friends +:Contact: foo@food.example.info +:Address: Fox St 13 + Foowood +:Author: Bar Barney +:Organization: Bar-BQ Bar +:Contact: 1-800-BARBQBAR +:Address: Barbara St 16 + South Barwell diff --git a/test/functional/input/pep_html.txt b/test/functional/input/pep_html.txt new file mode 100644 index 000000000..483077131 --- /dev/null +++ b/test/functional/input/pep_html.txt @@ -0,0 +1,32 @@ +PEP: 100 +Title: Test PEP +Version: 42 +Last-Modified: A long time ago. +Author: John Doe <john@example.org> +Discussions-To: <devnull@example.org> +Status: Draft +Type: Standards Track +Content-Type: text/x-rst +Created: 01-Jun-2001 +Post-History: 13-Jun-2001 + + +Abstract +======== + +This is just a test [#]_. See the `PEP repository`_ for the real +thing. + +.. _PEP repository: http://www.python.org/peps/ + + +Copyright +========= + +This document has been placed in the public domain. + + +References and Footnotes +======================== + +.. [#] PEP editors: peps@python.org diff --git a/test/functional/input/simple.txt b/test/functional/input/simple.txt new file mode 100644 index 000000000..492e4233b --- /dev/null +++ b/test/functional/input/simple.txt @@ -0,0 +1 @@ +simple input diff --git a/test/functional/input/standalone_rst_html4css1.txt b/test/functional/input/standalone_rst_html4css1.txt new file mode 100644 index 000000000..3c2cf80c6 --- /dev/null +++ b/test/functional/input/standalone_rst_html4css1.txt @@ -0,0 +1,8 @@ +.. include:: data/standard.txt +.. include:: data/header_footer.txt +.. include:: data/table_colspan.txt +.. include:: data/table_rowspan.txt +.. include:: data/table_complex.txt +.. include:: data/list_table.txt +.. include:: data/custom_roles.txt +.. include:: data/errors.txt diff --git a/test/functional/input/standalone_rst_latex.txt b/test/functional/input/standalone_rst_latex.txt new file mode 100644 index 000000000..09a4f8890 --- /dev/null +++ b/test/functional/input/standalone_rst_latex.txt @@ -0,0 +1,12 @@ +.. include:: data/standard.txt +.. include:: data/table_colspan.txt +.. include:: data/table_rowspan.txt + + +Tests for the LaTeX writer +========================== + +.. include:: data/nonalphanumeric.txt +.. include:: data/unicode.txt + +.. include:: data/errors.txt diff --git a/test/functional/input/standalone_rst_newlatex.txt b/test/functional/input/standalone_rst_newlatex.txt new file mode 100644 index 000000000..81b4e5ea6 --- /dev/null +++ b/test/functional/input/standalone_rst_newlatex.txt @@ -0,0 +1,12 @@ +.. include:: data/standard.txt +.. include:: data/table_colspan.txt +.. include:: data/latex.txt + + +Tests for the LaTeX writer +========================== + +.. include:: data/nonalphanumeric.txt +.. include:: data/unicode.txt + +.. include:: data/errors.txt diff --git a/test/functional/input/standalone_rst_pseudoxml.txt b/test/functional/input/standalone_rst_pseudoxml.txt new file mode 100644 index 000000000..05f0287d0 --- /dev/null +++ b/test/functional/input/standalone_rst_pseudoxml.txt @@ -0,0 +1,7 @@ +.. include:: data/standard.txt +.. include:: data/header_footer.txt +.. include:: data/table_colspan.txt +.. include:: data/table_rowspan.txt +.. include:: data/table_complex.txt +.. include:: data/list_table.txt +.. include:: data/errors.txt diff --git a/test/functional/input/standalone_rst_s5_html.txt b/test/functional/input/standalone_rst_s5_html.txt new file mode 100644 index 000000000..863cc77b6 --- /dev/null +++ b/test/functional/input/standalone_rst_s5_html.txt @@ -0,0 +1,126 @@ +.. include:: <s5defs.txt> + +============= + Slide Shows +============= + +:Author: David Goodger +:Date: 2005-11-28 + +.. contents:: + :class: handout + +.. class:: handout + + This is a test. This is only a test. If this were a real slide + show, there would be a projector handy. + +Let's test the S5/HTML writer! + +.. 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. + +.. |bullet| unicode:: U+02022 +.. |mode| unicode:: U+00D8 .. capital o with stroke +.. footer:: Location |bullet| Date + + +Introduction +============ + +.. class:: compact + +* 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. + +* ``rst2s5.py`` + + .. class:: handout + + The front-end tool to generate S5 slide shows. + + +Features (1) +============ + +.. class:: left + +A flush-left paragraph + +.. class:: center + +A centered paragraph + +.. class:: right + +A flush-right paragraph + +Some 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` + +Features (2) +============ + +`Some` `incremental` `text.` + +.. class:: incremental open + + * :tiny:`tiny` (class & role name: "tiny", e.g. "``:tiny:`text```") + * :small:`small` ("small") + * normal (unstyled) + * :big:`big` ("big") + * :huge:`huge` ("huge") + + +Checklist +========= + +* The document title should be duplicated on each slide in the footer + (except for the first slide, ``slide0``, where the entire footer is + disabled). + +* The footer also contains a second line, "Location |bullet| Date" + +* There's no table of contents on the first slide, although it does + appear in the handout/outline. + +* Handout material is not displayed in presentation mode. + +* The theme directories should be created, and the theme files copied + over. diff --git a/test/functional/output/README.txt b/test/functional/output/README.txt new file mode 100644 index 000000000..ce6dc9861 --- /dev/null +++ b/test/functional/output/README.txt @@ -0,0 +1,3 @@ +This is the directory where the actual output is stored. + +This README.txt is just a placeholder to make CVS create the directory. diff --git a/test/functional/tests/_default.py b/test/functional/tests/_default.py new file mode 100644 index 000000000..2835c5b2e --- /dev/null +++ b/test/functional/tests/_default.py @@ -0,0 +1,7 @@ +# Default settings for all tests. + +settings_overrides['report_level'] = 2 +settings_overrides['halt_level'] = 5 +settings_overrides['warning_stream'] = '' +settings_overrides['input_encoding'] = 'utf-8' +settings_overrides['embed_stylesheet'] = 0 diff --git a/test/functional/tests/_standalone_rst_defaults.py b/test/functional/tests/_standalone_rst_defaults.py new file mode 100644 index 000000000..b51704929 --- /dev/null +++ b/test/functional/tests/_standalone_rst_defaults.py @@ -0,0 +1,6 @@ +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" + +# Settings. +settings_overrides['sectsubtitle_xform'] = 1 diff --git a/test/functional/tests/compact_lists.py b/test/functional/tests/compact_lists.py new file mode 100644 index 000000000..3ac4c3f8b --- /dev/null +++ b/test/functional/tests/compact_lists.py @@ -0,0 +1,11 @@ +# Source and destination file names. +test_source = "compact_lists.txt" +test_destination = "compact_lists.html" + +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" +writer_name = "html" + +# Settings +#settings_overrides['key'] = diff --git a/test/functional/tests/dangerous.py b/test/functional/tests/dangerous.py new file mode 100644 index 000000000..620a927ba --- /dev/null +++ b/test/functional/tests/dangerous.py @@ -0,0 +1,12 @@ +# Source and destination file names. +test_source = "dangerous.txt" +test_destination = "dangerous.html" + +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" +writer_name = "html" + +# Settings +settings_overrides['file_insertion_enabled'] = 0 +settings_overrides['raw_enabled'] = 0 diff --git a/test/functional/tests/field_name_limit.py b/test/functional/tests/field_name_limit.py new file mode 100644 index 000000000..db79d4c67 --- /dev/null +++ b/test/functional/tests/field_name_limit.py @@ -0,0 +1,12 @@ +# Source and destination file names. +test_source = "field_list.txt" +test_destination = "field_name_limit.html" + +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" +writer_name = "html" + +# Settings +settings_overrides['field_name_limit'] = 0 # no limit +settings_overrides['docinfo_xform'] = 0 diff --git a/test/functional/tests/latex_docinfo.py b/test/functional/tests/latex_docinfo.py new file mode 100644 index 000000000..3f9c34455 --- /dev/null +++ b/test/functional/tests/latex_docinfo.py @@ -0,0 +1,12 @@ +# Source and destination file names. +test_source = "latex_docinfo.txt" +test_destination = "latex_docinfo.tex" + +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" +writer_name = "latex" + +# Extra setting we need + +settings_overrides['use_latex_docinfo'] = 1 diff --git a/test/functional/tests/misc_rst_html4css1.py b/test/functional/tests/misc_rst_html4css1.py new file mode 100644 index 000000000..861a9e9c5 --- /dev/null +++ b/test/functional/tests/misc_rst_html4css1.py @@ -0,0 +1,14 @@ +# Source and destination file names. +test_source = "simple.txt" +test_destination = "misc_rst_html4css1.html" + +# Keyword parameters passed to publish_file. +reader_name = "standalone" +parser_name = "rst" +writer_name = "html4css1" + +# Settings +# test for encoded attribute value: +settings_overrides['stylesheet'] = 'foo&bar.css' +settings_overrides['stylesheet_path'] = '' +settings_overrides['embed_stylesheet'] = 0 diff --git a/test/functional/tests/pep_html.py b/test/functional/tests/pep_html.py new file mode 100644 index 000000000..00e127ba7 --- /dev/null +++ b/test/functional/tests/pep_html.py @@ -0,0 +1,14 @@ +# Source and destination file names. +test_source = "pep_html.txt" +test_destination = "pep_html.html" + +# Keyword parameters passed to publish_file. +reader_name = "pep" +parser_name = "rst" +writer_name = "pep_html" + +# Settings +settings_overrides['python_home'] = "http://www.python.org" +settings_overrides['pep_home'] = "http://www.python.org/peps" +settings_overrides['no_random'] = 1 +settings_overrides['cloak_email_addresses'] = 1 diff --git a/test/functional/tests/standalone_rst_html4css1.py b/test/functional/tests/standalone_rst_html4css1.py new file mode 100644 index 000000000..c34298eab --- /dev/null +++ b/test/functional/tests/standalone_rst_html4css1.py @@ -0,0 +1,10 @@ +execfile('functional/tests/_standalone_rst_defaults.py') + +# Source and destination file names. +test_source = "standalone_rst_html4css1.txt" +test_destination = "standalone_rst_html4css1.html" + +# Keyword parameters passed to publish_file. +writer_name = "html4css1" + +# Settings: settings_overrides['setting'] = value diff --git a/test/functional/tests/standalone_rst_latex.py b/test/functional/tests/standalone_rst_latex.py new file mode 100644 index 000000000..f0c40b75a --- /dev/null +++ b/test/functional/tests/standalone_rst_latex.py @@ -0,0 +1,8 @@ +execfile('functional/tests/_standalone_rst_defaults.py') + +# Source and destination file names. +test_source = "standalone_rst_latex.txt" +test_destination = "standalone_rst_latex.tex" + +# Keyword parameters passed to publish_file. +writer_name = "latex" diff --git a/test/functional/tests/standalone_rst_pseudoxml.py b/test/functional/tests/standalone_rst_pseudoxml.py new file mode 100644 index 000000000..b9b2df309 --- /dev/null +++ b/test/functional/tests/standalone_rst_pseudoxml.py @@ -0,0 +1,8 @@ +execfile('functional/tests/_standalone_rst_defaults.py') + +# Source and destination file names. +test_source = "standalone_rst_pseudoxml.txt" +test_destination = "standalone_rst_pseudoxml.txt" + +# Keyword parameters passed to publish_file. +writer_name = "pseudoxml" diff --git a/test/functional/tests/standalone_rst_s5_html_1.py b/test/functional/tests/standalone_rst_s5_html_1.py new file mode 100755 index 000000000..ce27f687a --- /dev/null +++ b/test/functional/tests/standalone_rst_s5_html_1.py @@ -0,0 +1,56 @@ +execfile('functional/tests/_standalone_rst_defaults.py') + +# Source and destination file names: +test_source = 'standalone_rst_s5_html.txt' +test_destination = 'standalone_rst_s5_html_1.html' + +# Keyword parameters passed to publish_file: +writer_name = 's5_html' + +# Settings: +settings_overrides['theme'] = 'small-black' + + +# Extra functional tests. +# Prefix all names with '_' to avoid confusing `docutils.core.publish_file`. + +import filecmp as _filecmp + +def _test_more(expected_dir, output_dir, test_case, parameters): + """Compare ``ui/<theme>`` directories.""" + theme = settings_overrides.get('theme', 'default') + expected = '%s/%s/%s' % (expected_dir, 'ui', theme) + output = '%s/%s/%s' % (output_dir, 'ui', theme) + differences, uniques = _compare_directories(expected, output) + parts = [] + if differences: + parts.append('The following files differ from the expected output:') + parts.extend(differences) + expected = [path.replace('functional/output/', 'functional/expected/') + for path in differences] + parts.append('Please compare the expected and actual output files:') + parts.extend([' diff %s %s' % tup + for tup in zip(expected, differences)]) + parts.append('If the actual output is correct, please replace the ' + 'expected output files:') + parts.extend([' mv %s %s' % tup + for tup in zip(differences, expected)]) + parts.append('and check them in to Subversion:') + parts.extend([' svn commit -m "<comment>" %s' % path + for path in expected]) + if uniques: + parts.append('The following paths are unique:') + parts.extend(uniques) + test_case.assert_(not parts, '\n'.join(parts)) + +def _compare_directories(expected, output): + dircmp = _filecmp.dircmp(expected, output, ['.svn', 'CVS']) + differences = ['%s/%s' % (output, name) for name in dircmp.diff_files] + uniques = (['%s/%s' % (expected, name) for name in dircmp.left_only] + + ['%s/%s' % (output, name) for name in dircmp.right_only]) + for subdir in dircmp.common_dirs: + diffs, uniqs = _compare_directories('%s/%s' % (expected, subdir), + '%s/%s' % (output, subdir)) + differences.extend(diffs) + uniques.extend(uniqs) + return differences, uniques diff --git a/test/functional/tests/standalone_rst_s5_html_2.py b/test/functional/tests/standalone_rst_s5_html_2.py new file mode 100755 index 000000000..aea7a9207 --- /dev/null +++ b/test/functional/tests/standalone_rst_s5_html_2.py @@ -0,0 +1,7 @@ +# initialize with the settings & definitions from test 1: +execfile('functional/tests/standalone_rst_s5_html_1.py') + +# overrides specific to this test: +test_destination = 'standalone_rst_s5_html_2.html' +del settings_overrides['theme'] # use the default +settings_overrides['current_slide'] = 1 |