Author: milde Date: 2010-11-25 11:16:45 +0100 (Thu, 25 Nov 2010) New Revision: 6486 Modified: trunk/docutils/docutils/latex2mathml.py trunk/docutils/docutils/writers/html4css1/__init__.py trunk/docutils/test/functional/expected/math.xhtml trunk/docutils/test/functional/expected/standalone_rst_html4css1.html trunk/docutils/test/functional/expected/standalone_rst_latex.tex trunk/docutils/test/functional/expected/standalone_rst_pseudoxml.txt trunk/docutils/test/functional/expected/standalone_rst_xetex.tex trunk/docutils/test/functional/input/data/math.txt trunk/docutils/test/functional/input/data/standard.txt Log: Update html4css1 writer, math, and functional tests. * prepare for math to HTML conversion, * provisions for XTHML 1.1. generation with the "strict" html writer: configurable lang attribute name: "lang" in XHTML 1.0 but "xml:lang" in 1.1, strip whitespace around class arguments, Modified: trunk/docutils/docutils/latex2mathml.py =================================================================== --- trunk/docutils/docutils/latex2mathml.py 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/docutils/latex2mathml.py 2010-11-25 10:16:45 UTC (rev 6486) @@ -1,7 +1,9 @@ #!/usr/bin/env python # -*- coding: utf8 -*- -# :Copyright: © 2010 Jens Jørgen Mortensen, Günter Milde. -# Released without warranties or conditions of any kind +# :Copyright: © 2010 Günter Milde. +# Based on rst2mathml.py from the latex_math sandbox project +# © 2005 Jens Jørgen Mortensen +# :License: Released without warranties or conditions of any kind # under the terms of the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # :Id: $Id$ @@ -223,26 +225,87 @@ # 'overline': # u'\u0305', 'vec': u'\u20D7'} -Greek = { - # Upper case greek letters: - 'Phi': u'\u03a6', 'Xi': u'\u039e', 'Sigma': u'\u03a3', 'Psi': u'\u03a8', 'Delta': u'\u0394', 'Theta': u'\u0398', 'Upsilon': u'\u03d2', 'Pi': u'\u03a0', 'Omega': u'\u03a9', 'Gamma': u'\u0393', 'Lambda': u'\u039b'} -greek = { - # Lower case greek letters: - 'tau': u'\u03c4', 'phi': u'\u03d5', 'xi': u'\u03be', 'iota': u'\u03b9', 'epsilon': u'\u03f5', 'varrho': u'\u03f1', 'varsigma': u'\u03c2', 'beta': u'\u03b2', 'psi': u'\u03c8', 'rho': u'\u03c1', 'delta': u'\u03b4', 'alpha': u'\u03b1', 'zeta': u'\u03b6', 'omega': u'\u03c9', 'varepsilon': u'\u03b5', 'kappa': u'\u03ba', 'vartheta': u'\u03d1', 'chi': u'\u03c7', 'upsilon': u'\u03c5', 'sigma': u'\u03c3', 'varphi': u'\u03c6', 'varpi': u'\u03d6', 'mu': u'\u03bc', 'eta': u'\u03b7', 'theta': u'\u03b8', 'pi': u'\u03c0', 'varkappa': u'\u03f0', 'nu': u'\u03bd', 'gamma': u'\u03b3', 'lambda': u'\u03bb'} +Greek = { # Upper case greek letters: + 'Phi':u'\u03a6', 'Xi':u'\u039e', 'Sigma':u'\u03a3', + 'Psi':u'\u03a8', 'Delta':u'\u0394', 'Theta':u'\u0398', + 'Upsilon':u'\u03d2', 'Pi':u'\u03a0', 'Omega':u'\u03a9', + 'Gamma':u'\u0393', 'Lambda':u'\u039b'} +letters = { # Lower case greek letters (and dotless i, j): + # 'imath':u'i', 'jmath':u'i', # when used with combining accents + 'imath':u'\u0131', 'jmath':u'\u0237', + 'tau':u'\u03c4', 'phi':u'\u03d5', 'xi':u'\u03be', 'iota':u'\u03b9', + 'epsilon':u'\u03f5', 'varrho':u'\u03f1', 'varsigma':u'\u03c2', + 'beta':u'\u03b2', 'psi':u'\u03c8', 'rho':u'\u03c1', + 'delta':u'\u03b4', 'alpha':u'\u03b1', 'zeta':u'\u03b6', + 'omega':u'\u03c9', 'varepsilon':u'\u03b5', 'kappa':u'\u03ba', + 'vartheta':u'\u03d1', 'chi':u'\u03c7', 'upsilon':u'\u03c5', + 'sigma':u'\u03c3', 'varphi':u'\u03c6', 'varpi':u'\u03d6', + 'mu':u'\u03bc', 'eta':u'\u03b7', 'theta':u'\u03b8', 'pi':u'\u03c0', + 'varkappa':u'\u03f0', 'nu':u'\u03bd', 'gamma':u'\u03b3', + 'lambda':u'\u03bb'} + special = { # Binary operation symbols: - 'wedge': u'\u2227', 'diamond': u'\u22c4', 'star': u'\u22c6', 'amalg': u'\u2a3f', 'ast': u'\u2217', 'odot': u'\u2299', 'triangleleft': u'\u25c1', 'bigtriangleup': u'\u25b3', 'ominus': u'\u2296', 'ddagger': u'\u2021', 'wr': u'\u2240', 'otimes': u'\u2297', 'sqcup': u'\u2294', 'oplus': u'\u2295', 'bigcirc': u'\u25cb', 'oslash': u'\u2298', 'sqcap': u'\u2293', 'bullet': u'\u2219', 'cup': u'\u222a', 'cdot': u'\u22c5', 'cap': u'\u2229', 'bigtriangledown': u'\u25bd', 'times': u'\xd7', 'setminus': u'\u2216', 'circ': u'\u2218', 'vee': u'\u2228', 'uplus': u'\u228e', 'mp': u'\u2213', 'dagger': u'\u2020', 'triangleright': u'\u25b7', 'div': u'\xf7', 'pm': u'\xb1', + 'wedge':u'\u2227', 'diamond':u'\u22c4', 'star':u'\u22c6', + 'amalg':u'\u2a3f', 'ast':u'\u2217', 'odot':u'\u2299', + 'triangleleft':u'\u25c1', 'bigtriangleup':u'\u25b3', + 'ominus':u'\u2296', 'ddagger':u'\u2021', 'wr':u'\u2240', + 'otimes':u'\u2297', 'sqcup':u'\u2294', 'oplus':u'\u2295', + 'bigcirc':u'\u25cb', 'oslash':u'\u2298', 'sqcap':u'\u2293', + 'bullet':u'\u2219', 'cup':u'\u222a', 'cdot':u'\u22c5', + 'cap':u'\u2229', 'bigtriangledown':u'\u25bd', 'times':u'\xd7', + 'setminus':u'\u2216', 'circ':u'\u2218', 'vee':u'\u2228', + 'uplus':u'\u228e', 'mp':u'\u2213', 'dagger':u'\u2020', + 'triangleright':u'\u25b7', 'div':u'\xf7', 'pm':u'\xb1', # Relation symbols: - 'subset': u'\u2282', 'propto': u'\u221d', 'geq': u'\u2265', 'ge': u'\u2265', 'sqsubset': u'\u228f', 'Join': u'\u2a1d', 'frown': u'\u2322', 'models': u'\u22a7', 'supset': u'\u2283', 'in': u'\u2208', 'doteq': u'\u2250', 'dashv': u'\u22a3', 'gg': u'\u226b', 'leq': u'\u2264', 'succ': u'\u227b', 'vdash': u'\u22a2', 'cong': u'\u2245', 'simeq': u'\u2243', 'subseteq': u'\u2286', 'parallel': u'\u2225', 'equiv': u'\u2261', 'ni': u'\u220b', 'le': u'\u2264', 'approx': u'\u2248', 'precsim': u'\u227e', 'sqsupset': u'\u2290', 'll': u'\u226a', 'sqsupseteq': u'\u2292', 'mid': u'\u2223', 'prec': u'\u227a', 'succsim': u'\u227f', 'bowtie': u'\u22c8', 'perp': u'\u27c2', 'sqsubseteq': u'\u2291', 'asymp': u'\u224d', 'smile': u'\u2323', 'supseteq': u'\u2287', 'sim': u'\u223c', 'neq': u'\u2260', + 'subset':u'\u2282', 'propto':u'\u221d', 'geq':u'\u2265', + 'ge':u'\u2265', 'sqsubset':u'\u228f', 'Join':u'\u2a1d', + 'frown':u'\u2322', 'models':u'\u22a7', 'supset':u'\u2283', + 'in':u'\u2208', 'doteq':u'\u2250', 'dashv':u'\u22a3', + 'gg':u'\u226b', 'leq':u'\u2264', 'succ':u'\u227b', + 'vdash':u'\u22a2', 'cong':u'\u2245', 'simeq':u'\u2243', + 'subseteq':u'\u2286', 'parallel':u'\u2225', 'equiv':u'\u2261', + 'ni':u'\u220b', 'le':u'\u2264', 'approx':u'\u2248', + 'precsim':u'\u227e', 'sqsupset':u'\u2290', 'll':u'\u226a', + 'sqsupseteq':u'\u2292', 'mid':u'\u2223', 'prec':u'\u227a', + 'succsim':u'\u227f', 'bowtie':u'\u22c8', 'perp':u'\u27c2', + 'sqsubseteq':u'\u2291', 'asymp':u'\u224d', 'smile':u'\u2323', + 'supseteq':u'\u2287', 'sim':u'\u223c', 'neq':u'\u2260', # Arrow symbols: - 'searrow': u'\u2198', 'updownarrow': u'\u2195', 'Uparrow': u'\u21d1', 'longleftrightarrow': u'\u27f7', 'Leftarrow': u'\u21d0', 'longmapsto': u'\u27fc', 'Longleftarrow': u'\u27f8', 'nearrow': u'\u2197', 'hookleftarrow': u'\u21a9', 'downarrow': u'\u2193', 'Leftrightarrow': u'\u21d4', 'longrightarrow': u'\u27f6', 'rightharpoondown': u'\u21c1', 'longleftarrow': u'\u27f5', 'rightarrow': u'\u2192', 'Updownarrow': u'\u21d5', 'rightharpoonup': u'\u21c0', 'Longleftrightarrow': u'\u27fa', 'leftarrow': u'\u2190', 'mapsto': u'\u21a6', 'nwarrow': u'\u2196', 'uparrow': u'\u2191', 'leftharpoonup': u'\u21bc', 'leftharpoondown': u'\u21bd', 'Downarrow': u'\u21d3', 'leftrightarrow': u'\u2194', 'Longrightarrow': u'\u27f9', 'swarrow': u'\u2199', 'hookrightarrow': u'\u21aa', 'Rightarrow': u'\u21d2', + 'searrow':u'\u2198', 'updownarrow':u'\u2195', 'Uparrow':u'\u21d1', + 'longleftrightarrow':u'\u27f7', 'Leftarrow':u'\u21d0', + 'longmapsto':u'\u27fc', 'Longleftarrow':u'\u27f8', + 'nearrow':u'\u2197', 'hookleftarrow':u'\u21a9', + 'downarrow':u'\u2193', 'Leftrightarrow':u'\u21d4', + 'longrightarrow':u'\u27f6', 'rightharpoondown':u'\u21c1', + 'longleftarrow':u'\u27f5', 'rightarrow':u'\u2192', + 'Updownarrow':u'\u21d5', 'rightharpoonup':u'\u21c0', + 'Longleftrightarrow':u'\u27fa', 'leftarrow':u'\u2190', + 'mapsto':u'\u21a6', 'nwarrow':u'\u2196', 'uparrow':u'\u2191', + 'leftharpoonup':u'\u21bc', 'leftharpoondown':u'\u21bd', + 'Downarrow':u'\u21d3', 'leftrightarrow':u'\u2194', + 'Longrightarrow':u'\u27f9', 'swarrow':u'\u2199', + 'hookrightarrow':u'\u21aa', 'Rightarrow':u'\u21d2', # Miscellaneous symbols: - 'infty': u'\u221e', 'surd': u'\u221a', 'partial': u'\u2202', 'ddots': u'\u22f1', 'exists': u'\u2203', 'flat': u'\u266d', 'diamondsuit': u'\u2662', 'wp': u'\u2118', 'spadesuit': u'\u2660', 'Re': u'\u211c', 'vdots': u'\u22ee', 'aleph': u'\u2135', 'clubsuit': u'\u2663', 'sharp': u'\u266f', 'angle': u'\u2220', 'prime': u'\u2032', 'natural': u'\u266e', 'ell': u'\u2113', 'neg': u'\xac', 'top': u'\u22a4', 'nabla': u'\u2207', 'bot': u'\u22a5', 'heartsuit': u'\u2661', 'cdots': u'\u22ef', 'Im': u'\u2111', 'forall': u'\u2200', 'imath': u'\u0131', 'hbar': u'\u210f', 'emptyset': u'\u2205', + 'infty':u'\u221e', 'surd':u'\u221a', + 'partial':u'\u2202', 'ddots':u'\u22f1', 'exists':u'\u2203', + 'flat':u'\u266d', 'diamondsuit':u'\u2662', 'wp':u'\u2118', + 'spadesuit':u'\u2660', 'Re':u'\u211c', 'vdots':u'\u22ee', + 'aleph':u'\u2135', 'clubsuit':u'\u2663', 'sharp':u'\u266f', + 'angle':u'\u2220', 'prime':u'\u2032', 'natural':u'\u266e', + 'ell':u'\u2113', 'neg':u'\xac', 'top':u'\u22a4', 'nabla':u'\u2207', + 'bot':u'\u22a5', 'heartsuit':u'\u2661', 'cdots':u'\u22ef', + 'Im':u'\u2111', 'forall':u'\u2200', + 'hbar':u'\u210f', 'emptyset':u'\u2205', # Variable-sized symbols: - 'bigotimes': u'\u2a02', 'coprod': u'\u2210', 'int': u'\u222b', 'sum': u'\u2211', 'bigodot': u'\u2a00', 'bigcup': u'\u22c3', 'biguplus': u'\u2a04', 'bigcap': u'\u22c2', 'bigoplus': u'\u2a01', 'oint': u'\u222e', 'bigvee': u'\u22c1', 'bigwedge': u'\u22c0', 'prod': u'\u220f', + 'bigotimes':u'\u2a02', 'coprod':u'\u2210', 'int':u'\u222b', + 'sum':u'\u2211', 'bigodot':u'\u2a00', 'bigcup':u'\u22c3', + 'biguplus':u'\u2a04', 'bigcap':u'\u22c2', 'bigoplus':u'\u2a01', + 'oint':u'\u222e', 'bigvee':u'\u22c1', 'bigwedge':u'\u22c0', + 'prod':u'\u220f', # Braces: - 'langle': u'\u2329', 'rangle': u'\u232A'} + 'langle':u'\u2329', 'rangle':u'\u232A'} sumintprod = ''.join([special[symbol] for symbol in ['sum', 'int', 'oint', 'prod']]) @@ -460,8 +523,8 @@ raise SyntaxError('Expected something like "\mathbb{A}"!') node = node.append(mi(mathbb[string[1]])) skip += 3 - elif name in greek: - node = node.append(mi(greek[name])) + elif name in letters: + node = node.append(mi(letters[name])) elif name in Greek: node = node.append(mo(Greek[name])) elif name in special: Modified: trunk/docutils/docutils/writers/html4css1/__init__.py =================================================================== --- trunk/docutils/docutils/writers/html4css1/__init__.py 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/docutils/writers/html4css1/__init__.py 2010-11-25 10:16:45 UTC (rev 6486) @@ -27,6 +27,7 @@ from docutils import frontend, nodes, utils, writers, languages, io from docutils.transforms import writer_aux from docutils.latex2mathml import parse_latex_math +# from docutils.math.math2html import math2html class Writer(writers.Writer): @@ -248,6 +249,8 @@ def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings + # TODO: make this a config value once the HTML math output is ready: + self.settings.math_output = "MathML" lcode = settings.language_code self.language = languages.get_language(lcode, document.reporter) self.meta = [self.content_type % settings.output_encoding, @@ -371,10 +374,10 @@ languages = [cls for cls in classes if cls.startswith('language-')] if languages: - # lang attribute name is 'lang' in XHTML 1.0 but 'xml:lang' in 1.1 + # attribute name is 'lang' in XHTML 1.0 but 'xml:lang' in 1.1 atts[self.lang_attribute] = languages[0][9:] classes.pop(classes.index(languages[0])) - classes = ' '.join(classes) + classes = ' '.join(classes).strip() if classes: atts['class'] = classes assert 'id' not in atts @@ -1101,24 +1104,33 @@ self.body.append('\n</pre>\n') def visit_math(self, node, inline=True): - # update the doctype: - if not self.has_mathml_dtd: - if self.settings.xml_declaration: - self.head_prefix[1] = self.doctype_mathml - else: - self.head_prefix[0] = self.doctype_mathml - self.html_head[0] = self.content_type_mathml - self.head[0] = self.content_type_mathml % self.settings.output_encoding - self.has_mathml_dtd = True - # Convert from LaTeX to MathML: - math_code = node.astext() - try: - mathml_tree = parse_latex_math(math_code, inline=inline) - mathml = ''.join(mathml_tree.xml()) - except SyntaxError, err: - self.document.reporter.error(err, base_node=node) - mathml = unicode(err) # TODO: generate system message and link. - self.body.append(mathml) + math_in = node.astext() + + if self.settings.math_output == 'HTML': + tag={True: 'span', False: 'div'} + self.body.append(self.starttag(node, tag[inline], CLASS='formula')) + self.body.append(math2html(math_in)) + self.body.append('</%s>\n' % tag[inline]) + + elif self.settings.math_output == 'MathML': + # MathML export: + # update the doctype: + if not self.has_mathml_dtd: + if self.settings.xml_declaration: + self.head_prefix[1] = self.doctype_mathml + else: + self.head_prefix[0] = self.doctype_mathml + self.html_head[0] = self.content_type_mathml + self.head[0] = self.content_type_mathml % self.settings.output_encoding + self.has_mathml_dtd = True + # Convert from LaTeX to MathML: + try: + mathml_tree = parse_latex_math(math_in, inline=inline) + math_out = ''.join(mathml_tree.xml()) + except SyntaxError, err: + self.document.reporter.error(err, base_node=node) + math_out = unicode(err) # TODO: generate system message and link. + self.body.append(math_out) # Content already processed: raise nodes.SkipNode Modified: trunk/docutils/test/functional/expected/math.xhtml =================================================================== --- trunk/docutils/test/functional/expected/math.xhtml 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/expected/math.xhtml 2010-11-25 10:16:45 UTC (rev 6486) @@ -29,13 +29,13 @@ <tbody valign="top"> <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>a</mi></mrow><mo>´</mo></mover></mrow></math> <tt class="docutils literal">\acute{a}</tt></td> <td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>a</mi></mrow><mo>`</mo></mover></mrow></math> <tt class="docutils literal">\grave{a}</tt></td> -<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>z</mi></mrow><mo>˜</mo></mover></mrow></math> <tt class="docutils literal">\tilde{z}</tt></td> -<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>x</mi></mrow><mo>¯</mo></mover></mrow></math> <tt class="docutils literal">\bar{x}</tt></td> +<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>α</mi></mrow><mo>˜</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\tilde{\alpha}</span></tt></td> +<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>a</mi></mrow><mo>¯</mo></mover></mrow></math> <tt class="docutils literal">\bar{a}</tt></td> </tr> <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>x</mi></mrow><mo>˘</mo></mover></mrow></math> <tt class="docutils literal">\breve{x}</tt></td> -<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>x</mi></mrow><mo>ˇ</mo></mover></mrow></math> <tt class="docutils literal">\check{x}</tt></td> -<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>x</mi></mrow><mo>^</mo></mover></mrow></math> <tt class="docutils literal">\hat{x}</tt></td> -<td> </td> +<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>a</mi></mrow><mo>ˇ</mo></mover></mrow></math> <tt class="docutils literal">\check{a}</tt></td> +<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>γ</mi></mrow><mo>^</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\hat{\gamma}</span></tt></td> +<td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>ı</mi></mrow><mo>⃗</mo></mover></mrow></math> <tt class="docutils literal"><span class="pre">\vec{\imath}</span></tt></td> </tr> <tr><td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>t</mi></mrow><mo>˙</mo></mover></mrow></math> <tt class="docutils literal">\dot{t}</tt></td> <td><math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mover><mrow><mi>t</mi></mrow><mo>¨</mo></mover></mrow></math> <tt class="docutils literal">\ddot{t}</tt></td> Modified: trunk/docutils/test/functional/expected/standalone_rst_html4css1.html =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/expected/standalone_rst_html4css1.html 2010-11-25 10:16:45 UTC (rev 6486) @@ -411,25 +411,20 @@ <div class="line">Singing...</div> </div> </blockquote> -<p>A poem by Christian Morgenstern:</p> +<p>A line block, like the following poem by Christian Morgenstern, can +also be centre-aligned:</p> <div class="align-center line-block" lang="de"> -<div class="line">Das æsthetische Wiesel</div> +<div class="line"><strong>Die Trichter</strong></div> <div class="line"><br /></div> -<div class="line">Ein Wiesel</div> -<div class="line">saß auf einem Kiesel</div> -<div class="line">inmitten Bachgeriesel.</div> +<div class="line">Zwei Trichter wandeln durch die Nacht.</div> +<div class="line">Durch ihres Rumpfs verengten Schacht</div> +<div class="line">fließt weißes Mondlicht</div> +<div class="line">still und heiter</div> +<div class="line">auf ihren</div> +<div class="line">Waldweg</div> +<div class="line">u. s.</div> +<div class="line">w.</div> <div class="line"><br /></div> -<div class="line">Wißt ihr</div> -<div class="line">weshalb?</div> -<div class="line"><br /></div> -<div class="line">Das Mondkalb</div> -<div class="line">verriet es mir</div> -<div class="line">im Stillen:</div> -<div class="line"><br /></div> -<div class="line">Das raffinier-</div> -<div class="line">te Tier</div> -<div class="line">tat's um des Reimes willen.</div> -<div class="line"><br /></div> </div> </div> <div class="section" id="block-quotes"> @@ -445,10 +440,10 @@ </blockquote> <p>The language of a quote (like any other object) can be specified by a class attribute:</p> -<blockquote> -<p lang="fr">ReStructuredText est un langage de balisage léger utilisé -notamment dans la documentation du langage Python.</p> -</blockquote> +<!-- --> +<blockquote lang="fr"> +ReStructuredText est un langage de balisage léger utilisé +notamment dans la documentation du langage Python.</blockquote> </div> <div class="section" id="doctest-blocks"> <h2><a class="toc-backref" href="#id47">2.10 Doctest Blocks</a></h2> @@ -1108,16 +1103,16 @@ <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 102); <em><a href="#id24">backlink</a></em></p> Undefined substitution referenced: "problematic".</div> <div class="system-message" id="id82"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 393); <em><a href="#id83">backlink</a></em></p> +<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 388); <em><a href="#id83">backlink</a></em></p> Unknown target name: "5".</div> <div class="system-message" id="id84"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 402); <em><a href="#id85">backlink</a></em></p> +<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 397); <em><a href="#id85">backlink</a></em></p> Unknown target name: "nonexistent".</div> <div class="system-message" id="id86"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 429); <em><a href="#id87">backlink</a></em></p> +<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 424); <em><a href="#id87">backlink</a></em></p> Unknown target name: "hyperlink reference without a target".</div> <div class="system-message" id="id88"> -<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 442); <em><a href="#id89">backlink</a></em></p> +<p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">functional/input/data/standard.txt</tt>, line 437); <em><a href="#id89">backlink</a></em></p> Duplicate target name, cannot be used as a unique reference: "duplicate target names".</div> </div> </div> Modified: trunk/docutils/test/functional/expected/standalone_rst_latex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/expected/standalone_rst_latex.tex 2010-11-25 10:16:45 UTC (rev 6486) @@ -745,27 +745,22 @@ \end{quote} -A poem by Christian Morgenstern: +A line block, like the following poem by Christian Morgenstern, can +also be centre-aligned: \begin{DUlineblock}{0em} \otherlanguage{ngerman}{\DUrole{align-center}{ -\item[] Das æsthetische Wiesel +\item[] \textbf{Die Trichter} \item[] -\item[] Ein Wiesel -\item[] saß auf einem Kiesel -\item[] inmitten Bachgeriesel. +\item[] Zwei Trichter wandeln durch die Nacht. +\item[] Durch ihres Rumpfs verengten Schacht +\item[] fließt weißes Mondlicht +\item[] still und heiter +\item[] auf ~ ihren +\item[] Waldweg +\item[] u. s. +\item[] w. \item[] -\item[] Wißt ihr -\item[] weshalb? -\item[] -\item[] Das Mondkalb -\item[] verriet es mir -\item[] im Stillen: -\item[] -\item[] Das raffinier- -\item[] te Tier -\item[] tat's um des Reimes willen. -\item[] }} \end{DUlineblock} @@ -795,12 +790,14 @@ The language of a quote (like any other object) can be specified by a class attribute: + +% % \begin{quote} - -\otherlanguage{french}{ReStructuredText est un langage de balisage léger utilisé -notamment dans la documentation du langage Python.} - +\otherlanguage{french}{ +ReStructuredText est un langage de balisage léger utilisé +notamment dans la documentation du langage Python. +} \end{quote} @@ -1676,17 +1673,19 @@ & $\grave{a}$ \texttt{\textbackslash{}grave\{a\}} & -$\tilde{z}$ \texttt{\textbackslash{}tilde\{z\}} +$\tilde{\alpha}$ \texttt{\textbackslash{}tilde\{\textbackslash{}alpha\}} & -$\bar{x}$ \texttt{\textbackslash{}bar\{x\}} +$\bar{a}$ \texttt{\textbackslash{}bar\{a\}} \\ $\breve{x}$ \texttt{\textbackslash{}breve\{x\}} & -$\check{x}$ \texttt{\textbackslash{}check\{x\}} +$\check{a}$ \texttt{\textbackslash{}check\{a\}} & -$\hat{x}$ \texttt{\textbackslash{}hat\{x\}} - & \\ +$\hat{\gamma}$ \texttt{\textbackslash{}hat\{\textbackslash{}gamma\}} + & +$\vec{\imath}$ \texttt{\textbackslash{}vec\{\textbackslash{}imath\}} + \\ $\dot{t}$ \texttt{\textbackslash{}dot\{t\}} & @@ -2520,7 +2519,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id40}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~393 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~388 \hyperlink{id41}{ Unknown target name: ``5''. @@ -2530,7 +2529,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id42}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~402 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~397 \hyperlink{id43}{ Unknown target name: ``nonexistent''. @@ -2540,7 +2539,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id44}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~429 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~424 \hyperlink{id45}{ Unknown target name: ``hyperlink reference without a target''. @@ -2550,7 +2549,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id46}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~442 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~437 \hyperlink{id47}{ Duplicate target name, cannot be used as a unique reference: ``duplicate target names''. Modified: trunk/docutils/test/functional/expected/standalone_rst_pseudoxml.txt =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_pseudoxml.txt 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/expected/standalone_rst_pseudoxml.txt 2010-11-25 10:16:45 UTC (rev 6486) @@ -890,37 +890,30 @@ <line> Singing... <paragraph> - A poem by Christian Morgenstern: + A line block, like the following poem by Christian Morgenstern, can + also be centre-aligned: <line_block classes="language-de align-center"> <line> - Das æsthetische Wiesel + <strong> + Die Trichter <line> <line> - Ein Wiesel + Zwei Trichter wandeln durch die Nacht. <line> - saß auf einem Kiesel + Durch ihres Rumpfs verengten Schacht <line> - inmitten Bachgeriesel. + fließt weißes Mondlicht <line> + still und heiter <line> - Wißt ihr + auf ihren <line> - weshalb? + Waldweg <line> + u. s. <line> - Das Mondkalb + w. <line> - verriet es mir - <line> - im Stillen: - <line> - <line> - Das raffinier- - <line> - te Tier - <line> - tat's um des Reimes willen. - <line> <section ids="block-quotes" names="block\ quotes"> <title auto="1" refid="id46"> <generated classes="sectnum"> @@ -940,8 +933,9 @@ <paragraph> The language of a quote (like any other object) can be specified by a class attribute: - <block_quote> - <paragraph classes="language-fr"> + <comment xml:space="preserve"> + <block_quote classes="language-fr"> + <paragraph> ReStructuredText est un langage de balisage léger utilisé notamment dans la documentation du langage Python. <section ids="doctest-blocks" names="doctest\ blocks"> @@ -1921,15 +1915,15 @@ <system_message backrefs="id24" ids="id23" level="3" line="102" source="functional/input/data/standard.txt" type="ERROR"> <paragraph> Undefined substitution referenced: "problematic". - <system_message backrefs="id80" ids="id79" level="3" line="393" source="functional/input/data/standard.txt" type="ERROR"> + <system_message backrefs="id80" ids="id79" level="3" line="388" source="functional/input/data/standard.txt" type="ERROR"> <paragraph> Unknown target name: "5". - <system_message backrefs="id82" ids="id81" level="3" line="402" source="functional/input/data/standard.txt" type="ERROR"> + <system_message backrefs="id82" ids="id81" level="3" line="397" source="functional/input/data/standard.txt" type="ERROR"> <paragraph> Unknown target name: "nonexistent". - <system_message backrefs="id84" ids="id83" level="3" line="429" source="functional/input/data/standard.txt" type="ERROR"> + <system_message backrefs="id84" ids="id83" level="3" line="424" 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="442" source="functional/input/data/standard.txt" type="ERROR"> + <system_message backrefs="id86" ids="id85" level="3" line="437" source="functional/input/data/standard.txt" type="ERROR"> <paragraph> Duplicate target name, cannot be used as a unique reference: "duplicate target names". Modified: trunk/docutils/test/functional/expected/standalone_rst_xetex.tex =================================================================== --- trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/expected/standalone_rst_xetex.tex 2010-11-25 10:16:45 UTC (rev 6486) @@ -743,27 +743,22 @@ \end{quote} -A poem by Christian Morgenstern: +A line block, like the following poem by Christian Morgenstern, can +also be centre-aligned: \begin{DUlineblock}{0em} \otherlanguage{german}{\DUrole{align-center}{ -\item[] Das æsthetische Wiesel +\item[] \textbf{Die Trichter} \item[] -\item[] Ein Wiesel -\item[] saß auf einem Kiesel -\item[] inmitten Bachgeriesel. +\item[] Zwei Trichter wandeln durch die Nacht. +\item[] Durch ihres Rumpfs verengten Schacht +\item[] fließt weißes Mondlicht +\item[] still und heiter +\item[] auf ihren +\item[] Waldweg +\item[] u. s. +\item[] w. \item[] -\item[] Wißt ihr -\item[] weshalb? -\item[] -\item[] Das Mondkalb -\item[] verriet es mir -\item[] im Stillen: -\item[] -\item[] Das raffinier- -\item[] te Tier -\item[] tat's um des Reimes willen. -\item[] }} \end{DUlineblock} @@ -793,12 +788,14 @@ The language of a quote (like any other object) can be specified by a class attribute: + +% % \begin{quote} - -\otherlanguage{french}{ReStructuredText est un langage de balisage léger utilisé -notamment dans la documentation du langage Python.} - +\otherlanguage{french}{ +ReStructuredText est un langage de balisage léger utilisé +notamment dans la documentation du langage Python. +} \end{quote} @@ -2446,7 +2443,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id42}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~393 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~388 \hyperlink{id43}{ Unknown target name: "5". @@ -2456,7 +2453,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id44}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~402 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~397 \hyperlink{id45}{ Unknown target name: "nonexistent". @@ -2466,7 +2463,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id46}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~429 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~424 \hyperlink{id47}{ Unknown target name: "hyperlink reference without a target". @@ -2476,7 +2473,7 @@ \DUtitle[system-message]{system-message} \raisebox{1em}{\hypertarget{id48}{}} -{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~442 +{\color{red}ERROR/3} in \texttt{functional/input/data/standard.txt}, line~437 \hyperlink{id49}{ Duplicate target name, cannot be used as a unique reference: "duplicate target names". Modified: trunk/docutils/test/functional/input/data/math.txt =================================================================== --- trunk/docutils/test/functional/input/data/math.txt 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/input/data/math.txt 2010-11-25 10:16:45 UTC (rev 6486) @@ -38,12 +38,12 @@ * - :math:`\acute{a}` ``\acute{a}`` - :math:`\grave{a}` ``\grave{a}`` - - :math:`\tilde{z}` ``\tilde{z}`` - - :math:`\bar{x}` ``\bar{x}`` + - :math:`\tilde{\alpha}` ``\tilde{\alpha}`` + - :math:`\bar{a}` ``\bar{a}`` * - :math:`\breve{x}` ``\breve{x}`` - - :math:`\check{x}` ``\check{x}`` - - :math:`\hat{x}` ``\hat{x}`` - - + - :math:`\check{a}` ``\check{a}`` + - :math:`\hat{\gamma}` ``\hat{\gamma}`` + - :math:`\vec{\imath}` ``\vec{\imath}`` * - :math:`\dot{t}` ``\dot{t}`` - :math:`\ddot{t}` ``\ddot{t}`` - :math:`\dddot{t}` ``\dddot{t}`` @@ -53,7 +53,6 @@ \widetilde{xxx} \widehat{xxx} - Quantum mechanics: .. math:: Modified: trunk/docutils/test/functional/input/data/standard.txt =================================================================== --- trunk/docutils/test/functional/input/data/standard.txt 2010-11-24 20:02:52 UTC (rev 6485) +++ trunk/docutils/test/functional/input/data/standard.txt 2010-11-25 10:16:45 UTC (rev 6486) @@ -310,30 +310,23 @@ | | Singing... -A poem by Christian Morgenstern: +A line block, like the following poem by Christian Morgenstern, can +also be centre-aligned: .. class:: language-de align-center - - -| Das æsthetische Wiesel + +| **Die Trichter** | -| Ein Wiesel -| saß auf einem Kiesel -| inmitten Bachgeriesel. +| Zwei Trichter wandeln durch die Nacht. +| Durch ihres Rumpfs verengten Schacht +| fließt weißes Mondlicht +| still und heiter +| auf ihren +| Waldweg +| u. s. +| w. | -| Wißt ihr -| weshalb? -| -| Das Mondkalb -| verriet es mir -| im Stillen: -| -| Das raffinier- -| te Tier -| tat's um des Reimes willen. -| - Block Quotes ------------ @@ -350,8 +343,10 @@ The language of a quote (like any other object) can be specified by a class attribute: - .. class:: language-fr +.. class:: language-fr +.. + ReStructuredText est un langage de balisage léger utilisé notamment dans la documentation du langage Python. |