diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 16:52:14 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2005-03-05 16:52:14 +0000 |
| commit | 5d40570da9d94e4d1fccca8bb724f590ccc4dcde (patch) | |
| tree | 330e0e0ffbb7ca08ccce45e982644cdf69909426 /docutils/test/functional | |
| parent | a4087c4a6e1ea5b8206252c07b50d362cb689c28 (diff) | |
| download | docutils-5d40570da9d94e4d1fccca8bb724f590ccc4dcde.tar.gz | |
relocate internal targets only in front of sections, doctitles and subtitles
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@3008 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/functional')
3 files changed, 23 insertions, 19 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html index c54bf046d..899b86324 100644 --- a/docutils/test/functional/expected/standalone_rst_html4css1.html +++ b/docutils/test/functional/expected/standalone_rst_html4css1.html @@ -18,8 +18,8 @@ </head> <body> <div class="document" id="restructuredtext-test-document"> -<h1 class="title">reStructuredText Test Document</h1> -<h2 class="subtitle" id="examples-of-syntax-constructs">Examples of Syntax Constructs</h2> +<h1 class="title"><span class="target" id="doctitle">reStructuredText Test Document</span></h1> +<h2 class="subtitle" id="examples-of-syntax-constructs"><span class="target" id="subtitle">Examples of Syntax Constructs</span></h2> <table class="docinfo" frame="void" rules="none"> <col class="docinfo-name" /> <col class="docinfo-content" /> @@ -168,7 +168,7 @@ hyperlink targets</span> (see <a class="reference" href="#targets">Targets</a> b 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="#id19" name="id20"><span class="problematic" id="id20">|problematic|</span></a> text (generated by processing errors; this one is -intentional).</p> +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>; @@ -204,14 +204,14 @@ live link to PEP 258 here.</p> </ul> </li> <li>Nested item 3.</li> -<li>This nested list should be compacted by the HTML writer.<!-- Even if this item contains a target and a comment. --> +<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" id="enumerated-lists"> -<h2><a class="toc-backref" href="#id33" name="enumerated-lists">2.3 <span class="target" id="target">Enumerated Lists</span></a></h2> +<h2><a class="toc-backref" href="#id33" name="enumerated-lists">2.3 Enumerated Lists</a></h2> <ol class="arabic"> <li><p class="first">Arabic numerals.</p> <ol class="loweralpha simple"> @@ -490,9 +490,9 @@ citation.</p> </div> <div class="section" id="targets"> <h2><a class="toc-backref" href="#id43" name="targets">2.13 Targets</a></h2> -<p><span class="target" id="example">This paragraph is pointed to by the explicit "example" target. A +<span class="target" id="example"></span><p>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.</span></p> +hyperlink targets</a> are also possible.</p> <p>Section headers are implicit targets, referred to by name. See <a class="reference" href="#targets">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 @@ -868,19 +868,19 @@ section, "Docutils System Messages":</p> <div class="system-messages section"> <h1><a>Docutils System Messages</a></h1> <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 94); <em><a href="#id20">backlink</a></em></p> +<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 348); <em><a href="#id69">backlink</a></em></p> +<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> 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 357); <em><a href="#id71">backlink</a></em></p> +<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> 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 382); <em><a href="#id73">backlink</a></em></p> +<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> 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 395); <em><a href="#id75">backlink</a></em></p> +<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> Duplicate target name, cannot be used as a unique reference: "duplicate target names".</div> </div> </div> diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex index a65919472..9f57af6ea 100644 --- a/docutils/test/functional/expected/standalone_rst_latex.tex +++ b/docutils/test/functional/expected/standalone_rst_latex.tex @@ -302,7 +302,7 @@ hyperlink targets} (see \href{\#targets}{Targets} below for a reference back to 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). +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 @@ -363,7 +363,7 @@ Nested item 3. \item {} This nested list should be compacted by the HTML writer. -% Even if this item contains a target and a comment. +\hypertarget{target}{}% Even if this item contains a target and a comment. \end{itemize} @@ -374,7 +374,7 @@ This nested list should be compacted by the HTML writer. \hypertarget{enumerated-lists}{} \pdfbookmark[1]{2.3~~~Enumerated Lists}{enumerated-lists} -\subsection*{2.3~~~\hypertarget{target}{Enumerated Lists}} +\subsection*{2.3~~~Enumerated Lists} \newcounter{listcnt1} \begin{list}{\arabic{listcnt1}.} { @@ -772,10 +772,10 @@ citation. \hypertarget{targets}{} \pdfbookmark[1]{2.13~~~Targets}{targets} \subsection*{2.13~~~Targets} - -\hypertarget{example}{This paragraph is pointed to by the explicit ``example'' target. A +\hypertarget{example}{} +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.} +hyperlink targets} are also possible. Section headers are implicit targets, referred to by name. See \href{\#targets}{Targets}, which is a subsection of \href{\#body-elements}{Body Elements}. diff --git a/docutils/test/functional/input/data/standard.txt b/docutils/test/functional/input/data/standard.txt index 69afbbc67..95f74820c 100644 --- a/docutils/test/functional/input/data/standard.txt +++ b/docutils/test/functional/input/data/standard.txt @@ -1,6 +1,8 @@ .. 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 ================================ @@ -8,6 +10,8 @@ .. Above is the document title, and below is the subtitle. They are transformed from section titles after parsing. +.. _subtitle: + -------------------------------- Examples of Syntax Constructs -------------------------------- @@ -101,7 +105,7 @@ 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). +intentional). Here is a reference to the doctitle_ and the subtitle_. The default role for interpreted text is `Title Reference`. Here are some explicit interpreted text roles: a PEP reference (:PEP:`287`); an |
