SF.net SVN: docutils:[9771 ] trunk/docutils
milde--- via Docutils-checkins <[email protected]>
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 9771
http://sourceforge.net/p/docutils/code/9771
Author: milde
Date: 2024-06-18 08:00:10 +0000 (Tue, 18 Jun 2024)
Log Message:
-----------
Update calls to the `core.publish_*()` convenience functions.
Don't call the internal auxilliary function `publish_programmatically()`
from the "example.py" usage example.
Use "reader", "parser", "writer" instad of
"reader_name", "parser_name", "writer_name".
Simplifies code and avoids `PendingDeprecationsWarning`s.
Modified Paths:
--------------
trunk/docutils/docutils/__main__.py
trunk/docutils/docutils/examples.py
trunk/docutils/test/functional/tests/compact_lists.py
trunk/docutils/test/functional/tests/dangerous.py
trunk/docutils/test/functional/tests/field_name_limit.py
trunk/docutils/test/functional/tests/footnotes_html5.py
trunk/docutils/test/functional/tests/latex_babel.py
trunk/docutils/test/functional/tests/latex_cornercases.py
trunk/docutils/test/functional/tests/latex_cyrillic.py
trunk/docutils/test/functional/tests/latex_docinfo.py
trunk/docutils/test/functional/tests/latex_leavevmode.py
trunk/docutils/test/functional/tests/latex_literal_block.py
trunk/docutils/test/functional/tests/latex_literal_block_fancyvrb.py
trunk/docutils/test/functional/tests/latex_literal_block_listings.py
trunk/docutils/test/functional/tests/latex_literal_block_verbatim.py
trunk/docutils/test/functional/tests/latex_literal_block_verbatimtab.py
trunk/docutils/test/functional/tests/latex_memoir.py
trunk/docutils/test/functional/tests/math_output_html.py
trunk/docutils/test/functional/tests/math_output_latex.py
trunk/docutils/test/functional/tests/math_output_mathjax.py
trunk/docutils/test/functional/tests/math_output_mathml.py
trunk/docutils/test/functional/tests/misc_rst_html4css1.py
trunk/docutils/test/functional/tests/misc_rst_html5.py
trunk/docutils/test/functional/tests/pep_html.py
trunk/docutils/test/functional/tests/standalone_rst_docutils_xml.py
trunk/docutils/test/functional/tests/standalone_rst_html4css1.py
trunk/docutils/test/functional/tests/standalone_rst_html5.py
trunk/docutils/test/functional/tests/standalone_rst_html5_tuftig.py
trunk/docutils/test/functional/tests/standalone_rst_latex.py
trunk/docutils/test/functional/tests/standalone_rst_manpage.py
trunk/docutils/test/functional/tests/standalone_rst_pseudoxml.py
trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
trunk/docutils/test/functional/tests/standalone_rst_s5_html_2.py
trunk/docutils/test/functional/tests/standalone_rst_xetex.py
trunk/docutils/test/functional/tests/standalone_xml_xml.py
trunk/docutils/test/functional/tests/xetex_cyrillic.py
trunk/docutils/test/test_dependencies.py
trunk/docutils/test/test_parsers/test_get_parser_class.py
trunk/docutils/test/test_traversals.py
trunk/docutils/test/test_utils/test_math/test_tex2mathml_extern.py
trunk/docutils/test/test_writers/test_docutils_xml.py
trunk/docutils/test/test_writers/test_html4css1_misc.py
trunk/docutils/test/test_writers/test_html4css1_parts.py
trunk/docutils/test/test_writers/test_html4css1_template.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
trunk/docutils/test/test_writers/test_html5_template.py
trunk/docutils/test/test_writers/test_latex2e.py
trunk/docutils/test/test_writers/test_latex2e_misc.py
trunk/docutils/test/test_writers/test_manpage.py
trunk/docutils/test/test_writers/test_null.py
trunk/docutils/test/test_writers/test_odt.py
trunk/docutils/test/test_writers/test_pseudoxml.py
trunk/docutils/test/test_writers/test_s5.py
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/dev/profile_docutils.py
trunk/docutils/tools/rst2html.py
trunk/docutils/tools/rst2html4.py
trunk/docutils/tools/rst2html5.py
trunk/docutils/tools/rst2latex.py
trunk/docutils/tools/rst2s5.py
trunk/docutils/tools/rst2xetex.py
trunk/docutils/tools/rst2xml.py
trunk/docutils/tools/rstpep2html.py
Modified: trunk/docutils/docutils/__main__.py
===================================================================
--- trunk/docutils/docutils/__main__.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/docutils/__main__.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -75,9 +75,9 @@
CliSettingsSpec.settings_default_overrides = args.__dict__
try:
- publish_cmdline(reader_name=args.reader,
- parser_name=args.parser,
- writer_name=args.writer,
+ publish_cmdline(reader=args.reader,
+ parser=args.parser,
+ writer=args.writer,
settings_spec=CliSettingsSpec,
description=description,
argv=remainder)
Modified: trunk/docutils/docutils/examples.py
===================================================================
--- trunk/docutils/docutils/examples.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/docutils/examples.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -46,7 +46,7 @@
parts = core.publish_parts(
source=input_string, source_path=source_path,
destination_path=destination_path,
- writer_name='html', settings_overrides=overrides)
+ writer='html', settings_overrides=overrides)
return parts
@@ -74,7 +74,7 @@
return fragment
-def internals(input_string, source_path=None, destination_path=None,
+def internals(source, source_path=None, destination_path=None,
input_encoding='unicode', settings_overrides=None):
"""
Return the document tree and publisher, for exploring Docutils internals.
@@ -81,19 +81,20 @@
Parameters: see `html_parts()`.
"""
- if settings_overrides:
- overrides = settings_overrides.copy()
- else:
- overrides = {}
- overrides['input_encoding'] = input_encoding
- output, pub = core.publish_programmatically(
- source_class=io.StringInput, source=input_string,
- source_path=source_path,
- destination_class=io.NullOutput, destination=None,
- destination_path=destination_path,
- reader=None, reader_name='standalone',
- parser=None, parser_name='restructuredtext',
- writer=None, writer_name='null',
- settings=None, settings_spec=None, settings_overrides=overrides,
- config_section=None, enable_exit_status=None)
- return pub.writer.document, pub
+ if settings_overrides is None:
+ settings_overrides = {}
+ overrides = settings_overrides | {'input_encoding': input_encoding}
+
+ publisher = core.Publisher('standalone', 'rst', 'null',
+ source_class=io.StringInput,
+ destination_class=io.NullOutput)
+ publisher.process_programmatic_settings(settings_spec=None,
+ settings_overrides=overrides,
+ config_section=None)
+ publisher.set_source(source, source_path)
+ publisher.publish()
+ return publisher.document, publisher
+
+
+if __name__ == '__main__':
+ print(internals('test')[0])
Modified: trunk/docutils/test/functional/tests/compact_lists.py
===================================================================
--- trunk/docutils/test/functional/tests/compact_lists.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/compact_lists.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "compact_lists.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
# location of stylesheets (relative to ``docutils/test/``)
'stylesheet_dirs': ('functional/input/data', ),
Modified: trunk/docutils/test/functional/tests/dangerous.py
===================================================================
--- trunk/docutils/test/functional/tests/dangerous.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/dangerous.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "dangerous.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
'file_insertion_enabled': False,
'raw_enabled': False,
Modified: trunk/docutils/test/functional/tests/field_name_limit.py
===================================================================
--- trunk/docutils/test/functional/tests/field_name_limit.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/field_name_limit.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "field_name_limit.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
'field_name_limit': 0, # no limit
'docinfo_xform': False,
Modified: trunk/docutils/test/functional/tests/footnotes_html5.py
===================================================================
--- trunk/docutils/test/functional/tests/footnotes_html5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/footnotes_html5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "footnotes_html5.html"
# Keyword parameters passed to publish_file()
-writer_name = "html5"
+writer = "html5"
settings_overrides = {
'sectsubtitle_xform': True,
'footnote_references': 'superscript',
Modified: trunk/docutils/test/functional/tests/latex_babel.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_babel.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_babel.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_babel.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'legacy_column_widths': False,
'use_latex_citations': True,
Modified: trunk/docutils/test/functional/tests/latex_cornercases.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_cornercases.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_cornercases.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_cornercases.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'legacy_column_widths': False,
'use_latex_citations': True,
Modified: trunk/docutils/test/functional/tests/latex_cyrillic.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_cyrillic.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_cyrillic.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "cyrillic.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'font_encoding': 'T1,T2A',
'stylesheet': 'cmlgc',
Modified: trunk/docutils/test/functional/tests/latex_docinfo.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_docinfo.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_docinfo.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_docinfo.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'use_latex_docinfo': 1,
'legacy_column_widths': False,
Modified: trunk/docutils/test/functional/tests/latex_leavevmode.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_leavevmode.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_leavevmode.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_leavevmode.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'smart_quotes': True,
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_literal_block.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_literal_block.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_literal_block.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_literal_block.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'stylesheet': 'docutils',
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_literal_block_fancyvrb.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_literal_block_fancyvrb.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_literal_block_fancyvrb.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_literal_block_fancyvrb.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'stylesheet': 'docutils',
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_literal_block_listings.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_literal_block_listings.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_literal_block_listings.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_literal_block_listings.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'stylesheet': 'docutils',
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_literal_block_verbatim.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_literal_block_verbatim.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_literal_block_verbatim.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_literal_block_verbatim.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'stylesheet': 'docutils',
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_literal_block_verbatimtab.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_literal_block_verbatimtab.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_literal_block_verbatimtab.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_literal_block_verbatimtab.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'stylesheet': 'docutils',
'legacy_column_widths': True,
Modified: trunk/docutils/test/functional/tests/latex_memoir.py
===================================================================
--- trunk/docutils/test/functional/tests/latex_memoir.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/latex_memoir.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "latex_memoir.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'use_latex_docinfo': 1,
'documentclass': "memoir",
Modified: trunk/docutils/test/functional/tests/math_output_html.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_html.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/math_output_html.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "math_output_html.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
'math_output': 'HTML math.css',
# location of stylesheets (relative to ``docutils/test/``)
Modified: trunk/docutils/test/functional/tests/math_output_latex.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_latex.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/math_output_latex.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "math_output_latex.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
'math_output': 'latex',
# location of stylesheets (relative to ``docutils/test/``)
Modified: trunk/docutils/test/functional/tests/math_output_mathjax.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_mathjax.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/math_output_mathjax.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "math_output_mathjax.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4"
+writer = "html4"
settings_overrides = {
'math_output': 'MathJax /usr/share/javascript/mathjax/MathJax.js',
# location of stylesheets (relative to ``docutils/test/``)
Modified: trunk/docutils/test/functional/tests/math_output_mathml.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_mathml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/math_output_mathml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "math_output_mathml.html"
# Keyword parameters passed to publish_file()
-writer_name = "html5"
+writer = "html5"
settings_overrides = {
'math_output': 'MathML',
# location of stylesheets (relative to ``docutils/test/``)
Modified: trunk/docutils/test/functional/tests/misc_rst_html4css1.py
===================================================================
--- trunk/docutils/test/functional/tests/misc_rst_html4css1.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/misc_rst_html4css1.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "misc_rst_html4css1.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4css1"
+writer = "html4css1"
settings_overrides = {
# test for encoded attribute value in optional stylesheet name,
# 'stylesheet' setting, values are used verbatim
Modified: trunk/docutils/test/functional/tests/misc_rst_html5.py
===================================================================
--- trunk/docutils/test/functional/tests/misc_rst_html5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/misc_rst_html5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "misc_rst_html5.html"
# Keyword parameters passed to publish_file()
-writer_name = "html5"
+writer = "html5"
settings_overrides = {
# location of stylesheets (relative to ``docutils/test/``)
'stylesheet_dirs': ('functional/input/data', ),
Modified: trunk/docutils/test/functional/tests/pep_html.py
===================================================================
--- trunk/docutils/test/functional/tests/pep_html.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/pep_html.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,8 +3,8 @@
test_destination = "pep_html.html"
# Keyword parameters passed to publish_file()
-reader_name = "pep"
-writer_name = "pep_html"
+reader = "pep"
+writer = "pep_html"
settings_overrides = {
'python_home': "http://www.python.org",
'pep_home': "http://www.python.org/peps",
Modified: trunk/docutils/test/functional/tests/standalone_rst_docutils_xml.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_docutils_xml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_docutils_xml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_docutils_xml.xml"
# Keyword parameters passed to publish_file()
-writer_name = "docutils_xml"
+writer = "docutils_xml"
settings_overrides = {
'sectsubtitle_xform': True,
# format output with indents and newlines
Modified: trunk/docutils/test/functional/tests/standalone_rst_html4css1.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_html4css1.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_html4css1.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_html4css1.html"
# Keyword parameters passed to publish_file()
-writer_name = "html4css1"
+writer = "html4css1"
settings_overrides = {
'sectsubtitle_xform': True,
# location of stylesheets (relative to ``docutils/test/``)
Modified: trunk/docutils/test/functional/tests/standalone_rst_html5.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_html5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_html5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_html5.html"
# Keyword parameters passed to publish_file()
-writer_name = "html5"
+writer = "html5"
settings_overrides = {
'sectsubtitle_xform': True,
# "smart" quotes:
Modified: trunk/docutils/test/functional/tests/standalone_rst_html5_tuftig.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_html5_tuftig.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_html5_tuftig.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "rst_html5_tuftig.html"
# Keyword parameters passed to publish_file()
-writer_name = "html5"
+writer = "html5"
settings_overrides = {
'sectsubtitle_xform': True,
'smart_quotes': 'yes',
Modified: trunk/docutils/test/functional/tests/standalone_rst_latex.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_latex.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_latex.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_latex.tex"
# Keyword parameters passed to publish_file()
-writer_name = "latex"
+writer = "latex"
settings_overrides = {
'sectsubtitle_xform': True,
# use "smartquotes" transition:
Modified: trunk/docutils/test/functional/tests/standalone_rst_manpage.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_manpage.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_manpage.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_manpage.man"
# Keyword parameters passed to publish_file()
-writer_name = "manpage"
+writer = "manpage"
settings_overrides = {
'sectsubtitle_xform': True,
}
Modified: trunk/docutils/test/functional/tests/standalone_rst_pseudoxml.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_pseudoxml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_pseudoxml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_pseudoxml.txt"
# Keyword parameters passed to publish_file()
-writer_name = "pseudoxml"
+writer = "pseudoxml"
settings_overrides = {
'sectsubtitle_xform': True,
# enable INFO-level system messages in this test:
Modified: trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = 'standalone_rst_s5_html_1.html'
# Keyword parameters passed to publish_file:
-writer_name = 's5_html'
+writer = 's5_html'
settings_overrides = {
'sectsubtitle_xform': True,
'theme_url': 'ui/small-black', # don't attempt to copy theme files
Modified: trunk/docutils/test/functional/tests/standalone_rst_s5_html_2.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_s5_html_2.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_s5_html_2.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = 'standalone_rst_s5_html_2.html'
# Keyword parameters passed to publish_file:
-writer_name = 's5_html'
+writer = 's5_html'
settings_overrides = {
'sectsubtitle_xform': True,
# local copy of default stylesheet:
Modified: trunk/docutils/test/functional/tests/standalone_rst_xetex.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_xetex.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_rst_xetex.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "standalone_rst_xetex.tex"
# Keyword parameters passed to publish_file()
-writer_name = "xetex"
+writer = "xetex"
settings_overrides = {
'sectsubtitle_xform': True,
# use "smartquotes" transition:
Modified: trunk/docutils/test/functional/tests/standalone_xml_xml.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_xml_xml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/standalone_xml_xml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -8,6 +8,6 @@
test_destination = 'standalone_rst_docutils_xml.xml'
# Keyword parameters passed to publish_file()
-parser_name = 'xml'
-writer_name = 'xml'
+parser = 'xml'
+writer = 'xml'
settings_overrides = {'indents': True}
Modified: trunk/docutils/test/functional/tests/xetex_cyrillic.py
===================================================================
--- trunk/docutils/test/functional/tests/xetex_cyrillic.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/functional/tests/xetex_cyrillic.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -3,7 +3,7 @@
test_destination = "xetex-cyrillic.tex"
# Keyword parameters passed to publish_file()
-writer_name = "xetex"
+writer = "xetex"
settings_overrides = {
'language_code': 'ru',
# use "smartquotes" transition:
Modified: trunk/docutils/test/test_dependencies.py
===================================================================
--- trunk/docutils/test/test_dependencies.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_dependencies.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -76,7 +76,7 @@
if PIL and os.path.exists('../docs/user/rst/images/'):
keys += ['figure-image']
expected = [paths[key] for key in keys]
- record, output = self.get_record(writer_name='xml')
+ record, output = self.get_record(writer='xml')
# the order of the files is arbitrary
self.assertEqual(sorted(expected), sorted(record))
@@ -89,7 +89,7 @@
settings = {'stylesheet_path': None,
'stylesheet': None,
'report_level': 4} # drop warning if PIL is missing
- record, output = self.get_record(writer_name='html5',
+ record, output = self.get_record(writer='html5',
settings_overrides=settings)
# the order of the files is arbitrary
self.assertEqual(sorted(expected), sorted(record),
@@ -105,7 +105,7 @@
keys += ['figure-image']
expected = [paths[key] for key in keys]
record, output = self.get_record(
- writer_name='latex',
+ writer='latex',
settings_overrides=latex_settings_overwrites)
# the order of the files is arbitrary
self.assertEqual(sorted(expected), sorted(record),
@@ -123,22 +123,22 @@
'stylesheet': None}
settings.update(latex_settings_overwrites)
settings['embed_stylesheet'] = False
- record, output = self.get_record(writer_name='html',
+ record, output = self.get_record(writer='html',
settings_overrides=settings)
self.assertTrue(stylesheet not in record,
f'{stylesheet!r} should not be in {record!r}')
- record, output = self.get_record(writer_name='latex',
+ record, output = self.get_record(writer='latex',
settings_overrides=settings)
self.assertTrue(stylesheet not in record,
f'{stylesheet!r} should not be in {record!r}')
settings['embed_stylesheet'] = True
- record, output = self.get_record(writer_name='html',
+ record, output = self.get_record(writer='html',
settings_overrides=settings)
self.assertTrue(stylesheet in record,
f'{stylesheet!r} should be in {record!r}')
settings['embed_stylesheet'] = True
- record, output = self.get_record(writer_name='latex',
+ record, output = self.get_record(writer='latex',
settings_overrides=settings)
self.assertTrue(stylesheet in record,
f'{stylesheet!r} should be in {record!r}')
Modified: trunk/docutils/test/test_parsers/test_get_parser_class.py
===================================================================
--- trunk/docutils/test/test_parsers/test_get_parser_class.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_parsers/test_get_parser_class.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -58,7 +58,7 @@
# match multiline message (?s) = re.DOTALL "." also matches newline
with self.assertRaisesRegex(ImportError,
'(?s)requires the.*package .*recommonmark'):
- publish_string('test data', parser_name='recommonmark')
+ publish_string('test data', parser='recommonmark')
if __name__ == '__main__':
Modified: trunk/docutils/test/test_traversals.py
===================================================================
--- trunk/docutils/test/test_traversals.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_traversals.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -68,13 +68,13 @@
# Load some document tree in memory.
doctree = core.publish_doctree(
source=stop_traversal_input,
- reader_name='standalone',
- parser_name='restructuredtext',
+ reader='standalone',
+ parser='restructuredtext',
settings_spec=self)
self.assertTrue(isinstance(doctree, nodes.document))
core.publish_parts(
- reader_name='doctree', source_class=docutils.io.DocTreeInput,
+ reader='doctree', source_class=docutils.io.DocTreeInput,
source=doctree, source_path='test',
writer=AttentiveWriter())
Modified: trunk/docutils/test/test_utils/test_math/test_tex2mathml_extern.py
===================================================================
--- trunk/docutils/test/test_utils/test_math/test_tex2mathml_extern.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_utils/test_math/test_tex2mathml_extern.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -111,7 +111,7 @@
expected_path = EXPECTED / out_file
output = publish_file(source_path=str(source_path),
destination_path=out_path.as_posix(),
- writer_name='html5',
+ writer='html5',
settings_overrides=settings)
with self.subTest(converter=math_output[1] or 'latex2mathml()'):
compare_output(output, out_path, expected_path)
@@ -128,7 +128,7 @@
expected_path = EXPECTED / out_file
output = publish_file(source_path=str(source_path),
destination_path=out_path.as_posix(),
- writer_name='html5',
+ writer='html5',
settings_overrides=settings)
with self.subTest(converter=math_output[1] or 'latex2mathml()'):
compare_output(output, out_path, expected_path)
@@ -144,7 +144,7 @@
preface = f'Test "math-output: {" ".join(math_output)}".\n\n'
parts = publish_parts(preface + buggy_sample,
'buggy-maths',
- writer_name='html5',
+ writer='html5',
settings_overrides=settings)
with open(out_path, "w") as fd:
fd.write(parts['whole'])
Modified: trunk/docutils/test/test_writers/test_docutils_xml.py
===================================================================
--- trunk/docutils/test/test_writers/test_docutils_xml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_docutils_xml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -122,8 +122,8 @@
def publish_xml(settings, source):
return docutils.core.publish_string(source=source,
- reader_name='standalone',
- writer_name='docutils_xml',
+ reader='standalone',
+ writer='docutils_xml',
settings_overrides=settings)
Modified: trunk/docutils/test/test_writers/test_html4css1_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_misc.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html4css1_misc.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -40,7 +40,7 @@
'_disable_config': True,
}
result = bytes(core.publish_string(
- 'EUR = \u20ac', writer_name='html4css1',
+ 'EUR = \u20ac', writer='html4css1',
settings_overrides=settings_overrides))
# Encoding a euro sign with latin1 doesn't work, so the
# xmlcharrefreplace handler is used.
@@ -66,7 +66,7 @@
second term:
second def
"""
- result = core.publish_string(data, writer_name='html4css1',
+ result = core.publish_string(data, writer='html4css1',
settings_overrides=self.mys)
self.assertIn(b'<dt class="for the second item">second term:</dt>',
result)
@@ -83,7 +83,7 @@
second term:
second def
"""
- result = core.publish_string(data, writer_name='html4css1',
+ result = core.publish_string(data, writer='html4css1',
settings_overrides=self.mys)
self.assertIn(b'<dt id="second-item">second term:</dt>',
result)
@@ -98,7 +98,7 @@
def test_default_stylesheet(self):
# default style sheet, embedded
mys = {'_disable_config': True}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('Default cascading style sheet '
'for the HTML output of Docutils.', styles)
@@ -107,7 +107,7 @@
# default style sheet, linked
mys = {'_disable_config': True,
'embed_stylesheet': False}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html4css1/html4css1.css', styles)
@@ -116,7 +116,7 @@
mys = {'_disable_config': True,
'embed_stylesheet': False,
'stylesheet_path': 'html4css1.css, math.css'}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html4css1/html4css1.css', styles)
self.assertIn('docutils/writers/html5_polyglot/math.css', styles)
@@ -127,7 +127,7 @@
'embed_stylesheet': False,
'stylesheet_path': 'html4css1.css, '
'data/ham.css'}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html4css1/html4css1.css', styles)
self.assertIn('href="data/ham.css"', styles)
@@ -139,7 +139,7 @@
TEST_ROOT / '../docutils/writers/html4css1/',
DATA_ROOT),
'stylesheet_path': 'html4css1.css, ham.css'}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
if (TEST_ROOT / '../docutils/writers/html4css1/').is_dir():
self.assertIn('docutils/writers/html4css1/html4css1.css', styles)
@@ -152,7 +152,7 @@
TEST_ROOT / '../docutils/writers/html4css1/',
DATA_ROOT),
'stylesheet_path': 'ham.css'}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('dl.docutils dd {\n margin-bottom: 0.5em }', styles)
@@ -175,7 +175,7 @@
def test_math_output_default(self):
# HTML with math.css stylesheet (since 0.11)
mys = {'_disable_config': True}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertIn('convert LaTeX equations to HTML output.', styles)
@@ -185,7 +185,7 @@
mys = {'_disable_config': True,
'report_level': 3,
'math_output': 'MathJax'}
- head = core.publish_parts(self.data, writer_name='html4css1',
+ head = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['head']
self.assertIn(self.mathjax_script % self.default_mathjax_url, head)
@@ -194,7 +194,7 @@
mys = {'_disable_config': True,
'math_output':
'mathjax %s' % self.custom_mathjax_url}
- head = core.publish_parts(self.data, writer_name='html4css1',
+ head = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['head']
self.assertIn(self.mathjax_script % self.custom_mathjax_url, head)
@@ -201,7 +201,7 @@
def test_math_output_html(self):
mys = {'_disable_config': True,
'math_output': 'HTML'}
- head = core.publish_parts(self.data, writer_name='html4css1',
+ head = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['head']
# There should be no MathJax script when math_output is not MathJax
self.assertNotIn('MathJax.js', head)
@@ -213,7 +213,7 @@
TEST_ROOT,
os.path.join(TEST_ROOT, 'functional/input/data')),
'embed_stylesheet': False}
- styles = core.publish_parts(self.data, writer_name='html4css1',
+ styles = core.publish_parts(self.data, writer='html4css1',
settings_overrides=mys)['stylesheet']
self.assertEqual(f"""\
<link rel="stylesheet" href="{html4css1_css}" type="text/css" />
@@ -223,7 +223,7 @@
def test_math_output_mathjax_no_math(self):
# There should be no math script when text does not contain math
- head = core.publish_parts('No math.', writer_name='html4css1')['head']
+ head = core.publish_parts('No math.', writer='html4css1')['head']
self.assertNotIn('MathJax', head)
Modified: trunk/docutils/test/test_writers/test_html4css1_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_parts.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html4css1_parts.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -41,13 +41,13 @@
maxDiff = None
def test_publish(self):
- writer_name = 'html4'
+ writer = 'html4'
for name, (settings_overrides, cases) in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
parts = docutils.core.publish_parts(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_html4css1_template.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_template.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html4css1_template.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -29,7 +29,7 @@
class WriterPublishTestCase(unittest.TestCase):
# maxDiff = None
def test_publish(self):
- writer_name = 'html4'
+ writer = 'html4'
template_path = TEST_ROOT / 'data/full-template.txt'
for name, cases in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
@@ -36,7 +36,7 @@
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_misc.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -39,7 +39,7 @@
'stylesheet': '',
'_disable_config': True}
result = core.publish_string(
- 'EUR = \u20ac', writer_name='html5_polyglot',
+ 'EUR = \u20ac', writer='html5_polyglot',
settings_overrides=settings_overrides)
# Encoding a euro sign with latin1 doesn't work, so the
# xmlcharrefreplace handler is used.
@@ -65,7 +65,7 @@
second term:
second def
"""
- result = core.publish_string(data, writer_name='html5_polyglot',
+ result = core.publish_string(data, writer='html5_polyglot',
settings_overrides=self.mys).decode()
self.assertIn('<dt class="for the second item">second term:</dt>',
result)
@@ -82,7 +82,7 @@
second term:
second def
"""
- result = core.publish_string(data, writer_name='html5_polyglot',
+ result = core.publish_string(data, writer='html5_polyglot',
settings_overrides=self.mys).decode()
self.assertIn('<dt id="second-item">second term:</dt>',
result)
@@ -97,7 +97,7 @@
def test_default_stylesheet(self):
# default style sheet, embedded
mys = {'_disable_config': True}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertIn('Minimal style sheet '
'for the HTML output of Docutils.', styles)
@@ -106,7 +106,7 @@
# default style sheet, linked
mys = {'_disable_config': True,
'embed_stylesheet': False}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html5_polyglot/minimal.css', styles)
@@ -115,7 +115,7 @@
mys = {'_disable_config': True,
'embed_stylesheet': False,
'stylesheet_path': 'minimal.css, math.css'}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html5_polyglot/minimal.css', styles)
self.assertIn('docutils/writers/html5_polyglot/math.css', styles)
@@ -126,7 +126,7 @@
'embed_stylesheet': False,
'stylesheet_path': 'minimal.css, '
'data/ham.css'}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertIn('docutils/writers/html5_polyglot/minimal.css', styles)
self.assertIn('href="data/ham.css"', styles)
@@ -138,7 +138,7 @@
TEST_ROOT / '../docutils/writers/html5_polyglot/',
DATA_ROOT),
'stylesheet_path': 'minimal.css, ham.css'}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
if (TEST_ROOT / '../docutils/writers/html5_polyglot/').is_dir():
self.assertIn('docutils/writers/html5_polyglot/minimal.css', styles)
@@ -151,7 +151,7 @@
TEST_ROOT / '../docutils/writers/html5_polyglot/',
DATA_ROOT),
'stylesheet_path': 'ham.css'}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertIn('dl.docutils dd {\n margin-bottom: 0.5em }', styles)
@@ -163,7 +163,7 @@
}
with self.assertWarnsRegex(FutureWarning,
'"embed_images"\n will be removed'):
- core.publish_string('warnings test', writer_name='html5',
+ core.publish_string('warnings test', writer='html5',
settings_overrides=my_settings)
@@ -186,7 +186,7 @@
def test_math_output_default(self):
# default math output is MathML (since 0.22)
mys = {'_disable_config': True}
- fragment = core.publish_parts(self.data, writer_name='html5_polyglot',
+ fragment = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['fragment']
self.assertIn('<mn>42</mn>', fragment)
@@ -196,7 +196,7 @@
mys = {'_disable_config': True,
'report_level': 3,
'math_output': 'MathJax'}
- head = core.publish_parts(self.data, writer_name='html5_polyglot',
+ head = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['head']
self.assertIn(self.mathjax_script % self.default_mathjax_url, head)
@@ -205,7 +205,7 @@
mys = {'_disable_config': True,
'math_output':
'mathjax %s' % self.custom_mathjax_url}
- head = core.publish_parts(self.data, writer_name='html5_polyglot',
+ head = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['head']
self.assertIn(self.mathjax_script % self.custom_mathjax_url, head)
@@ -212,7 +212,7 @@
def test_math_output_html(self):
mys = {'_disable_config': True,
'math_output': 'HTML'}
- head = core.publish_parts(self.data, writer_name='html5_polyglot',
+ head = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['head']
# There should be no MathJax script when math_output is not MathJax
self.assertNotIn('MathJax.js', head)
@@ -224,7 +224,7 @@
TEST_ROOT,
TEST_ROOT / 'functional/input/data'),
'embed_stylesheet': False}
- styles = core.publish_parts(self.data, writer_name='html5_polyglot',
+ styles = core.publish_parts(self.data, writer='html5_polyglot',
settings_overrides=mys)['stylesheet']
self.assertEqual(f"""\
<link rel="stylesheet" href="{minimal_css}" type="text/css" />
@@ -235,7 +235,7 @@
def test_math_output_mathjax_no_math(self):
# There should be no math script when text does not contain math
- head = core.publish_parts('No math.', writer_name='html5_polyglot')['head']
+ head = core.publish_parts('No math.', writer='html5_polyglot')['head']
self.assertNotIn('MathJax', head)
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -74,13 +74,13 @@
def test_publish(self):
if not with_pygments:
del totest['syntax_highlight']
- writer_name = 'html5'
+ writer = 'html5'
for name, (settings_overrides, cases) in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
parts = docutils.core.publish_parts(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_html5_template.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_template.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_html5_template.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -29,7 +29,7 @@
class WriterPublishTestCase(unittest.TestCase):
# maxDiff = None
def test_publish(self):
- writer_name = 'html5'
+ writer = 'html5'
template_path = TEST_ROOT / 'data/full-template.txt'
for name, cases in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
@@ -36,7 +36,7 @@
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -35,7 +35,7 @@
class WriterPublishTestCase(unittest.TestCase):
maxDiff = None
- writer_name = 'latex'
+ writer = 'latex'
settings = {
'_disable_config': True,
'strict_visitor': True,
@@ -49,7 +49,7 @@
for casenum, (rst_input, expected) in enumerate(cases):
with self.subTest(id=f'samples_default[{name!r}][{casenum}]'):
output = publish_string(source=rst_input,
- writer_name=self.writer_name,
+ writer=self.writer,
settings_overrides=settings)
output = output.decode()
self.assertEqual(expected, output)
Modified: trunk/docutils/test/test_writers/test_latex2e_misc.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e_misc.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_latex2e_misc.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -88,7 +88,7 @@
doctree = core.publish_doctree(sample_toc,
settings_overrides=settings)
result = core.publish_from_doctree(doctree,
- writer_name='latex',
+ writer='latex',
settings_overrides=settings)
self.assertNotIn(r'\item \hyperref[foo]{foo}', result)
self.assertIn(r'\tableofcontents', result)
@@ -97,7 +97,7 @@
"""Check for the presence of documented parts.
"""
parts = core.publish_parts(sample_multiterm,
- writer_name='latex',
+ writer='latex',
settings_overrides=self.settings)
documented_parts = [
'abstract',
@@ -135,11 +135,11 @@
}
with self.assertWarnsRegex(FutureWarning,
'"legacy_column_widths" will change'):
- core.publish_string('warnings test', writer_name='latex',
+ core.publish_string('warnings test', writer='latex',
settings_overrides=settings)
with self.assertWarnsRegex(FutureWarning,
'"use_latex_citations" will change'):
- core.publish_string('warnings test', writer_name='latex',
+ core.publish_string('warnings test', writer='latex',
settings_overrides=settings)
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_manpage.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -24,13 +24,13 @@
maxDiff = None
def test_publish(self):
- writer_name = 'manpage'
+ writer = 'manpage'
for name, cases in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_null.py
===================================================================
--- trunk/docutils/test/test_writers/test_null.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_null.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -22,13 +22,13 @@
class WriterPublishTestCase(unittest.TestCase):
def test_publish(self):
- writer_name = 'null'
+ writer = 'null'
for name, cases in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_odt.py
===================================================================
--- trunk/docutils/test/test_writers/test_odt.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_odt.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -77,8 +77,8 @@
result = docutils.core.publish_string(
source=source,
source_path=input_path,
- reader_name='standalone',
- writer_name='odf_odt',
+ reader='standalone',
+ writer='odf_odt',
settings_overrides=settings_overrides)
# msg = 'file length not equal: expected length: %d actual length: %d' % (
# len(expected), len(result), )
Modified: trunk/docutils/test/test_writers/test_pseudoxml.py
===================================================================
--- trunk/docutils/test/test_writers/test_pseudoxml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_pseudoxml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -24,7 +24,7 @@
maxDiff = None
def test_publish(self):
- writer_name = 'pseudoxml'
+ writer = 'pseudoxml'
for name, cases in totest.items():
for casenum, (case_input, case_expected) in enumerate(cases):
@@ -31,7 +31,7 @@
with self.subTest(id=f'totest[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
@@ -43,7 +43,7 @@
with self.subTest(id=f'totest_detailed[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides={
'_disable_config': True,
'strict_visitor': True,
Modified: trunk/docutils/test/test_writers/test_s5.py
===================================================================
--- trunk/docutils/test/test_writers/test_s5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/test/test_writers/test_s5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -25,7 +25,7 @@
class WriterPublishTestCase(unittest.TestCase):
def test_publish(self):
- writer_name = 's5'
+ writer = 's5'
settings = {
'_disable_config': True,
'strict_visitor': True,
@@ -38,7 +38,7 @@
with self.subTest(id=f'totest_1[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides=settings.copy()
).decode()
self.assertEqual(case_expected, output)
@@ -50,7 +50,7 @@
with self.subTest(id=f'totest_2[{name!r}][{casenum}]'):
output = publish_string(
source=case_input,
- writer_name=writer_name,
+ writer=writer,
settings_overrides=settings.copy()
).decode()
self.assertEqual(case_expected, output)
Modified: trunk/docutils/tools/buildhtml.py
===================================================================
--- trunk/docutils/tools/buildhtml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/buildhtml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -140,16 +140,16 @@
SettingsSpec)),
'html4': Struct(components=(rst.Parser, standalone.Reader,
html4css1.Writer, SettingsSpec),
- reader_name='standalone',
- writer_name='html4'),
+ reader='standalone',
+ writer='html4'),
'html5': Struct(components=(rst.Parser, standalone.Reader,
html5_polyglot.Writer, SettingsSpec),
- reader_name='standalone',
- writer_name='html5'),
+ reader='standalone',
+ writer='html5'),
'PEPs': Struct(components=(rst.Parser, pep.Reader,
pep_html.Writer, SettingsSpec),
- reader_name='pep',
- writer_name='pep_html')}
+ reader='pep',
+ writer='pep_html')}
"""Publisher-specific settings. Key '' is for the front-end script
itself. ``self.publishers[''].components`` must contain a superset of
all components used by individual publishers."""
@@ -280,9 +280,9 @@
try:
core.publish_file(source_path=settings._source,
destination_path=settings._destination,
- reader_name=pub_struct.reader_name,
- parser_name='restructuredtext',
- writer_name=pub_struct.writer_name,
+ reader=pub_struct.reader,
+ parser='restructuredtext',
+ writer=pub_struct.writer,
settings=settings)
except ApplicationError as err:
errout.write(f' {type(err).__name__}: {err}\n')
Modified: trunk/docutils/tools/dev/profile_docutils.py
===================================================================
--- trunk/docutils/tools/dev/profile_docutils.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/dev/profile_docutils.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -16,7 +16,7 @@
prof = hotshot.Profile('docutils.prof')
prof.runcall(docutils.core.publish_file, source_path='HISTORY.txt',
- destination_path='prof.HISTORY.html', writer_name='html')
+ destination_path='prof.HISTORY.html', writer='html')
prof.close()
print('Loading statistics...')
Modified: trunk/docutils/tools/rst2html.py
===================================================================
--- trunk/docutils/tools/rst2html.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2html.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -20,4 +20,4 @@
description = ('Generates (X)HTML documents from standalone reStructuredText '
'sources. ' + default_description)
-publish_cmdline(writer_name='html', description=description)
+publish_cmdline(writer='html', description=description)
Modified: trunk/docutils/tools/rst2html4.py
===================================================================
--- trunk/docutils/tools/rst2html4.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2html4.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -23,4 +23,4 @@
description = ('Generates (X)HTML documents from standalone reStructuredText '
'sources. ' + default_description)
-publish_cmdline(writer_name='html4', description=description)
+publish_cmdline(writer='html4', description=description)
Modified: trunk/docutils/tools/rst2html5.py
===================================================================
--- trunk/docutils/tools/rst2html5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2html5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -30,4 +30,4 @@
'reStructuredText sources.\n'
+ default_description)
-publish_cmdline(writer_name='html5', description=description)
+publish_cmdline(writer='html5', description=description)
Modified: trunk/docutils/tools/rst2latex.py
===================================================================
--- trunk/docutils/tools/rst2latex.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2latex.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -23,4 +23,4 @@
'<https://docutils.sourceforge.io/docs/user/latex.html> for '
'the full reference.')
-publish_cmdline(writer_name='latex', description=description)
+publish_cmdline(writer='latex', description=description)
Modified: trunk/docutils/tools/rst2s5.py
===================================================================
--- trunk/docutils/tools/rst2s5.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2s5.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -21,4 +21,4 @@
description = ('Generates S5 (X)HTML slideshow documents from standalone '
'reStructuredText sources. ' + default_description)
-publish_cmdline(writer_name='s5', description=description)
+publish_cmdline(writer='s5', description=description)
Modified: trunk/docutils/tools/rst2xetex.py
===================================================================
--- trunk/docutils/tools/rst2xetex.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2xetex.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -24,4 +24,4 @@
'<https://docutils.sourceforge.io/docs/user/latex.html> for '
'the full reference.')
-publish_cmdline(writer_name='xetex', description=description)
+publish_cmdline(writer='xetex', description=description)
Modified: trunk/docutils/tools/rst2xml.py
===================================================================
--- trunk/docutils/tools/rst2xml.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rst2xml.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -20,4 +20,4 @@
description = ('Generates Docutils-native XML from standalone '
'reStructuredText sources. ' + default_description)
-publish_cmdline(writer_name='xml', description=description)
+publish_cmdline(writer='xml', description=description)
Modified: trunk/docutils/tools/rstpep2html.py
===================================================================
--- trunk/docutils/tools/rstpep2html.py 2024-06-18 07:44:50 UTC (rev 9770)
+++ trunk/docutils/tools/rstpep2html.py 2024-06-18 08:00:10 UTC (rev 9771)
@@ -21,5 +21,5 @@
description = ('Generates (X)HTML from reStructuredText-format PEP files. '
+ default_description)
-publish_cmdline(reader_name='pep', writer_name='pep_html',
+publish_cmdline(reader='pep', writer='pep_html',
description=description)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.