Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
test_markup
|
|
|
|
~~~~~~~~~~~
|
|
|
|
|
|
|
|
Test various Sphinx-specific markup extensions.
|
|
|
|
|
2010-01-01 07:09:13 -06:00
|
|
|
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
|
2008-12-27 05:19:17 -06:00
|
|
|
:license: BSD, see LICENSE for details.
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
"""
|
|
|
|
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
import re
|
2010-05-24 12:41:02 -05:00
|
|
|
import sys
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
from util import *
|
|
|
|
|
|
|
|
from docutils import frontend, utils, nodes
|
|
|
|
from docutils.parsers import rst
|
|
|
|
|
2009-01-03 05:29:42 -06:00
|
|
|
from sphinx.util import texescape
|
2008-11-29 12:56:58 -06:00
|
|
|
from sphinx.writers.html import HTMLWriter, SmartyPantsHTMLTranslator
|
|
|
|
from sphinx.writers.latex import LaTeXWriter, LaTeXTranslator
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
2010-05-24 12:41:02 -05:00
|
|
|
if sys.version_info > (3, 0):
|
|
|
|
def b(s):
|
|
|
|
return s.encode('utf-8')
|
|
|
|
else:
|
|
|
|
b = str
|
|
|
|
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
def setup_module():
|
|
|
|
global app, settings, parser
|
2009-01-03 05:29:42 -06:00
|
|
|
texescape.init() # otherwise done by the latex builder
|
2008-08-04 17:20:44 -05:00
|
|
|
app = TestApp(cleanenv=True)
|
2009-01-10 15:18:18 -06:00
|
|
|
optparser = frontend.OptionParser(
|
|
|
|
components=(rst.Parser, HTMLWriter, LaTeXWriter))
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
settings = optparser.get_default_values()
|
|
|
|
settings.env = app.builder.env
|
2009-09-12 05:14:27 -05:00
|
|
|
settings.env.patch_lookup_functions()
|
2010-01-17 17:41:34 -06:00
|
|
|
settings.env.temp_data['docname'] = 'dummy'
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
parser = rst.Parser()
|
|
|
|
|
|
|
|
def teardown_module():
|
|
|
|
app.cleanup()
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
|
|
|
# since we're not resolving the markup afterwards, these nodes may remain
|
|
|
|
class ForgivingTranslator:
|
|
|
|
def visit_pending_xref(self, node):
|
|
|
|
pass
|
|
|
|
def depart_pending_xref(self, node):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class ForgivingHTMLTranslator(SmartyPantsHTMLTranslator, ForgivingTranslator):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class ForgivingLaTeXTranslator(LaTeXTranslator, ForgivingTranslator):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
def verify_re(rst, html_expected, latex_expected):
|
2010-05-24 12:41:02 -05:00
|
|
|
document = utils.new_document(b('test data'), settings)
|
2009-03-16 05:24:19 -05:00
|
|
|
document['file'] = 'dummy'
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
parser.parse(rst, document)
|
|
|
|
for msg in document.traverse(nodes.system_message):
|
|
|
|
if msg['level'] == 1:
|
|
|
|
msg.replace_self([])
|
|
|
|
|
|
|
|
if html_expected:
|
|
|
|
html_translator = ForgivingHTMLTranslator(app.builder, document)
|
|
|
|
document.walkabout(html_translator)
|
|
|
|
html_translated = ''.join(html_translator.fragment).strip()
|
2009-09-12 05:14:27 -05:00
|
|
|
assert re.match(html_expected, html_translated), 'from ' + rst
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
|
|
|
if latex_expected:
|
|
|
|
latex_translator = ForgivingLaTeXTranslator(document, app.builder)
|
|
|
|
latex_translator.first_document = -1 # don't write \begin{document}
|
|
|
|
document.walkabout(latex_translator)
|
|
|
|
latex_translated = ''.join(latex_translator.body).strip()
|
2008-08-10 11:59:27 -05:00
|
|
|
assert re.match(latex_expected, latex_translated), 'from ' + repr(rst)
|
Merged revisions 65283,65303,65316-65317,65372-65375,65377,65380,65483-65485,65494 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65283 | georg.brandl | 2008-07-29 10:07:26 +0000 (Tue, 29 Jul 2008) | 2 lines
Update ez_setup.py.
........
r65303 | benjamin.peterson | 2008-07-30 12:35:34 +0000 (Wed, 30 Jul 2008) | 1 line
add a with_testapp decorator for test functions that passes the TestApp instance in a cleans up after it
........
r65316 | benjamin.peterson | 2008-07-30 23:12:07 +0000 (Wed, 30 Jul 2008) | 1 line
make the app for test_markup global to the module
........
r65317 | benjamin.peterson | 2008-07-30 23:31:29 +0000 (Wed, 30 Jul 2008) | 1 line
make TestApp.cleanup more aggressive
........
r65372 | georg.brandl | 2008-08-01 19:11:22 +0000 (Fri, 01 Aug 2008) | 2 lines
Add more tests, fix a few bugs in image handling.
........
r65373 | georg.brandl | 2008-08-01 19:28:33 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix oversight.
........
r65374 | benjamin.peterson | 2008-08-01 19:36:32 +0000 (Fri, 01 Aug 2008) | 1 line
fix one broken test
........
r65375 | georg.brandl | 2008-08-01 19:41:11 +0000 (Fri, 01 Aug 2008) | 2 lines
Fix the handling of non-ASCII input in quickstart.
........
r65377 | georg.brandl | 2008-08-01 19:48:24 +0000 (Fri, 01 Aug 2008) | 2 lines
Allow REs in markup checks.
........
r65380 | georg.brandl | 2008-08-01 20:31:18 +0000 (Fri, 01 Aug 2008) | 2 lines
Don't rely on mtimes being different for changed files.
........
r65483 | georg.brandl | 2008-08-04 09:01:40 +0000 (Mon, 04 Aug 2008) | 4 lines
Add an "encoding" option to literalinclude.
Add tests for include directives.
........
r65484 | georg.brandl | 2008-08-04 09:11:17 +0000 (Mon, 04 Aug 2008) | 2 lines
Add changelog entry.
........
r65485 | georg.brandl | 2008-08-04 09:21:58 +0000 (Mon, 04 Aug 2008) | 2 lines
Fix markup.
........
r65494 | georg.brandl | 2008-08-04 16:34:59 +0000 (Mon, 04 Aug 2008) | 2 lines
Correctly use HTML file suffix in templates.
........
2008-08-04 12:01:15 -05:00
|
|
|
|
|
|
|
def verify(rst, html_expected, latex_expected):
|
2008-08-10 11:59:27 -05:00
|
|
|
if html_expected:
|
|
|
|
html_expected = re.escape(html_expected) + '$'
|
|
|
|
if latex_expected:
|
|
|
|
latex_expected = re.escape(latex_expected) + '$'
|
|
|
|
verify_re(rst, html_expected, latex_expected)
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
def test_inline():
|
|
|
|
# correct interpretation of code with whitespace
|
2010-02-28 03:17:59 -06:00
|
|
|
_html = ('<p><tt class="(samp )?docutils literal"><span class="pre">'
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
'code</span> <span class="pre">sample</span></tt></p>')
|
2010-02-28 03:17:59 -06:00
|
|
|
yield verify_re, '``code sample``', _html, r'\\code{code sample}'
|
|
|
|
yield verify_re, ':samp:`code sample`', _html, r'\\samp{code sample}'
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
|
|
|
# interpolation of braces in samp and file roles (HTML only)
|
2009-02-21 10:16:56 -06:00
|
|
|
yield (verify, ':samp:`a{b}c`',
|
2010-02-28 03:17:59 -06:00
|
|
|
'<p><tt class="samp docutils literal"><span class="pre">a</span>'
|
2009-01-10 15:18:18 -06:00
|
|
|
'<em><span class="pre">b</span></em>'
|
|
|
|
'<span class="pre">c</span></tt></p>',
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
'\\samp{abc}')
|
|
|
|
|
|
|
|
# interpolation of arrows in menuselection
|
2009-02-21 10:16:56 -06:00
|
|
|
yield (verify, ':menuselection:`a --> b`',
|
2010-02-28 03:17:59 -06:00
|
|
|
u'<p><em class="menuselection">a \N{TRIANGULAR BULLET} b</em></p>',
|
2008-08-10 11:59:27 -05:00
|
|
|
'\\emph{a \\(\\rightarrow\\) b}')
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
2010-05-24 05:57:07 -05:00
|
|
|
# interpolation of ampersands in guilabel/menuselection
|
|
|
|
yield (verify, ':guilabel:`&Foo -&&- &Bar`',
|
|
|
|
u'<p><em class="guilabel"><span class="accelerator">F</span>oo '
|
|
|
|
'-&- <span class="accelerator">B</span>ar</em></p>',
|
2010-05-24 17:50:15 -05:00
|
|
|
r'\emph{\DUspan{accelerator}{F}oo -\&- \DUspan{accelerator}{B}ar}')
|
2010-05-24 05:57:07 -05:00
|
|
|
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
# non-interpolation of dashes in option role
|
2009-02-21 10:16:56 -06:00
|
|
|
yield (verify_re, ':option:`--with-option`',
|
2010-02-28 05:08:06 -06:00
|
|
|
'<p><em( class="xref std std-option")?>--with-option</em></p>$',
|
2009-02-21 10:16:56 -06:00
|
|
|
r'\\emph{\\texttt{-{-}with-option}}$')
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
|
|
|
|
# verify smarty-pants quotes
|
2009-02-21 10:16:56 -06:00
|
|
|
yield verify, '"John"', '<p>“John”</p>', "``John''"
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
# ... but not in literal text
|
2009-02-21 10:16:56 -06:00
|
|
|
yield (verify, '``"John"``',
|
Merged revisions 65138,65145-65146,65268-65273 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65138 | georg.brandl | 2008-07-19 15:42:35 +0200 (Sat, 19 Jul 2008) | 2 lines
#3416: fix missing parameter.
........
r65145 | georg.brandl | 2008-07-19 20:01:25 +0200 (Sat, 19 Jul 2008) | 2 lines
Now that we don't ship Jinja anymore by default the comment can go.
........
r65146 | georg.brandl | 2008-07-19 20:01:51 +0200 (Sat, 19 Jul 2008) | 2 lines
Reread documents with globbed toctrees when files are removed/added.
........
r65268 | georg.brandl | 2008-07-29 10:21:33 +0200 (Tue, 29 Jul 2008) | 2 lines
Fix by Markus Gritsch to place correct links to headings.
........
r65269 | georg.brandl | 2008-07-29 10:21:59 +0200 (Tue, 29 Jul 2008) | 2 lines
Make the writer's settings public.
........
r65270 | georg.brandl | 2008-07-29 10:22:28 +0200 (Tue, 29 Jul 2008) | 2 lines
Export test_root.
........
r65271 | georg.brandl | 2008-07-29 10:22:47 +0200 (Tue, 29 Jul 2008) | 2 lines
Add a markup test.
........
r65272 | georg.brandl | 2008-07-29 10:27:19 +0200 (Tue, 29 Jul 2008) | 2 lines
Bump version number.
........
r65273 | georg.brandl | 2008-07-29 11:05:37 +0200 (Tue, 29 Jul 2008) | 2 lines
Correct rendering of ``samp``.
........
2008-07-29 04:07:37 -05:00
|
|
|
'<p><tt class="docutils literal"><span class="pre">'
|
|
|
|
'"John"</span></tt></p>',
|
|
|
|
'\\code{"John"}')
|
2008-08-10 11:59:27 -05:00
|
|
|
|
2010-02-28 03:17:59 -06:00
|
|
|
# verify classes for inline roles
|
|
|
|
yield (verify, ':manpage:`mp(1)`',
|
|
|
|
'<p><em class="manpage">mp(1)</em></p>',
|
|
|
|
'\\emph{\\texttt{mp(1)}}')
|
|
|
|
|
2008-08-10 11:59:27 -05:00
|
|
|
def test_latex_escaping():
|
|
|
|
# correct escaping in normal mode
|
2009-05-10 13:59:08 -05:00
|
|
|
yield (verify, u'Γ\\\\∞$', None,
|
2009-05-10 13:59:55 -05:00
|
|
|
ur'\(\Gamma\)\textbackslash{}\(\infty\)\$')
|
2008-08-10 11:59:27 -05:00
|
|
|
# in verbatim code fragments
|
2009-02-21 10:16:56 -06:00
|
|
|
yield (verify, u'::\n\n @Γ\\∞$[]', None,
|
2008-08-10 11:59:27 -05:00
|
|
|
u'\\begin{Verbatim}[commandchars=@\\[\\]]\n'
|
2008-09-16 02:52:19 -05:00
|
|
|
u'@PYGZat[]@(@Gamma@)\\@(@infty@)@$@PYGZlb[]@PYGZrb[]\n'
|
2008-08-10 11:59:27 -05:00
|
|
|
u'\\end{Verbatim}')
|
2009-06-04 11:11:17 -05:00
|
|
|
# in URIs
|
2010-02-20 12:51:37 -06:00
|
|
|
yield (verify_re, u'`test <http://example.com/~me/>`_', None,
|
2010-02-20 12:53:44 -06:00
|
|
|
ur'\\href{http://example.com/~me/}{test}.*')
|