Various small fixes.

Markup "long description" in README as "abstract".

Solve QA: ISC001 in LaTeX writer.

Fix naming of auxiliary variables in _html_base.HTMLTranslator.prepare_svg().
The "style" attribute (as one of the "image" node attributes ("atts"))
contains a list of ";"-separated style declarations.
Fixes r10024 and r10026.

Fix cross-link.

git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@10049 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
This commit is contained in:
milde
2025-03-09 11:23:28 +00:00
parent f0fd900221
commit b03327354b
4 changed files with 20 additions and 21 deletions

View File

@@ -8,10 +8,10 @@
:Web site: https://docutils.sourceforge.io/
:Copyright: This document has been placed in the public domain.
Docutils is a modular system for processing documentation
into useful formats, such as HTML, XML, and LaTeX.
For input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.
:Abstract: Docutils is a modular system for processing documentation into
useful formats, such as HTML, XML, and LaTeX.
For input Docutils supports reStructuredText, an easy-to-read,
what-you-see-is-what-you-get plaintext markup syntax.
.. contents::

View File

@@ -495,16 +495,16 @@ class HTMLTranslator(writers.DoctreeTranslator):
# Apply image node attributes:
if 'style' in atts:
# update style declarations
clean_atts = {}
svg_style = svg.get('style', '').split(';')
style_atts = atts['style'].split(';')
for att in svg_style + style_atts:
if not att.strip():
declaration_dict = {}
svg_declarations = svg.get('style', '').split(';')
node_declarations = atts['style'].split(';')
for declaration in svg_declarations + node_declarations:
if not declaration.strip():
continue
key, _, value = att.partition(':')
clean_atts[key.strip()] = value.strip()
style_att = ' '.join(f'{k}: {v};' for k, v in clean_atts.items())
svg.set('style', style_att)
key, _, value = declaration.partition(':')
declaration_dict[key.strip()] = value.strip()
svg.set('style', ' '.join(f'{k}: {v};'
for k, v in declaration_dict.items()))
for dimension in ('width', 'height'):
if dimension in atts:
svg.set(dimension, atts[dimension])

View File

@@ -2581,13 +2581,12 @@ class LaTeXTranslator(writers.DoctreeTranslator):
Corresponding rST elements: literal block, parsed-literal, code.
"""
packages = {
'lstlisting': r'\usepackage{listings}' '\n' # NoQA: ISC001
r'\lstset{xleftmargin=\leftmargin}',
'listing': r'\usepackage{moreverb}',
'Verbatim': r'\usepackage{fancyvrb}',
'verbatimtab': r'\usepackage{moreverb}',
}
packages = {'lstlisting': '\\usepackage{listings}\n'
'\\lstset{xleftmargin=\\leftmargin}',
'listing': r'\usepackage{moreverb}',
'Verbatim': r'\usepackage{fancyvrb}',
'verbatimtab': r'\usepackage{moreverb}',
}
literal_env = self.literal_block_env

View File

@@ -99,7 +99,7 @@ Powered by |Python|_.
https://docutils.sourceforge.io/docs/index.html
.. _Docutils' Subversion repository:
https://docutils.sourceforge.io/docs/dev/repository.html
.. _requirement: https://docutils.sourceforge.io/README.html#requirements
.. _requirement: https://docutils.sourceforge.io/README.html#dependencies
.. _release packages: https://pypi.org/project/docutils/#files
.. _PyPI: https://pypi.org
.. _release notes: https://docutils.sourceforge.io/RELEASE-NOTES.html