summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2020-01-30 21:35:05 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2020-01-30 21:35:05 +0000
commit0ddb9c2b6a3eb4da6d00f3bc693156fc5026e67f (patch)
tree0987bfbe9715b105fe66b87a17ab946a81188075 /docutils
parent0753186270fe9309087aefc48cce284a12e62194 (diff)
downloaddocutils-0ddb9c2b6a3eb4da6d00f3bc693156fc5026e67f.tar.gz
latex writer: announced changes.
Remove backwards compatibility code for the deprecated `styling command`__ prefix ``\docutilsrole``. Log entries for new setting "legacy_class_functions". git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8480 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/HISTORY.txt13
-rw-r--r--docutils/RELEASE-NOTES.txt19
-rw-r--r--docutils/docutils/writers/latex2e/__init__.py11
-rw-r--r--docutils/test/functional/expected/latex_literal_block.tex11
-rw-r--r--docutils/test/functional/expected/latex_literal_block_fancyvrb.tex11
-rw-r--r--docutils/test/functional/expected/latex_literal_block_listings.tex11
-rw-r--r--docutils/test/functional/expected/latex_literal_block_verbatim.tex11
-rw-r--r--docutils/test/functional/expected/latex_literal_block_verbatimtab.tex11
-rw-r--r--docutils/test/functional/expected/standalone_rst_latex.tex11
-rw-r--r--docutils/test/functional/expected/standalone_rst_xetex.tex11
-rwxr-xr-xdocutils/test/test_writers/test_latex2e.py15
11 files changed, 45 insertions, 90 deletions
diff --git a/docutils/HISTORY.txt b/docutils/HISTORY.txt
index d42e70ddb..b1a689c38 100644
--- a/docutils/HISTORY.txt
+++ b/docutils/HISTORY.txt
@@ -46,6 +46,18 @@ Changes Since 0.16
- Use HTML tags <ins> and <del> if a matching class value
is found in `inline`, `literal`, or `container` elements.
+* docutils/writers/latex2e/__init__.py:
+
+ - Use LaTeX environments for admonitions and "class wrappers" for styling
+ admonitions and titles if the new configuration setting
+ `legacy_class_functions`_ is False.
+
+ - Remove backwards compatibility code for the deprecated
+ `styling command`__ prefix ``\docutilsrole``.
+
+ __ docs/user/latex.html#classes
+
+
Release 0.16
============
@@ -185,7 +197,6 @@ Release 0.15 (2019-07-20)
* docutils/parsers/rst/states.py:
- Allow embedded colons in field list field names.
- - Add `rawsource` attribute for text of inline elements.
* docutils/parsers/rst/directives/html.py:
diff --git a/docutils/RELEASE-NOTES.txt b/docutils/RELEASE-NOTES.txt
index 4bbff6489..2b825492b 100644
--- a/docutils/RELEASE-NOTES.txt
+++ b/docutils/RELEASE-NOTES.txt
@@ -25,13 +25,9 @@ Future changes
* Installing with ``setup.py`` will require setuptools_ in versions > 0.16.
* LaTeX writer:
- Wrap admonitions in a "DUclass" environment. Stylesheets modifying
- "\DUadmonition" will need to adapt.
-
- Styling commands using ``\docutilsrole`` prefix will be ignored in
- versions > 0.16 (see `Generating LaTeX with Docutils`__).
-
- __ docs/user/latex.html#classes
+ The default for the configuration setting `legacy_class_functions`_ will
+ change to "False". Adapt stylesheets modifying ``\DUadmonition``
+ and/or ``\DUtitle`` or set to "True".
* ``Node.traverse()`` will return an iterator instead of a list.
@@ -66,6 +62,7 @@ Future changes
.. _rst2html.py: docs/user/tools.html#rst2html-py
.. _reference name: docs/ref/rst/restructuredtext.html#reference-names
.. _identifier normalization: directives.html#identifier-normalization
+.. _legacy_class_functions: docs/user/config.html#legacy-class-functions
Release 0.17
@@ -84,6 +81,14 @@ Release 0.17
- Use HTML tags <ins> and <del> if a matching class value
is found in `inline`, `literal`, or `container` elements.
+* LaTeX writer:
+
+ - New configuration setting `legacy_class_functions`_.
+
+ - `Styling commands`__ using the legacy ``\docutilsrole`` prefix are
+ now ignored. Use ``\DUrole``.
+
+ __ docs/user/latex.html#classes
Release 0.16 (2020-01-12)
=========================
diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index 97895a15c..8bb96e17d 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -613,15 +613,8 @@ PreambleCmds.inline = r"""
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}"""
diff --git a/docutils/test/functional/expected/latex_literal_block.tex b/docutils/test/functional/expected/latex_literal_block.tex
index ecab4a343..11d62605a 100644
--- a/docutils/test/functional/expected/latex_literal_block.tex
+++ b/docutils/test/functional/expected/latex_literal_block.tex
@@ -61,15 +61,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex b/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
index 72ba00260..f25ee22d8 100644
--- a/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
+++ b/docutils/test/functional/expected/latex_literal_block_fancyvrb.tex
@@ -61,15 +61,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/latex_literal_block_listings.tex b/docutils/test/functional/expected/latex_literal_block_listings.tex
index 2d8fa28ab..2e52bc9fe 100644
--- a/docutils/test/functional/expected/latex_literal_block_listings.tex
+++ b/docutils/test/functional/expected/latex_literal_block_listings.tex
@@ -67,15 +67,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/latex_literal_block_verbatim.tex b/docutils/test/functional/expected/latex_literal_block_verbatim.tex
index 94e50507d..2f3a78af0 100644
--- a/docutils/test/functional/expected/latex_literal_block_verbatim.tex
+++ b/docutils/test/functional/expected/latex_literal_block_verbatim.tex
@@ -60,15 +60,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex b/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
index 0235d3b13..4e45eebd0 100644
--- a/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
+++ b/docutils/test/functional/expected/latex_literal_block_verbatimtab.tex
@@ -61,15 +61,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/standalone_rst_latex.tex b/docutils/test/functional/expected/standalone_rst_latex.tex
index 0654c772e..a39cf46c6 100644
--- a/docutils/test/functional/expected/standalone_rst_latex.tex
+++ b/docutils/test/functional/expected/standalone_rst_latex.tex
@@ -106,15 +106,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/functional/expected/standalone_rst_xetex.tex b/docutils/test/functional/expected/standalone_rst_xetex.tex
index d2a448566..b23c81fa5 100644
--- a/docutils/test/functional/expected/standalone_rst_xetex.tex
+++ b/docutils/test/functional/expected/standalone_rst_xetex.tex
@@ -105,15 +105,8 @@
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
diff --git a/docutils/test/test_writers/test_latex2e.py b/docutils/test/test_writers/test_latex2e.py
index 4e2de8dfa..d099ef622 100755
--- a/docutils/test/test_writers/test_latex2e.py
+++ b/docutils/test/test_writers/test_latex2e.py
@@ -12,7 +12,9 @@ from __future__ import absolute_import
import string
-from . import DocutilsTestSupport
+if __name__ == '__main__':
+ import __init__
+from test_transforms import DocutilsTestSupport # must be imported before docutils
def suite():
@@ -81,15 +83,8 @@ fallbacks_highlight = r"""% basic code highlight:
\providecommand*{\DUrole}[2]{%
\ifcsname DUrole#1\endcsname%
\csname DUrole#1\endcsname{#2}%
- \else
- % backwards compatibility: try \docutilsrole#1{#2}
- \ifcsname docutilsrole#1\endcsname%
- \PackageWarningNoLine{docutils}{Command prefix "docutilsrole" is
- deprecated, \MessageBreak use `\protect\DUrole #1`}
- \csname docutilsrole#1\endcsname{#2}%
- \else%
- #2%
- \fi%
+ \else%
+ #2%
\fi%
}
""",