summaryrefslogtreecommitdiff
path: root/docutils/test
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-04 21:17:09 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2013-03-04 21:17:09 +0000
commitfd0cdae9baf0d2b0e5a4fbfe7a63abcbcb27fb22 (patch)
tree957739f48836a59fd6b7df0c0332d282567630a8 /docutils/test
parent391c63c0ec883c0d40f25ed207fce1e74a31d597 (diff)
downloaddocutils-fd0cdae9baf0d2b0e5a4fbfe7a63abcbcb27fb22.tar.gz
New default for `math-output` setting: "HTML math.css".
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7623 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
-rw-r--r--docutils/test/functional/expected/standalone_rst_html4css1.html4
-rw-r--r--docutils/test/functional/tests/standalone_rst_html4css1.py5
-rwxr-xr-xdocutils/test/test_writers/test_html4css1_misc.py23
3 files changed, 22 insertions, 10 deletions
diff --git a/docutils/test/functional/expected/standalone_rst_html4css1.html b/docutils/test/functional/expected/standalone_rst_html4css1.html
index cd0f7c282..427f9a202 100644
--- a/docutils/test/functional/expected/standalone_rst_html4css1.html
+++ b/docutils/test/functional/expected/standalone_rst_html4css1.html
@@ -12,8 +12,8 @@
<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" />
-<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
+<link rel="stylesheet" href="../input/data/math.css" type="text/css" />
</head>
<body>
<div class="header">
@@ -862,7 +862,7 @@ directly (the code will not be parsed/tagged, as the language is not known)
or as base for special code roles, e.g. the LaTeX code in the next
paragraph.</p>
<p>Docutils uses LaTeX syntax for math directives and roles:
-<code class="tex">\alpha = f(x)</code> prints <span class="math">\(\alpha = f(x)\)</span>
+<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>
.</p>
<p>The <tt class="docutils literal">:code:</tt> option of the <cite>include</cite> directive sets the included content
as a code block, here the rst file <tt class="docutils literal">header_footer.txt</tt> with line numbers:</p>
diff --git a/docutils/test/functional/tests/standalone_rst_html4css1.py b/docutils/test/functional/tests/standalone_rst_html4css1.py
index a3ac8975f..4298736c5 100644
--- a/docutils/test/functional/tests/standalone_rst_html4css1.py
+++ b/docutils/test/functional/tests/standalone_rst_html4css1.py
@@ -8,7 +8,6 @@ test_destination = "standalone_rst_html4css1.html"
writer_name = "html4css1"
# Settings:
-# local copy of default stylesheet:
+# local copy of stylesheets:
# (Test runs in ``docutils/test/``, we need relative path from there.)
-settings_overrides['stylesheet_path'] = (
- 'functional/input/data/html4css1.css')
+settings_overrides['stylesheet_dirs'] = ('.', 'functional/input/data')
diff --git a/docutils/test/test_writers/test_html4css1_misc.py b/docutils/test/test_writers/test_html4css1_misc.py
index b011a1566..0741b9cee 100755
--- a/docutils/test/test_writers/test_html4css1_misc.py
+++ b/docutils/test/test_writers/test_html4css1_misc.py
@@ -94,11 +94,11 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase):
data = ':math:`42`'
def test_math_output_default(self):
- # Currently MathJax with default URL. Likely to change to HTML!
+ # HTML with math.css stylesheet (since 0.11)
mysettings = {'_disable_config': True,}
- head = core.publish_parts(self.data, writer_name='html4css1',
- settings_overrides=mysettings)['head']
- self.assertIn(self.mathjax_script % self.default_mathjax_url, head)
+ styles = core.publish_parts(self.data, writer_name='html4css1',
+ settings_overrides=mysettings)['stylesheet']
+ self.assertIn('convert LaTeX equations to HTML output.', styles)
def test_math_output_mathjax(self):
# Explicitly specifying math_output=MathJax, case insensitively
@@ -119,13 +119,26 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase):
self.assertIn(self.mathjax_script % self.custom_mathjax_url, head)
def test_math_output_html(self):
- # There should be no MathJax script when math_output is not MathJax
mysettings = {'_disable_config': True,
'math_output': 'HTML'}
head = core.publish_parts(self.data, writer_name='html4css1',
settings_overrides=mysettings)['head']
+ # There should be no MathJax script when math_output is not MathJax
self.assertNotIn('MathJax.js', head)
+ def test_math_output_html_stylesheet(self):
+ mysettings = {'_disable_config': True,
+ 'math_output': 'HTML math.css,custom/style.css',
+ 'stylesheet_dirs': ('.', 'functional/input/data'),
+ 'embed_stylesheet': False}
+ styles = core.publish_parts(self.data, writer_name='html4css1',
+ settings_overrides=mysettings)['stylesheet']
+ self.assertEqual(u"""\
+<link rel="stylesheet" href="functional/input/data/html4css1.css" type="text/css" />
+<link rel="stylesheet" href="functional/input/data/math.css" type="text/css" />
+<link rel="stylesheet" href="custom/style.css" type="text/css" />
+""", styles)
+
def test_math_output_mathjax_no_math(self):
mysettings = {'_disable_config': True,
'math_output': 'MathJax'}