~ubuntu-branches/ubuntu/trusty/python-docutils/trusty

« back to all changes in this revision

Viewing changes to debian/patches/math-output-html.diff

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2013-05-17 16:47:30 UTC
  • mfrom: (20.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130517164730-5ux7p59z0jdku6pf
Tags: 0.10-3ubuntu1
* Merge with Debian unstable, remaining changes:
  - Use dh_python2 instead of dh_pysupport.
  - Backport patch to support embedded aliases in references
    (support-aliases-in-references.diff).
* disable_py33_failing_tests.diff: dropped, the issue is now
  properly fixed in Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: change default math output format to HTML
 
2
Author: Jakub Wilk <jwilk@debian.org>
 
3
Forwarded: not-needed
 
4
Bug-Debian: http://bugs.debian.org/677929
 
5
Last-Update: 2013-05-16
 
6
 
 
7
--- a/docs/user/config.txt
 
8
+++ b/docs/user/config.txt
 
9
@@ -814,6 +814,14 @@
 
10
     The format of mathematical content (`math directive`_ and role) in
 
11
     the output document. Supported values are (case insensitive):
 
12
 
 
13
+    :HTML:
 
14
+      Format math in standard HTML enhanced by CSS rules
 
15
+
 
16
+      Requires the ``math.css`` stylesheet (stored in the same
 
17
+      installation-dependent directory as the `default stylesheet`__).
 
18
+
 
19
+      .. __: `stylesheet_path [html4css1 writer]`_
 
20
+
 
21
     :MathJax:
 
22
       Format math for display with MathJax_, a JavaScript-based math
 
23
       rendering engine that uses HTML/CSS, JavaScript, and unicode
 
24
@@ -840,14 +848,6 @@
 
25
 
 
26
         Downloads JavaScript code from a third-party site.
 
27
 
 
28
-    :HTML:
 
29
-      Format math in standard HTML enhanced by CSS rules
 
30
-
 
31
-      Requires the ``math.css`` stylesheet (stored in the same
 
32
-      installation-dependent directory as the `default stylesheet`__).
 
33
-
 
34
-      .. __: `stylesheet_path [html4css1 writer]`_
 
35
-
 
36
     :MathML:
 
37
       Embed math content as presentational MathML_.
 
38
 
 
39
@@ -870,7 +870,7 @@
 
40
 
 
41
       The failsave fallback.
 
42
 
 
43
-    Default: MathJax  Option: ``--math-output``.
 
44
+    Default: HTML  Option: ``--math-output``.
 
45
 
 
46
     New in Docutils 0.8.
 
47
 
 
48
--- a/docutils/writers/html4css1/__init__.py
 
49
+++ b/docutils/writers/html4css1/__init__.py
 
50
@@ -135,9 +135,9 @@
 
51
           ['--table-style'],
 
52
           {'default': ''}),
 
53
          ('Math output format, one of "MathML", "HTML", "MathJax" '
 
54
-          'or "LaTeX". Default: "MathJax"',
 
55
+          'or "LaTeX". Default: "HTML"',
 
56
           ['--math-output'],
 
57
-          {'default': 'MathJax'}),
 
58
+          {'default': 'HTML'}),
 
59
          ('Omit the XML declaration.  Use with caution.',
 
60
           ['--no-xml-declaration'],
 
61
           {'dest': 'xml_declaration', 'default': 1, 'action': 'store_false',
 
62
--- a/test/functional/expected/standalone_rst_html4css1.html
 
63
+++ b/test/functional/expected/standalone_rst_html4css1.html
 
64
@@ -12,7 +12,6 @@
 
65
 <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." />
 
66
 <meta content="reStructuredText, test, parser" name="keywords" />
 
67
 <meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
 
68
-<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
 
69
 <link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
 
70
 </head>
 
71
 <body>
 
72
@@ -862,7 +861,7 @@
 
73
 or as base for special code roles, e.g. the LaTeX code in the next
 
74
 paragraph.</p>
 
75
 <p>Docutils uses LaTeX syntax for math directives and roles:
 
76
-<code class="tex">\alpha = f(x)</code> prints <span class="math">\(\alpha = f(x)\)</span>
 
77
+<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>
 
78
 .</p>
 
79
 <p>The <tt class="docutils literal">:code:</tt> option of the <cite>include</cite> directive sets the included content
 
80
 as a code block, here the rst file <tt class="docutils literal">header_footer.txt</tt> with line numbers:</p>
 
81
--- a/test/test_writers/test_html4css1_misc.py
 
82
+++ b/test/test_writers/test_html4css1_misc.py
 
83
@@ -44,11 +44,11 @@
 
84
     data = ':math:`42`'
 
85
 
 
86
     def test_math_output_default(self):
 
87
-        # Currently MathJax with default URL. Likely to change to HTML!
 
88
+        # HTML
 
89
         mysettings = self.settings_overrides
 
90
         head = core.publish_parts(self.data, writer_name='html4css1',
 
91
-                                  settings_overrides=mysettings)['head']
 
92
-        self.assertIn(self.mathjax_script % self.default_mathjax_url, head)
 
93
+            settings_overrides=mysettings)['head']
 
94
+        self.assertNotIn('MathJax.js', head)
 
95
         
 
96
     def test_math_output_mathjax(self):
 
97
         # Explicitly specifying math_output=MathJax, case insensitively