diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-04-05 02:55:06 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-04-05 02:55:06 +0000 |
| commit | c1b06c883eb471187a1725f2f2e646bb266adad8 (patch) | |
| tree | 6a6278b3f41ea8bfdf1eaa0607d3ba8ddb78d4a1 /docutils/test/functional | |
| parent | b4d89cccc3f3901bb15b38b1b2dd65224f23b44b (diff) | |
| download | docutils-c1b06c883eb471187a1725f2f2e646bb266adad8.tar.gz | |
added "stub-columns" options to "csv-table" and "list-table" directives, plus support, docs, and tests
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3165 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/functional')
3 files changed, 87 insertions, 28 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html index f9cf0a59b..f3b49e496 100644 --- a/docutils/test/functional/expected/standalone_rst_html4css1.html +++ b/docutils/test/functional/expected/standalone_rst_html4css1.html @@ -127,9 +127,10 @@ They are transformed from section titles after parsing. --> <li><a class="reference" href="#colspanning-tables" id="id57" name="id57">2.18 Colspanning tables</a></li> <li><a class="reference" href="#rowspanning-tables" id="id58" name="id58">2.19 Rowspanning tables</a></li> <li><a class="reference" href="#complex-tables" id="id59" name="id59">2.20 Complex tables</a></li> +<li><a class="reference" href="#list-tables" id="id60" name="id60">2.21 List Tables</a></li> </ul> </li> -<li><a class="reference" href="#error-handling" id="id60" name="id60">3 Error Handling</a></li> +<li><a class="reference" href="#error-handling" id="id61" name="id61">3 Error Handling</a></li> </ul> </div> <div class="section" id="structural-elements"> @@ -472,7 +473,7 @@ Here's a reference to the next footnote: <a class="footnote-reference" href="#id <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> <tr><td class="label"><a name="id13">[4]</a></td><td>Here's an unreferenced footnote, with a reference to a -nonexistent footnote: <a href="#id68" name="id69"><span class="problematic" id="id69">[5]_</span></a>.</td></tr> +nonexistent footnote: <a href="#id69" name="id70"><span class="problematic" id="id70">[5]_</span></a>.</td></tr> </tbody> </table> </div> @@ -485,7 +486,7 @@ nonexistent footnote: <a href="#id68" name="id69"><span class="problematic" id=" 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="id15" name="id15">[CIT2002]</a>, and a <a href="#id70" name="id71"><span class="problematic" id="id71">[nonexistent]_</span></a> +<p>Here's a reference to the above, <a class="citation-reference" href="#cit2002" id="id15" name="id15">[CIT2002]</a>, and a <a href="#id71" name="id72"><span class="problematic" id="id72">[nonexistent]_</span></a> citation.</p> </div> <div class="section" id="targets"> @@ -499,7 +500,7 @@ hyperlink targets</a> are also possible.</p> "<a class="reference" href="http://www.python.org/">Python</a> <a class="footnote-reference" href="#id21" id="id23" name="id23">[5]</a>".</p> <p>Targets may be indirect and anonymous. Thus <a class="reference" href="#targets">this phrase</a> may also refer to the <a class="reference" href="#targets">Targets</a> section.</p> -<p>Here's a <a href="#id72" name="id73"><span class="problematic" id="id73">`hyperlink reference without a target`_</span></a>, which generates an +<p>Here's a <a href="#id73" name="id74"><span class="problematic" id="id74">`hyperlink reference without a target`_</span></a>, which generates an error.</p> <div class="section" id="duplicate-target-names"> <h3><a class="toc-backref" href="#id44" name="duplicate-target-names">2.13.1 Duplicate Target Names</a></h3> @@ -511,33 +512,33 @@ explicit targets will generate "warning" (level-2) system messages.</p <h3><a class="toc-backref" href="#id45" name="id18">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="#id74" name="id75"><span class="problematic" id="id75">`Duplicate Target Names`_</span></a>), an error is generated.</p> +this: <a href="#id75" name="id76"><span class="problematic" id="id76">`Duplicate Target Names`_</span></a>), an error is generated.</p> </div> </div> <div class="section" id="directives"> <h2><a class="toc-backref" href="#id46" name="directives">2.14 Directives</a></h2> <div class="contents topic" id="contents"> <ul class="auto-toc simple"> -<li><a class="reference" href="#document-parts" id="id61" name="id61">2.14.1 Document Parts</a></li> -<li><a class="reference" href="#images" id="id62" name="id62">2.14.2 Images</a></li> -<li><a class="reference" href="#admonitions" id="id63" name="id63">2.14.3 Admonitions</a></li> -<li><a class="reference" href="#topics-sidebars-and-rubrics" id="id64" name="id64">2.14.4 Topics, Sidebars, and Rubrics</a></li> -<li><a class="reference" href="#target-footnotes" id="id65" name="id65">2.14.5 Target Footnotes</a></li> -<li><a class="reference" href="#replacement-text" id="id66" name="id66">2.14.6 Replacement Text</a></li> -<li><a class="reference" href="#compound-paragraph" id="id67" name="id67">2.14.7 Compound Paragraph</a></li> +<li><a class="reference" href="#document-parts" id="id62" name="id62">2.14.1 Document Parts</a></li> +<li><a class="reference" href="#images" id="id63" name="id63">2.14.2 Images</a></li> +<li><a class="reference" href="#admonitions" id="id64" name="id64">2.14.3 Admonitions</a></li> +<li><a class="reference" href="#topics-sidebars-and-rubrics" id="id65" name="id65">2.14.4 Topics, Sidebars, and Rubrics</a></li> +<li><a class="reference" href="#target-footnotes" id="id66" name="id66">2.14.5 Target Footnotes</a></li> +<li><a class="reference" href="#replacement-text" id="id67" name="id67">2.14.6 Replacement Text</a></li> +<li><a class="reference" href="#compound-paragraph" id="id68" name="id68">2.14.7 Compound Paragraph</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" id="document-parts"> -<h3><a class="toc-backref" href="#id61" name="document-parts">2.14.1 Document Parts</a></h3> +<h3><a class="toc-backref" href="#id62" 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" id="images"> -<h3><a class="toc-backref" href="#id62" name="images">2.14.2 Images</a></h3> +<h3><a class="toc-backref" href="#id63" name="images">2.14.2 Images</a></h3> <p>An image directive (also clickable -- a hyperlink reference):</p> <div class="image class1 class2 image-reference"><a class="reference" href="#directives"><img alt="../../../docs/user/rst/images/title.png" class="class1 class2" src="../../../docs/user/rst/images/title.png" /></a></div> <p>A figure directive:</p> @@ -567,7 +568,7 @@ document (a document-wide <a class="reference" href="#table-of-contents">table o </div> </div> <div class="section" id="admonitions"> -<h3><a class="toc-backref" href="#id63" name="admonitions">2.14.3 Admonitions</a></h3> +<h3><a class="toc-backref" href="#id64" 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> @@ -616,7 +617,7 @@ Reader discretion is strongly advised.</p> </div> </div> <div class="section" id="topics-sidebars-and-rubrics"> -<h3><a class="toc-backref" href="#id64" name="topics-sidebars-and-rubrics">2.14.4 Topics, Sidebars, and Rubrics</a></h3> +<h3><a class="toc-backref" href="#id65" 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> @@ -633,7 +634,7 @@ background color.</p> <p class="rubric">This is a rubric</p> </div> <div class="section" id="target-footnotes"> -<h3><a class="toc-backref" href="#id65" name="target-footnotes">2.14.5 Target Footnotes</a></h3> +<h3><a class="toc-backref" href="#id66" name="target-footnotes">2.14.5 Target Footnotes</a></h3> <table class="docutils footnote" frame="void" id="id21" rules="none"> <colgroup><col class="label" /><col /></colgroup> <tbody valign="top"> @@ -642,11 +643,11 @@ background color.</p> </table> </div> <div class="section" id="replacement-text"> -<h3><a class="toc-backref" href="#id66" name="replacement-text">2.14.6 Replacement Text</a></h3> +<h3><a class="toc-backref" href="#id67" 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="#id21" id="id24" name="id24">[5]</a>.</p> </div> <div class="section" id="compound-paragraph"> -<h3><a class="toc-backref" href="#id67" name="compound-paragraph">2.14.7 Compound Paragraph</a></h3> +<h3><a class="toc-backref" href="#id68" 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> @@ -857,9 +858,42 @@ empty: <tt class="docutils literal"><span class="pre">--></span></tt></td> </tbody> </table> </div> +<div class="section" id="list-tables"> +<h2><a class="toc-backref" href="#id60" name="list-tables">2.21 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>Treat</th> +<th>Quantity</th> +<th>Description</th> +</tr> +</thead> +<tbody valign="top"> +<tr><th>Albatross</th> +<td>2.99</td> +<td>On a stick!</td> +</tr> +<tr><th>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>Gannet Ripple</th> +<td>1.99</td> +<td>On a stick!</td> +</tr> +</tbody> +</table> +</div> </div> <div class="section" id="error-handling"> -<h1><a class="toc-backref" href="#id60" name="error-handling">3 Error Handling</a></h1> +<h1><a class="toc-backref" href="#id61" 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> @@ -870,17 +904,17 @@ section, "Docutils System Messages":</p> <div class="system-message" id="id19"> <p class="system-message-title">System Message: <a name="id19">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 98); <em><a href="#id20">backlink</a></em></p> Undefined substitution referenced: "problematic".</div> -<div class="system-message" id="id68"> -<p class="system-message-title">System Message: <a name="id68">ERROR/3</a> (<tt class="docutils">functional/input/standalone_rst_html4css1.txt</tt>, line 352); <em><a href="#id69">backlink</a></em></p> +<div class="system-message" id="id69"> +<p class="system-message-title">System Message: <a name="id69">ERROR/3</a> (<tt class="docutils">functional/input/standalone_rst_html4css1.txt</tt>, line 352); <em><a href="#id70">backlink</a></em></p> Unknown target name: "5".</div> -<div class="system-message" id="id70"> -<p class="system-message-title">System Message: <a name="id70">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 361); <em><a href="#id71">backlink</a></em></p> +<div class="system-message" id="id71"> +<p class="system-message-title">System Message: <a name="id71">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 361); <em><a href="#id72">backlink</a></em></p> Unknown target name: "nonexistent".</div> -<div class="system-message" id="id72"> -<p class="system-message-title">System Message: <a name="id72">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 386); <em><a href="#id73">backlink</a></em></p> +<div class="system-message" id="id73"> +<p class="system-message-title">System Message: <a name="id73">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 386); <em><a href="#id74">backlink</a></em></p> Unknown target name: "hyperlink reference without a target".</div> -<div class="system-message" id="id74"> -<p class="system-message-title">System Message: <a name="id74">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 399); <em><a href="#id75">backlink</a></em></p> +<div class="system-message" id="id75"> +<p class="system-message-title">System Message: <a name="id75">ERROR/3</a> (<tt class="docutils">functional/input/data/standard.txt</tt>, line 399); <em><a href="#id76">backlink</a></em></p> Duplicate target name, cannot be used as a unique reference: "duplicate target names".</div> </div> </div> diff --git a/docutils/test/functional/input/data/list_table.txt b/docutils/test/functional/input/data/list_table.txt new file mode 100644 index 000000000..632285e36 --- /dev/null +++ b/docutils/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/docutils/test/functional/input/standalone_rst_html4css1.txt b/docutils/test/functional/input/standalone_rst_html4css1.txt index 68f9de864..3847a089e 100644 --- a/docutils/test/functional/input/standalone_rst_html4css1.txt +++ b/docutils/test/functional/input/standalone_rst_html4css1.txt @@ -2,4 +2,5 @@ .. include:: data/table_colspan.txt .. include:: data/table_rowspan.txt .. include:: data/table_complex.txt +.. include:: data/list_table.txt .. include:: data/errors.txt |
